Norwegian Bokmål uses the "nb" code but the general code for Norwegian "no" is also used in some contexts, causing confusion to our systems.
For example, Content Translation shows inconsistencies in language code treatment at several places:
- On the translation dashboard, starting a translation by searching a new article results in the "nb" code to be used, while starting from a suggestions results in the "no" code to be used instead.
- Starting a translation with the "no" or "nb" codes will result in having a different set of machine translation services listed since "nb" is used for Yandex and for Apertium configurations and "no" is used for Google and for MinT
Since external tools can create their own urls using any version of the language codes, this ticket is focused on normalizing the language codes in the url for languages that may have alternative codes. For the case of Norwegian, a url using "no" as source or target parameter will be converted into using the "nb" one. In this way, external and internal incosistencies would be corrected at the time of processing the url.
Additional considerations:
- We want to make sure the solution works for Content Translation on desktop as well as Section Translation on mobile.
- Additional efforts to avoid inconsistencies where they are originated are also welcome, but the focus of the present ticket is to make sure that in the event of alternative codes being used, those are normalized to the expected ones.
Only Yandex shown when starting a translation by searching for a new article which uses 'nb' code in the url (example) | Google and MinT shown when starting a translation from suggestions which uses 'no' in the url (example) |
---|---|
We are normalizing codes to "nb" as per T339091#8980233 (originally it was proposed the other direction which may be problematic in the long term).