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

CLDR-17893 Clarify rg validation for unit preferences #4049

Merged
merged 5 commits into from
Sep 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions docs/ldml/tr35-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -1235,10 +1235,20 @@ If any key-values are invalid, then they are ignored. Thus the following constru
| --- | --- |
| -mu-smoot | invalid unit |
| -ms-stanford | invalid unit system |
| -rg-aazzzz | invalid region 'AA' ‡|
| -AA | invalid region 'AA'|
| -rg-abzzzz | invalid region 'AB' ‡|
| -AB | invalid region 'AB'|

‡ Only the region portion is currently used, so in -rg-usabcdef the "abcdef" is ignored, whether or not it is valid.
‡ Only the region portion is currently used.
The -rg-abzzzz is ignored because AB is invalid;
if it were -rg-ustuvxy, it would not be ignored because US is valid.
The table below shows when the region portion is valid or not.

| Key-value | Region | Valid? | Comment |
| --- | --- | --- | --- |
| -rg-usut | US | Yes | Both the region portion (US) and the subdivision portion (ut = Utah) are valid. |
| -rg-uszzzz | US | Yes | Both the region portion (US) and the subdivision portion (zzzz = all) are valid. |
| -rg-usabc | US | Yes | The region portion (US) is valid, but the subdivision portion (abc) is not. |
| -rg-abzzzz | AB | No, ignored | The region portion (AB) is invalid, and thus the -rg is ignored, not matter that the subdivision portion (zzzz) is. |

The following algorithm is used to compute the override units, regions, and category.
The latter two items are used in the [Unit Preferences Data](#Unit_Preferences_Data).
Expand All @@ -1253,9 +1263,10 @@ If there is no valid -mu value, the following steps are used to determine a regi

1. If there is a valid -ms value then let USM be the corresponding value in column 2 of the table below.
Otherwise FR is not used. In either case continue with step 2.
2. If there is a valid -rg region, let R be that region, and go to Compute the category.
3. If there is a valid region in the locale, let R be that region, and go to Compute the category.
4. Otherwise, compute the likely subtags for the locale.
2. If there is a valid -rg region portion of the rg value, let R be that region, and go to Compute the category.
* See the table above for the examples `usut`, `usabc`, and `abcdef`
4. If there is a valid region in the locale, let R be that region, and go to Compute the category.
5. Otherwise, compute the likely subtags for the locale.
1. If there is a likely region, then let R be that region, and go to Compute the category.
2. Otherwise, let R be 001, and go to Compute the category

Expand Down
Loading