[IMP] compiler: translatableAttributes can be added/removed

This commit is contained in:
Géry Debongnie
2022-02-03 13:31:30 +01:00
committed by Aaron Bohy
parent 140818b5f9
commit 2c1226d737
4 changed files with 32 additions and 9 deletions
+12 -1
View File
@@ -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...
```