-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
feat: add translation context for select options label #26352
base: develop
Are you sure you want to change the base?
feat: add translation context for select options label #26352
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make sure that variable names make sense in the future 😄
df
is often used for the docfield object, not just it's name. So this could be confusing
43997df
to
a5f5cfa
Compare
…dd_translation_context_for_select_option
@barredterra Don't you have the same issue with German translation ? |
Currently the code generating the translation files only allows for two context types:
So, if you change your code to only use the DocType as context, this should be good to go. See also: #24903 |
@barredterra This is not the only case where context is "Typed/field" named frappe/frappe/public/js/frappe/utils/utils.js Line 1114 in 2953c16
Here there is type of the field and another information for the context |
Yes, but there it's a string literal, not a variable. |
This translation context with |
ok, ok, I tried. @barredterra, once again for me: RTFM , shame But I will push a little more : The real "unique key" of translation is DocType (or context) + FieldName. If you both think this PR have no chance to be merge, I will close it in favor of @cogk PR (#26425) (hoping it will be merge), but I still believe that all output have to be contextualize in a unique way. |
On input type select the options value may need context for translation.
For example in Letter Head field align is a select as select Left/Right/....
in French/English
Left can be translated as "Left"(en) => "Parti"(fr) : the preterit of the verb "to leave"
Left can be translated as "Left"(en) => "Gauche"(fr) : the direction
I can't just put french translation for "Left,Gauche" because in other Doctype "Left" really mean "to leave"
I suggest to have a contextual translation options here
send dt and df in parse_option to allow __(xx,null,context) top be build correctly according the context