ruby-i18n / ruby-i18n/ruby-cldr

`Plurals` doesn't work for some locales

Open
#157 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
78
Forks
18
Avg merge
9d 8h
Merged PRs (30d)
3

Description

Problem

The Plurals component only outputs a plurals.rb file for a locale if the locale appears exactly in the supplemental/plurals.xml file.

For example, zh-Hant doesn't have a plurals.rb file, which means that it would fall back to its parent locale, root. root happens to have the same plural rules as zh-Hant (i.e., everything uses other) so it isn't an issue.

However, there are locales that fall back to root that don't share the same plural rules as root. For example, sd-Deva falls back to root, but (as I understand it) sd-Deva uses both one and other. So if it were to use root's plurals.rb, it would be incorrect.

Potential Solution?

IDK yet.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Plurals component and tracing how it uses supplemental/plurals.xml to decide which locales receive a plurals.rb file. Compare the generated handling of zh-Hant and sd-Deva with their CLDR locale fallback rules. Done means locales falling back to root receive plural rules appropriate to the locale rather than blindly inheriting root's rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
internationalization, localization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.