Skip to content

Use full locale as key instead 2-digit country codes #158

@gitRigge

Description

@gitRigge

Hi Stefano, this is not really an issue but more a question:

One of your examples is:

let strings = new LocalizedStrings({ en: { how: "How do you want your egg today?", boiledEgg: "Boiled egg", softBoiledEgg: "Soft-boiled egg", choice: "How to choose the egg", }, it: { how: "Come vuoi il tuo uovo oggi?", boiledEgg: "Uovo sodo", softBoiledEgg: "Uovo alla coque", choice: "Come scegliere l'uovo", }, });

These are the localizations for English and Italian.
I'm not sure for Italian but I know, there are many different English language flavors. Let's say, people in India would call say "cooked" egg instead of "boilded" (that's not true but only an assumpation). How would your example look like in this case? It would not be that easy because you are only using 2-digits country codes. The country code "in" might be occupied by Indonesia.

I am using the full locale (not sure if the term is correct). In my case, the example would be:

let strings = new LocalizedStrings({ 'en-US': { how: "How do you want your egg today?", boiledEgg: "Boiled egg", softBoiledEgg: "Soft-boiled egg", choice: "How to choose the egg", }, 'en-IN': { how: "How do you want your egg today?", boiledEgg: "Cooked egg", // This is just an assumption and probably not true! softBoiledEgg: "Soft-boiled egg", choice: "How to choose the egg", }, 'it-IT': { how: "Come vuoi il tuo uovo oggi?", boiledEgg: "Uovo sodo", softBoiledEgg: "Uovo alla coque", choice: "Come scegliere l'uovo", }, });

What do you think about this approach?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions