Skip to content
New issue

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

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

Already on GitHub? # to your account

Sensitiveness #206

Open
frankapimenta opened this issue Jun 29, 2022 · 1 comment
Open

Sensitiveness #206

frankapimenta opened this issue Jun 29, 2022 · 1 comment

Comments

@frankapimenta
Copy link

Some countries have different cultural regions (Spain (Basc country, Catalonia), Belgium (fr, nl), Switzerland (it, fr, de as example).
Is there a way to add this specification to the gem?

I see that for Switzerland

@country_data_or_code[:translations]

has

{ "ch-fr"=>nil, "ch-de"=>nil", "ch-it"=>nil }

Would be nice to have this as culture specification of the country.
For example:

@country_data_or_code[:locales] => { "ch-fr" => 🇨🇭🇫🇷, "ch-de" => 🇨🇭🇩🇪, "ch-it" => 🇨🇭🇮🇹 }

and have locales as a options of the values of the select options (dropdownlist).

@pmor
Copy link
Member

pmor commented Apr 30, 2023

All the data comes from the countries gem, and that gem does have a lot of translations, but it doesn't specifically deal with regional locales.

The base country data for Switzerland is https://github.com/countries/countries/blob/832ac5afd68ff467758f722fc6f330a8831b75ee/lib/countries/data/countries/CH.yaml and it includes the list of languages, but not the actual locale identifiers.

I'll add a ticket to countries to add the locales, it makes sense to have this data.

I don't know where those locales you mention are coming from, because the proper identifiers should be fr-CH, de-CH and it-CH. The format is <language>-<countryCode>.

If you configure I18n.available_locales or directly for the countries gem (see here) and add :fr, :de, :it then the translation data for these languages will be loaded.

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

No branches or pull requests

2 participants