Skip to content

Commit

Permalink
CLDR-17447 Fix parentLocales documentation (#3592)
Browse files Browse the repository at this point in the history
Co-authored-by: Steven R. Loomis <[email protected]>
  • Loading branch information
macchiati and srl295 authored Apr 2, 2024
1 parent 7bf1318 commit 78548a7
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions docs/ldml/tr35.md
Original file line number Diff line number Diff line change
Expand Up @@ -1763,16 +1763,20 @@ _Examples:_

```xml
<!ELEMENT parentLocales ( parentLocale* ) >
<!ATTLIST parentLocales component NMTOKEN #IMPLIED >
<!ATTLIST parentLocales component NMTOKENS #IMPLIED >
<!ELEMENT parentLocale EMPTY >
<!ATTLIST parentLocale parent NMTOKEN #REQUIRED >
<!ATTLIST parentLocale localeRules NMTOKENS #IMPLIED >
<!ATTLIST parentLocale locales NMTOKENS #REQUIRED >
```

When the component does not occur, that is referred to as the ‘main’ component.
Otherwise the component value typically corresponds to an element and its children, such as ‘collations’ or ‘plurals’.
Otherwise the component value typically corresponds to elements and their children, such as ‘collations’ or ‘plurals’.
There may be more than one component value (space separated):
in that case the information applies to all the components listed.

The basic inheritance model for locales of the form `lang_script_region_variant1_…variantN` is to truncate from the end. That is,
The basic inheritance model for locales of the form `lang_script_region_variant1_…variantN` is to truncate from the end.
That is,
remove the _u and _t extensions, then remove the last _ and following tag, then restore the extensions.

For example
Expand All @@ -1796,7 +1800,8 @@ Thus there are two cases where the truncation inheritance needs to be overridden
The `parentLocale` element is used to override the normal inheritance when accessing CLDR data.

For case 1, there is a special attribute and value, `localeRules="nonlikelyScript"`,
which specifies **all locales** of the form `lang_script`, wherever the `script` is **not** the likely script for `lang`.
which specifies **all locales** of the form `lang_script`,
wherever the `script` is **not** the likely script for `lang`.
For migration, the previous short list of locales (a subset of the nonlikelyScript locales) is retained,
but those locales are slated for removal in the future.
For example, `ru_Latn` is not included in the short list but is included (programmatically) in the rule.
Expand All @@ -1809,17 +1814,20 @@ The `localeRules` is used for the main component, for example.
It is not used to components where text is not mixed,
such as the collations component or the plurals component.

For case 2, the children and parent share the same primary language, but the region is changed. For example:
For case 2, the children and parent share the same primary language, but the region is changed.
For example:

```xml
<parentLocale parent="es_419" locales="es_AR es_BO … es_UY es_VE"/>
```

There are certain components that require addenda to the common parent fallback rules.
For a locale like `zh_Hant` in the example above, the `parentLocale` element would dictate the parent as `root` when referring to main locale data,
For a locale like `zh_Hant` in the example above,
the `parentLocale` element would dictate the parent as `root` when referring to main locale data,
but for collation data, the parent locale should still be `zh`,
even though the `parentLocale` element is present for that locale.
To address this, components can have their own fallback rules that inherit from the common rules and add additional parents that supplement or override the common rules:
To address this, components can have their own fallback rules that inherit from the common rules
and add additional parents that supplement or override the common rules:

```xml
<parentLocales component="segmentations">
Expand All @@ -1828,7 +1836,8 @@ To address this, components can have their own fallback rules that inherit from
```

Note: When components were first introduced, the component-specific parent locales were be merged with the main parent locales.
This was determined to be an error, and the component-specific parent locales are now not merged, but are treated as stand-alone.
This was determined to be an error, and the component-specific parent locales are now not merged,
but instead are treated as stand-alone.

Since parentLocale information is not localizable on a per locale basis,
the parentLocale information is contained in CLDR’s [supplemental data.](tr35-info.md)
Expand Down

0 comments on commit 78548a7

Please sign in to comment.