question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expanded language support for regional variations

See original GitHub issue

A recent pull request #354 adds support for Traditional Chinese (as spoken in HK and Taiwan). We already have Simplified Chinese translations. This exposes a shortcoming in our language handling: we currently only list the ISO 639-1 codes for languages, without distinguishing between regional variations.

So, e.g. we have the LanguageCode enum which is widely used throughout the core, which only has “zh” for all variations of Chinese.

We could add support for common IETF language tags (which is have used in this PR), which would then allow us to support the zh-CN and zh-TW UI translations, as well as in places such as product translations etc.

The question then is “which full IETF tags to support?”

Add all possible IETF tags

Cases like Chinese are interesting because the actual writing system is distinct between Simplified and Traditional. Whereas an American can totally understand anything written in British English and vice-versa, does the same apply to Chinese speakers in Beijing and Taipei?

How about Madrid (es-ES) and Mexico City (es-MX)? I personally cannot answer these questions, since I am only very familiar with English (and to a lesser extent German).

Adding all variations seems like a bad idea, e.g. according to https://datahub.io/core/language-codes#resource-ietf-language-tags there are over 100 variations of English and over 40 variations of French. In practice, a single “English” version of anything would probably suffice (although I say this as an English speaker from England, so perhaps my perspective is too narrow). In any case, I’m pretty sure that listing 100 variations of English in UI menus is not a desirable solution.

Add tags on an ad-hoc basis

Another approach would be to default to the ISO 639-1 codes as we currently have, and only add regional variations as-and-when the need arises (e.g. a pull request like the one that triggered this issue comes in).

In this case, we’d then need to update the LanguageCode enum as well as the language-translation-strings.ts file to allow localization of these new variants.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
nbezalwarcommented, Jun 1, 2020

IMO you should change the enum from LanguageCode to LocaleCode . A locale is a combination of language + country and is usually of the xx-XX format. eg. en-US or en-GB.

This also serves as a mechanism to showcase different products in your store based on country. Happy to discuss more details on slack.

1reaction
nbezalwarcommented, Jun 2, 2020

IMO, this is a good list of 125 languages to support. https://www.andiamo.co.uk/resources/iso-language-codes/

For Chinese, zh-CN and zh-TW are the 2 variants for simplified and traditional chinese.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Localized Versions of your Pages | Google Search Central
If you have multiple versions of a page for different languages or regions, tell Google about these different variations.
Read more >
Supported languages and countries/regions for Power BI
This article covers supported languages and countries/regions for the Power BI service, Power BI Desktop, and Power BI documentation.
Read more >
In Platform Language Support Guide - ServiceNow
In-Platform Language Support Guide ... We'll go into more detail about regional variations related to this further down in this post.
Read more >
Adapting Alexa to regional language variations
As Alexa expands into new countries, she usually has to be trained on new languages. But sometimes, she has to be re-trained on...
Read more >
Language Status | Ethnologue
Expanded Graded Intergenerational Disruption Scale ... in work and mass media without official status to transcend language differences across a region.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found