Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I have a problem with translation method. Example:
1. "Order" translation in Drupal Core (in Hungarian: "Sorrend")
2. "Order" translation in Drupal Commerce (in Hungarian: "Rendelés")
The problem: Sorrend != Rendelés
Order (Sorrend) translation is correct in Drupal Core context, but incorrect in Drupal Commerce context.
Translation Reference:
https://localize.drupal.org/translate/languages/hu/translate?sid=22144
Comment | File | Size | Author |
---|---|---|---|
incorrect_translation.png | 11.42 KB | ecrazor |
Comments
Comment #2
ecrazor CreditAttribution: ecrazor commentedComment #4
Sutharsan CreditAttribution: Sutharsan at LimoenGroen commentedThis same problem exists in Dutch.
We should first decide which context should be the default and which the exception. Sort order or purchase order.
In core I find 'Order' (as single string) being used in the context of sort order in:
- template_preprocess_field_multiple_value_form
- \Drupal\views\Plugin\views\sort\SortPluginBase::showSortForm
Comment #15
mstrelan CreditAttribution: mstrelan at PreviousNext commentedI reviewed this as part of the Bug Smash Initiative.
According to the Internationalization documentation there is already a way to provide context to string translations.
In fact there are a number of places in core that provide "Sort order" as the context for the string "Order".
In order to progress this issue we need more information on how to reproduce the issue. Is there a particular usage of the word "Order" that does not have the right context provided? Does commerce need to provide context to differentiate it?
It may also be useful to refer to #1035716: [policy, no patch] Decide and document guidelines for using string context.
Comment #16
mstrelan CreditAttribution: mstrelan at PreviousNext commentedFurther to #15 I see Commerce order entities uses the string context "Commerce". I suspect you may need to just ensure the correct context is used for the translation.
Comment #18
smustgrave CreditAttribution: smustgrave at Mobomo commentedSince there hasn't been a follow up to #15 going to close this one as outdated.
If still a bug please reopen, maybe updating issue summary.
Thanks all!