mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] compiler: translatableAttributes can be added/removed
This commit is contained in:
committed by
Michaël Mattiello
parent
9424312573
commit
5a7928d3e4
@@ -54,6 +54,17 @@ For example, one may want to also translate `data-title` attributes. To do that,
|
||||
we can define additional attributes with the `translatableAttributes` option:
|
||||
|
||||
```js
|
||||
const app = new App(Root, { templates, tranaslateFn, translatalbeAttributes: ["data-title"] });
|
||||
const app = new App(Root, { templates, tranaslateFn, translatableAttributes: ["data-title"] });
|
||||
// ...
|
||||
```
|
||||
|
||||
It is also possible to remove an attribute from the default list by prefixing it with `-`:
|
||||
|
||||
```js
|
||||
const app = new App(Root, {
|
||||
templates,
|
||||
tranaslateFn,
|
||||
translatableAttributes: ["data-title", "-title"],
|
||||
});
|
||||
// data-title attribute will be translated, but not title attribute...
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user