Skip to content

Commit

Permalink
CLDR-16122 v43 spec: fix-tocs to fix bad links
Browse files Browse the repository at this point in the history
- catch some additional link problems
  • Loading branch information
srl295 committed Mar 24, 2023
1 parent b46f1a2 commit ead8f02
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/ldml/tr35-keyboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ This element must have the `transforms` element as its parent. This element repr
_Attribute:_ `from` (required)

> The `from` attribute consists of a sequence of elements. Each element matches one character and may consist of a codepoint or a UnicodeSet (both as defined in [UTS#35 section 5.3.3](https://www.unicode.org/reports/tr35/#Unicode_Sets)).
> The `from` attribute consists of a sequence of elements. Each element matches one character and may consist of a codepoint or a UnicodeSet (both as defined in [UTS#35](tr35.md#Unicode_Sets)).
For example, suppose there are the following transforms:

Expand Down
4 changes: 2 additions & 2 deletions docs/ldml/tr35-personNames.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ The `<nameOrderLocales>` element is optional, and contains information about sel
<!ATTLIST nameOrderLocales order ( givenFirst | surnameFirst ) #REQUIRED >
```

* `#PCDATA `is a space delimited list of one or more [unicode_locale_id](https://unicode.org/reports/tr35/#unicode_locale_id)s. Normally each locale is limited to language, script, and region. The _und_ locale ID may only occur once, either in _surnameFirst_ or _givenFirst_, but not both, and matches all base locales not explicitly listed.
* `#PCDATA `is a space delimited list of one or more [unicode_locale_id](tr35.md#unicode_locale_id)s. Normally each locale is limited to language, script, and region. The _und_ locale ID may only occur once, either in _surnameFirst_ or _givenFirst_, but not both, and matches all base locales not explicitly listed.

An example from English may look like the following

Expand Down Expand Up @@ -542,7 +542,7 @@ For example, the data for a particular locale might look like the following:
```xml
<nameOrderLocales order="surnameFirst">zh ja und-CN und-TW und-SG und-HK und-MO und-HU und-JP</nameOrderLocales>
```
These nameOrderLocales will match any locale with a zh or ja [unicode_language_subtag](https://unicode.org/reports/tr35/#unicode_language_subtag) and any locale with a CN, TW, SG, HK MO, HU, or JP [unicode_region_subtag](https://unicode.org/reports/tr35/#unicode_region_subtag).
These nameOrderLocales will match any locale with a zh or ja [unicode_language_subtag](tr35.md#unicode_language_subtag) and any locale with a CN, TW, SG, HK MO, HU, or JP [unicode_region_subtag](https://unicode.org/reports/tr35/#unicode_region_subtag).

Here are some more examples. Note that if there is no order field or locale field in the PersonName object to be formatted, and the script of the PersonName data is different from that of the formatting locale, then the default result is givenFirst.

Expand Down
3 changes: 2 additions & 1 deletion docs/ldml/tr35.md
Original file line number Diff line number Diff line change
Expand Up @@ -3189,7 +3189,8 @@ Of course, both of these techniques can be applied.
### <a name="Vertical_Slicing" href="#Vertical_Slicing">Vertical Slicing</a>

The choice of locales to include depends very much upon particular implementations.
Some information which might be useful for determining that that is the [Supplemental Territory Information](tr35-info.md#Supplemental_Territory_Information),
Some information that might be useful for determining the choice is found in the
[Supplemental Territory Information](tr35-info.md#Supplemental_Territory_Information),
which provides information on the use of languages in different countries/regions.
(For a human-readable chart, see [Territory-Language Information](https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/territory_language_information.html).)

Expand Down
5 changes: 4 additions & 1 deletion tools/scripts/tr-archive/fix-tocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,14 @@ async function processFile(f) {
const oldcopyright = /(Copyright\s*[©]?)\s*([0-9]{4,4})[–-—](?:[0-9]{4,4})\s*Unicode/;
const newyear = new Date().getFullYear(); // 2023, etc
const badlink = /([\(])(http[s]?:\/\/[w\.]*unicode.org\/reports\/tr35\/)?tr35([^\./]*)\.html/;
const badlink2 = /([\(])(http[s]?:\/\/[w\.]*unicode.org\/reports\/tr35\/)#/;

// Write out all remaining lines in the file.
for (; i < lines.length; i++) {
out.push(lines[i]
.replace(oldcopyright, `$1 $2–${newyear} Unicode`)
.replace(badlink, '$1tr35$3.md'));
.replace(badlink, '$1tr35$3.md')
.replace(badlink2, '$1tr35.md#'));
}

// Write the whole file to disk.
Expand Down

0 comments on commit ead8f02

Please sign in to comment.