Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong language code for Serbian language #3899

Closed
vlada-j opened this issue Apr 7, 2017 · 3 comments
Closed

Wrong language code for Serbian language #3899

vlada-j opened this issue Apr 7, 2017 · 3 comments

Comments

@vlada-j
Copy link

vlada-j commented Apr 7, 2017

We use wrong language code for Serbian cyrillic and Serbian latin. SR is by default cyrillic, not latin
Currently:
sr-cyrl -> Serbian cyrillic
sr -> Serbian latin

Correct codes:
sr -> Serbian (cyrillic)
sh -> Serbo-Croatian (latin)

Source: w3schools

Please can someone confirm or correct.
Thanks

@darkgnostic
Copy link

There is no such a code as sh. Serbo-Croatian language doesn't exist. However, default Serbian code is Cyrillic.

@mattjohnsonpint
Copy link
Contributor

Like most other languages and platforms, we have adopted IETF Language Tags, as defined by bcp47.

Language tags can be made up of several parts, each covered by their own standard.

sr is the correct language code, defined by ISO639. We prefer two-letter 639-1 codes, but will use three-letter codes from 639-2 when there isn't an appropriate two-letter code.

sh used to reference "Serbo-Croatian", but it was deprecated in year 2000. Refer to the comments in the changes list here.

cyrl is the correct script tag for Cyrillic. Script tags are defined by ISO15924. Unicode has a good list of them here.

latn would be the script tag for Latin script, making sr-latn and sr-cyrl the two variants of Serbian. However, the use of script tags is entirely optional in bcp47, and Moment requires we choose some default to use when we only have the language. The developer who implemented these in Moment chose the Latin script as the default, so that's what we have.

This article is pretty interesting on this subject. Section 5 covers the variants in the language tags.

@mattjohnsonpint
Copy link
Contributor

Also - W3Schools is not the best reference, IMHO. Always seek out something more authoritative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants