mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[ADD] Translation feature
This commit brings back the possibility to translate text nodes and the attributes "label", "title", "placeholder", and "alt" in an app configured with a suitable translation function. It is also possible to deactivate translations under a node via the directive t-translation="off". For flexibility it is possible to define the list of translatable attributes in the app.
This commit is contained in:
committed by
Géry Debongnie
parent
e2d98e4c26
commit
b8649f1add
@@ -23,6 +23,12 @@ export class App<T extends typeof Component = any> extends TemplateSet {
|
||||
if (params.env) {
|
||||
this.env = params.env;
|
||||
}
|
||||
if (params.translateFn) {
|
||||
this.translateFn = params.translateFn;
|
||||
}
|
||||
if (params.translatableAttributes) {
|
||||
this.translatableAttributes = params.translatableAttributes;
|
||||
}
|
||||
}
|
||||
|
||||
mount(target: HTMLElement): Promise<InstanceType<T>> {
|
||||
|
||||
Reference in New Issue
Block a user