Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Internationalization
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jun 2018 at 11:52 UTC
Updated:
7 Nov 2018 at 10:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
idiaz.ronceroAlso a pull request here: https://github.com/drupalcommerce/commerce/pull/856
Comment #3
bojanz commentedRetitling for clarity.
Unfortunately, this fix won't work. Config is saved in the default site language, and using t() here will use the user's current language.
So if I have a site with French as the default language and Serbian as the second language, and I edit the page in Serbian, the Serbian version of the label will be saved to config, even though the langcode will be "fr". And then on the site, both "fr" and "sr" pages will show the Serbian text.
Our main problem is that Drupal core doesn't support translating widget settings yet.
Comment #4
megadesk3000 commentedHey
I made the patch a little different. So putting the configured string into t function during rendering the widget. Like that, the text can be translated afterwards.
I know its not the cleanest solution, since t() should only contain string litereals, but i think thats acceptable until there is a better solution.
What do you think?
Comment #5
megadesk3000 commentedComment #7
bojanz commentedI agree, let's proceed with #4 as a workaround. Added a code comment as an explanation.