Giter Club home page Giter Club logo

Comments (7)

johnnyshields avatar johnnyshields commented on August 27, 2024 2

en-redross is not an ISO 639 / IANA standard. zh-Hant and zh-Hans are.

It is a best practice to use zh-Hant and zh-Hans to avoid ambiguity and political debates. Adding zh increases ambiguity.

from rails-i18n.

redross avatar redross commented on August 27, 2024 1

Yes, thank you - that was my initial plan. But then I stumbled upon "By default all country variants (en-US) will fallback to languages first (e.g en)" (not sure if it was part of documentation or just some post) and it felt like "wait a minute is this not working or am I doing something wrong". I guess the omission of base language is not accidental - so I'm closing this issue for now. If I'll notice the same sentence in rails guides or documentation, I'll try suggesting an edit warning that there are possible edge cases where the default fallback doesn't happen.

from rails-i18n.

johnnyshields avatar johnnyshields commented on August 27, 2024

I don't think it makes sense to this. zh-CN and zh-TW are two fundamentally different scripts, unlike es-ES/es-MX or pt-PT/pt-BR. What we should consider doing instead is switch to the zh-Hans / zh-Hant script convention, rather than using country codes to indicate scripts.

from rails-i18n.

redross avatar redross commented on August 27, 2024

Even if the scripts are different, shouldn't there be some default zh.yml variant that is the most common/expected version? Are you saying there is no "zh"/"Chinese" language? Is this some kind of weird oriental thing? My logic being:

  1. There is some language (e.g. English/Spanish/Esperanto/Latin)
  2. There is a locale file for it
  3. In case of multiple countries/cultures using the "same language" - there are "country-specific" locale files (from my POV they can be even super crazy/far-from-original variations - doesn't break the logic here)

So if zh-TW is a fundamentally different language than zh-CN, then why are they used as if they are just country specific variations of a language (that apparently doesn't exist) :(

I'm most likely being ignorant/dumb here, so don't take this too seriously 😄

from rails-i18n.

redross avatar redross commented on August 27, 2024

Basically if I invent "en-redross" english variation, that is nothing like english. Does that mean everybody should drop en.yml locale since not all variations are actually english?

from rails-i18n.

redross avatar redross commented on August 27, 2024

Just to double check: am I looking at the wrong place (https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry):

Type: language
Subtag: zh
Description: Chinese
Added: 2005-10-16
Scope: macrolanguage

zh subtag is mentioned as a language 🤔

Either way, thank you for your responses. I doubt we'll want to change urls on the site from /zh/smth, to /zh-hant/smth, so most likely I'll need to do some trickery.

from rails-i18n.

sunny avatar sunny commented on August 27, 2024

Perhaps you can try using fallbacks? E.g. I18n.fallbacks[:zh] = [:"zh-hant"]

from rails-i18n.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.