Allow default values in row headings to be translatable as content #13703
-
|
Hello, Right now it can be partially solved by Static message translations which can translate the strings. https://craftcms.com/docs/4.x/sites.html#static-message-translations If the Field default values could be made translatable for each site/language it would make things easier. It makes sense if Default values in each field match the target language. Edit: Specifically for Default values, Row Headings and other strings used in frontend the translation should be according to site language, not CP language. So if you use CP in English and edit German site then Default values and Row Headings should be translated to German. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
|
Definitely something that should be implemented. We can switch language of control panel and all its built in text content, like "save", "delete" and such, but we cannot do the same for the fields. This is detrimental to multi-lingual teams working on the same project. Not to mention that some field labels or settings are sometimes used on the frontend too, like mentioned table headings. |
Beta Was this translation helpful? Give feedback.
-
|
So according to this issue #13763 it looks like row headings in CP are always statically translated according to CP language, not selected site language. So I also propose there should be some way for row headings to be translated according to selected site language, not CP language. It would make sense in cases when row headings are treated as content and rendered by twig in frontend. So row headings language in backend should match the frontend. I tried to make it work myself and its easily achievable by simple edit in https://github.com/craftcms/cms/blob/develop/src/fields/Table.php So basically replace this block: By this block: |
Beta Was this translation helpful? Give feedback.
-
|
Still hope this will be improved someday :) |
Beta Was this translation helpful? Give feedback.
-
|
I tried via patching. Using module would require to maintain the whole _normalizeValueInternal function which is unreasonable for single line change. |
Beta Was this translation helpful? Give feedback.
-
This is now fixed for the next release: e967d09 |
Beta Was this translation helpful? Give feedback.
This is now fixed for the next release: e967d09