Skip to content

Commit 94268a4

Browse files
authored
CLDR-18866 v48 BRS: plurals (#4930)
1 parent d903ae5 commit 94268a4

File tree

4 files changed

+20
-26
lines changed

4 files changed

+20
-26
lines changed

common/supplemental/ordinals.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<!DOCTYPE supplementalData SYSTEM "../../common/dtd/ldmlSupplemental.dtd">
33
<!--
4-
Copyright © 1991-2024 Unicode, Inc.
4+
Copyright © 1991-2025 Unicode, Inc.
55
For terms of use, see http://www.unicode.org/copyright.html
66
SPDX-License-Identifier: Unicode-3.0
77
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
@@ -101,7 +101,7 @@ CLDR data files are interpreted according to the LDML specification (http://unic
101101
<pluralRule count="few">n % 10 = 3 and n % 100 != 13 @integer 3, 23, 33, 43, 53, 63, 73, 83, 103, 1003, …</pluralRule>
102102
<pluralRule count="other"> @integer 0, 4~18, 100, 1000, 10000, 100000, 1000000, …</pluralRule>
103103
</pluralRules>
104-
<pluralRules locales="mr kok kok_Latn">
104+
<pluralRules locales="kok kok_Latn mr">
105105
<pluralRule count="one">n = 1 @integer 1</pluralRule>
106106
<pluralRule count="two">n = 2,3 @integer 2, 3</pluralRule>
107107
<pluralRule count="few">n = 4 @integer 4</pluralRule>

common/supplemental/plurals.xml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<!DOCTYPE supplementalData SYSTEM "../../common/dtd/ldmlSupplemental.dtd">
33
<!--
4-
Copyright © 1991-2024 Unicode, Inc.
4+
Copyright © 1991-2025 Unicode, Inc.
55
For terms of use, see http://www.unicode.org/copyright.html
66
SPDX-License-Identifier: Unicode-3.0
77
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
@@ -76,17 +76,7 @@ CLDR data files are interpreted according to the LDML specification (http://unic
7676
<pluralRule count="one">i = 0,1 and n != 0 @integer 1 @decimal 0.1~1.6</pluralRule>
7777
<pluralRule count="other"> @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …</pluralRule>
7878
</pluralRules>
79-
<pluralRules locales="blo">
80-
<pluralRule count="zero">n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000</pluralRule>
81-
<pluralRule count="one">n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000</pluralRule>
82-
<pluralRule count="other"> @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …</pluralRule>
83-
</pluralRules>
84-
<pluralRules locales="cv">
85-
<pluralRule count="zero">n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000</pluralRule>
86-
<pluralRule count="one">n = 1 @integer 1 @decimal 0.1~1.0, 1.00, 1.000, 1.0000</pluralRule>
87-
<pluralRule count="other"> @integer 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …</pluralRule>
88-
</pluralRules>
89-
<pluralRules locales="ksh">
79+
<pluralRules locales="blo cv ksh">
9080
<pluralRule count="zero">n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000</pluralRule>
9181
<pluralRule count="one">n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000</pluralRule>
9282
<pluralRule count="other"> @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …</pluralRule>
@@ -202,6 +192,13 @@ CLDR data files are interpreted according to the LDML specification (http://unic
202192

203193
<!-- 5: one,two,few,many,other -->
204194

195+
<pluralRules locales="sgs">
196+
<pluralRule count="one">n % 10 = 1 and n % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 1.0, 21.0, 31.0, 41.0, 51.0, 61.0, 71.0, 81.0, 101.0, 1001.0, …</pluralRule>
197+
<pluralRule count="two">n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000</pluralRule>
198+
<pluralRule count="few">n != 2 and n % 10 = 2..9 and n % 100 != 11..19 @integer 3~9, 22~29, 32, 102, 1002, … @decimal 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 22.0, 102.0, 1002.0, …</pluralRule>
199+
<pluralRule count="many">f != 0 @decimal 0.1~0.9, 1.1~1.7, 10.1, 100.1, 1000.1, …</pluralRule>
200+
<pluralRule count="other"> @integer 0, 10~20, 30, 40, 50, 60, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …</pluralRule>
201+
</pluralRules>
205202
<pluralRules locales="br">
206203
<pluralRule count="one">n % 10 = 1 and n % 100 != 11,71,91 @integer 1, 21, 31, 41, 51, 61, 81, 101, 1001, … @decimal 1.0, 21.0, 31.0, 41.0, 51.0, 61.0, 81.0, 101.0, 1001.0, …</pluralRule>
207204
<pluralRule count="two">n % 10 = 2 and n % 100 != 12,72,92 @integer 2, 22, 32, 42, 52, 62, 82, 102, 1002, … @decimal 2.0, 22.0, 32.0, 42.0, 52.0, 62.0, 82.0, 102.0, 1002.0, …</pluralRule>
@@ -230,13 +227,6 @@ CLDR data files are interpreted according to the LDML specification (http://unic
230227
<pluralRule count="many">v != 0 @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …</pluralRule>
231228
<pluralRule count="other"> @integer 3~10, 13~19, 23, 103, 1003, …</pluralRule>
232229
</pluralRules>
233-
<pluralRules locales="sgs">
234-
<pluralRule count="one">n % 10 = 1 and n % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 1.0, 21.0, 31.0, 41.0, 51.0, 61.0, 71.0, 81.0, 101.0, 1001.0, …</pluralRule>
235-
<pluralRule count="two">n = 2 @integer 2 @decimal 2.0 </pluralRule>
236-
<pluralRule count="few">n != 2 and n % 10 = 2..9 and n % 100 != 11..19 @integer 3~9, 22~29, 102, 1002, … @decimal 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 22.0, 102.0, 1002.0, …</pluralRule>
237-
<pluralRule count="many">f != 0 @decimal 0.1~0.9, 1.1~1.7, 10.1, 100.1, 1000.1, …</pluralRule>
238-
<pluralRule count="other"> @integer 0, 10~20, 30, 40, 50, 60, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …</pluralRule>
239-
</pluralRules>
240230

241231
<!-- 6: zero,one,two,few,many,other -->
242232

tools/cldr-code/src/main/java/org/unicode/cldr/tool/GeneratePluralRanges.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
import org.unicode.cldr.util.TempPrintWriter;
4040

4141
public class GeneratePluralRanges {
42+
private static final String PLURAL_RANGES_XML = "pluralRanges.xml";
43+
4244
public GeneratePluralRanges(SupplementalDataInfo supplementalDataInfo) {
4345
SUPPLEMENTAL = supplementalDataInfo;
4446
prf = PluralRulesFactory.getInstance(SUPPLEMENTAL);
@@ -267,8 +269,8 @@ public static String getExample(
267269
public void reformatPluralRanges() {
268270
Map<Set<Count>, Relation<Set<String>, String>> seen = new TreeMap<>(COUNT_SET_COMPARATOR);
269271
try (TempPrintWriter out =
270-
TempPrintWriter.openUTF8Writer(
271-
CLDRPaths.SUPPLEMENTAL_DIRECTORY, "pluralRanges.xml")) {
272+
TempPrintWriter.openUTF8Writer(CLDRPaths.SUPPLEMENTAL_DIRECTORY, PLURAL_RANGES_XML)
273+
.skipCopyright(true)) {
272274
out.println(
273275
DtdType.supplementalData.header(MethodHandles.lookup().lookupClass())
274276
+ "\t<version number=\"$Revision$\" />\n"
@@ -313,6 +315,7 @@ public void reformatPluralRanges() {
313315
}
314316
out.println("\t</plurals>\n" + "</supplementalData>");
315317
}
318+
System.out.println("Done writing " + PLURAL_RANGES_XML + " or no change");
316319
}
317320

318321
enum RangeStrategy {

tools/cldr-code/src/main/java/org/unicode/cldr/tool/GeneratedPluralSamples.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,10 +676,10 @@ public static void main(String[] args) {
676676
System.out.println("Check: " + checkForDuplicates(pluralRules2, new FixedDecimal("8e1")));
677677

678678
for (PluralType type : PluralType.values()) {
679+
final String filename = type == PluralType.cardinal ? "plurals.xml" : "ordinals.xml";
679680
try (TempPrintWriter out =
680-
TempPrintWriter.openUTF8Writer(
681-
MyOptions.output.option.getValue(),
682-
type == PluralType.cardinal ? "plurals.xml" : "ordinals.xml")) {
681+
TempPrintWriter.openUTF8Writer(MyOptions.output.option.getValue(), filename)
682+
.skipCopyright(true)) {
683683
out.print(WritePluralRules.formatPluralHeader(type, "GeneratedPluralSamples"));
684684
System.out.println("\n");
685685
Set<String> locales = testInfo.getSupplementalDataInfo().getPluralLocales(type);
@@ -820,6 +820,7 @@ public static void main(String[] args) {
820820
}
821821
}
822822
System.out.println("\n");
823+
System.out.println("Wrote (or no change): " + filename);
823824
}
824825
}
825826
if (failureCount > 0) {

0 commit comments

Comments
 (0)