Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] translation contexts #1664

Merged
merged 1 commit into from
Jan 15, 2025
Merged

[IMP] translation contexts #1664

merged 1 commit into from
Jan 15, 2025

Conversation

Polymorphe57
Copy link
Contributor

@Polymorphe57 Polymorphe57 commented Jan 10, 2025

A new directive t-tanslation-context and a new family of directives (of the form
t-translation-context-...) are introduced to allow to translate terms in contexts.

Set t-translation-context="fr" on a node makes every call of the translation
function to be done with "fr" as seconde parameter when translating an
attribute/content within that node or its children (if no closer
t-translation-context directive is found).
A directive t-translation-context-attr="fr" can be used on a node to target its
attribute "attr". For example, if a div has an attribute title="a title",
use t-translation-context-title="pt" will make "a title" to be translated
in the context "pt". Note that this takes precedence over any other directive
t-translation-context found on a parent (or the div itself).
The translation function is in charge of the interpretation of the context: OWL
does not associate any meaning with a translation context.

@Polymorphe57 Polymorphe57 force-pushed the master-translation-context-dam branch 3 times, most recently from 476ad90 to 501d37c Compare January 10, 2025 12:39
@Polymorphe57 Polymorphe57 changed the title [IMP] translation context [IMP] translation contexts Jan 10, 2025
@Polymorphe57 Polymorphe57 force-pushed the master-translation-context-dam branch 23 times, most recently from cae291b to 3e327c2 Compare January 14, 2025 14:43
A new directive t-tanslation-context and a new family of directives (of the form
t-translation-context-...) are introduced to allow to translate terms in contexts.

Set t-translation-context="fr" on a node makes every call of the translation
function to be done with "fr" as seconde parameter when translating an
attribute/content within that node or its children (if no closer
t-translation-context directive is found).
A directive t-translation-context-attr="fr" can be used on a node to target its
attribute "attr". For example, if a div has an attribute title="a title",
use t-translation-context-title="pt" will make "a title" to be translated
in the context "pt". Note that this takes precedence over any other directive
t-translation-context found on a parent (or the div itself).
The translation function is in charge of the interpretation of the context: OWL
does not associate any meaning with a translation context.
@Polymorphe57 Polymorphe57 force-pushed the master-translation-context-dam branch from 3e327c2 to 9a7d3e4 Compare January 14, 2025 15:37
@ged-odoo ged-odoo merged commit a9be149 into master Jan 15, 2025
2 checks passed
@ged-odoo ged-odoo deleted the master-translation-context-dam branch January 15, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants