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

iso639.json is too limited #100

Open
peaceful-james opened this issue Dec 19, 2024 · 2 comments
Open

iso639.json is too limited #100

peaceful-james opened this issue Dec 19, 2024 · 2 comments

Comments

@peaceful-james
Copy link

The ISO649 language codes do not account for region variants.

For example, "pt-BR" and "pt-PT" (Portuguese in Brazil and Portugal) and both valid locales.

Both are even recognized by the DeepL API (https://developers.deepl.com/docs/resources/supported-languages) (as PT-BR and PT-PT).

Moreover, I believe many of the hardcoded strings in priv/iso639.json could be calculated using functions from different ex_cldr libraries. I am not 100% certain of this but I do know that with the current model where locales are reduced to ISO649 codes, I can not use Kanta to manage Brazil and Portugal variants of Portuguese.

I will branch off my existing PR to hack on this for a while.

@peaceful-james
Copy link
Author

Using Cldr, we can get the territory name and the territory "local name". We can also get the unicode flag.

I think it is worth sacrificing these fields from locale to be to correctly support, e.g. pt_BR:

    field :iso639_code, :string
    field :family, :string
    field :wiki_url, :string
    field :colors, {:array, :string}

and introducing these fields:

   field :locale_code, :string
   field :unicode_flag, :string

I can try to work on this but I am concerned about the gettext fork being cancelled. Are there plans to deal with that?

@peaceful-james
Copy link
Author

You can assign me to this issue if you want. I might have time over Christmas to give it a go.

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

1 participant