Skip to content

Add LanguageInfo component#371

Merged
movermeyer merged 1 commit into
ruby-i18n:mainfrom
movermeyer-stripe:movermeyer/language_info_component
May 28, 2026
Merged

Add LanguageInfo component#371
movermeyer merged 1 commit into
ruby-i18n:mainfrom
movermeyer-stripe:movermeyer/language_info_component

Conversation

@movermeyer-stripe
Copy link
Copy Markdown
Contributor

What are you trying to accomplish?

Adding a new component for exporting the info from https://github.com/unicode-org/cldr/blob/main/common/supplemental/languageInfo.xml

Docs: https://www.unicode.org/reports/tr35/tr35-78/tr35.html#LanguageMatching

What approach did you choose and why?

Basic copy-paste of the other shared components.

What should reviewers focus on?

🤷

The data shape matches closely the upstream.

The locales are all exported in the hyphenated Ruby i18n way as Strings (matching ParentLocales).

Sample:

---
language_matching:
  written_new:
    language_matches:
    - :desired: nb
      :supported: 'no'
      :distance: 1
...
    - :desired: zh-Hant-*
      :supported: zh-Hant-*
      :distance: 5
    - :desired: "*-*-*"
      :supported: "*-*-*"
      :distance: 4
    match_variables:
      "$americas": '019'
      "$cnsar": HK+MO
      "$enUS": AS+CA+GU+MH+MP+PH+PR+UM+US+VI
      "$maghreb": MA+DZ+TN+LY+MR+EH
    paradigm_locales:
    - en
    - en-GB
    - es
    - es-419
    - pt-BR
    - pt-PT

Notably, I didn't try to convert match_variables into something easier for the consumer to use: they will have to understand how to parse this data still.

The impact of these changes

Users will be able to get access to these data.

Testing

bundle exec thor cldr:export --components LanguageInfo

Checklist

  • I have added a CHANGELOG entry for this change (or determined that it isn't needed)

@movermeyer movermeyer merged commit 767528e into ruby-i18n:main May 28, 2026
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants