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-17948 kbd: bump version to v46 #4053

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/keyboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
${{ runner.os }}-nodekbd-
nodekbd-
- name: Install kmc
run: npm install -g @keymanapp/kmc@alpha
run: npm install -g @keymanapp/kmc@beta
- name: Compile Keyboards
run: kmc --error-reporting build keyboards/3.0/*.xml
- name: Run Kbd Charts
Expand Down
6 changes: 3 additions & 3 deletions keyboards/3.0/bn.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="bn" conformsTo="45">
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="bn" conformsTo="46">
<!--
History:
Based on
Expand All @@ -19,8 +19,8 @@
</displays>

<keys>
<import base="cldr" path="45/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="45/keys-Zyyy-currency.xml" />
<import base="cldr" path="46/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="46/keys-Zyyy-currency.xml" />

<key id="1" output="১" />
<key id="2" output="২" />
Expand Down
6 changes: 3 additions & 3 deletions keyboards/3.0/fr-t-k0-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--
See CLDR-12026 for the real new azerty keyboard
-->
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="fr-t-k0-test" conformsTo="45">
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="fr-t-k0-test" conformsTo="46">
<locales>
<locale id="br" /> <!-- example of including Breton -->
</locales>
Expand Down Expand Up @@ -31,8 +31,8 @@
</displays>

<keys>
<import base="cldr" path="45/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="45/keys-Zyyy-currency.xml" />
<import base="cldr" path="46/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="46/keys-Zyyy-currency.xml" />

<!-- switch keys -->
<key id="shift" layerId="shift" />
Expand Down
6 changes: 3 additions & 3 deletions keyboards/3.0/fr.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" conformsTo="45"
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" conformsTo="46"
locale="fr">
<version number="1.0.0" />

Expand All @@ -22,8 +22,8 @@
</displays>

<keys>
<import base="cldr" path="45/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="45/keys-Zyyy-currency.xml" />
<import base="cldr" path="46/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="46/keys-Zyyy-currency.xml" />

<!-- deadkeys -->
<key id="mark-acute" output="\m{acute}" />
Expand Down
8 changes: 4 additions & 4 deletions keyboards/3.0/ja-Hira-t-k0-flicks.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="ja-Hira-t-k0-flicks"
conformsTo="45">
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="ja-Hira-t-k0-flicks"
conformsTo="46">
<version number="1.0.0" />
<info author="Team Keyboard" name="Japanese Hiragana" />

<keys>
<import base="cldr" path="45/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="45/keys-Zyyy-currency.xml" />
<import base="cldr" path="46/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="46/keys-Zyyy-currency.xml" />

<key id="h-a" output="あ" flickId="h-a"/>
<key id="h-i" output="い" />
Expand Down
6 changes: 3 additions & 3 deletions keyboards/3.0/ja-Latn.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="ja-Latn" conformsTo="45">
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="ja-Latn" conformsTo="46">
<locales>
<locale id="en" />
</locales>
<version number="0.0.0" />
<info name="Romaji (JIS)" />

<keys>
<import base="cldr" path="45/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="45/keys-Zyyy-currency.xml" />
<import base="cldr" path="46/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="46/keys-Zyyy-currency.xml" />
</keys>

<layers formId="jis">
Expand Down
6 changes: 3 additions & 3 deletions keyboards/3.0/mt-t-k0-47key.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="mt-t-k0-47key" conformsTo="45">
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="mt-t-k0-47key" conformsTo="46">
<locales>
<!-- English is also an official language in Malta.-->
<locale id="en" />
Expand All @@ -9,8 +9,8 @@

<keys>
<!-- imports -->
<import base="cldr" path="45/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="45/keys-Zyyy-currency.xml" />
<import base="cldr" path="46/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="46/keys-Zyyy-currency.xml" />

<!-- accent grave -->
<key id="a-grave" output="à" />
Expand Down
6 changes: 3 additions & 3 deletions keyboards/3.0/mt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright © 1991-2024 Unicode, Inc.
SPDX-License-Identifier: Unicode-3.0
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
-->
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="mt" conformsTo="45">
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="mt" conformsTo="46">
<locales>
<!-- English is also an official language in Malta.-->
<locale id="en" />
Expand All @@ -14,8 +14,8 @@ CLDR data files are interpreted according to the LDML specification (http://unic

<keys>
<!-- imports -->
<import base="cldr" path="45/keys-Zyyy-punctuation.xml"/>
<import base="cldr" path="45/keys-Zyyy-currency.xml"/>
<import base="cldr" path="46/keys-Zyyy-punctuation.xml"/>
<import base="cldr" path="46/keys-Zyyy-currency.xml"/>

<!-- accent grave -->
<key id="a-grave" output="à" />
Expand Down
6 changes: 3 additions & 3 deletions keyboards/3.0/pcm.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="pcm" conformsTo="45">
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="pcm" conformsTo="46">
<version number="1.0.0" />
<info name="Naijíriá Píjin" />
<keys>
<import base="cldr" path="45/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="45/keys-Zyyy-currency.xml" />
<import base="cldr" path="46/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="46/keys-Zyyy-currency.xml" />
<key id="grave" output="\u{300}" />
<key id="backquote" output="`" />
<key id="acute" output="\u{301}" />
Expand Down
6 changes: 3 additions & 3 deletions keyboards/3.0/pt-t-k0-abnt2.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="pt-t-k0-abnt2" conformsTo="45">
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="pt-t-k0-abnt2" conformsTo="46">
<locales>
<locale id="pt" />
</locales>
Expand All @@ -14,8 +14,8 @@
</displays>

<keys>
<import base="cldr" path="45/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="45/keys-Zyyy-currency.xml" />
<import base="cldr" path="46/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="46/keys-Zyyy-currency.xml" />

<!-- TODO: using the proposed deadkey format -->
<key id="d-acute" output="\m{acute}"/>
Expand Down
2 changes: 1 addition & 1 deletion keyboards/dtd/ldmlKeyboard3.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CLDR data files are interpreted according to the LDML specification (http://unic
<!ELEMENT keyboard3 ( import*, locales?, version?, info, settings?, displays?, keys?, flicks?, forms?, layers*, variables?, transforms*, special* ) >
<!ATTLIST keyboard3 locale CDATA #REQUIRED >
<!--@MATCH:validity/bcp47-wellformed-->
<!ATTLIST keyboard3 conformsTo (45) #REQUIRED >
<!ATTLIST keyboard3 conformsTo (45 | 46) #REQUIRED >
<!--@MATCH:version-->
<!--@METADATA-->
<!ATTLIST keyboard3 xmlns CDATA #IMPLIED >
Expand Down
1 change: 1 addition & 0 deletions keyboards/dtd/ldmlKeyboard3.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="45"/>
<xs:enumeration value="46"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ public boolean isOlderThan(CldrVersion other) {
return compareTo(other) < 0;
}

public boolean isAsOldOrOlderThan(CldrVersion other) {
return compareTo(other) <= 0;
}

private CldrVersion() {
String oldName = name();
if (oldName.charAt(0) == 'v') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ private static void flattenImport(
final String path = getPath(item);
System.err.println("Import: " + base + ":" + path);
if (base.equals("cldr")) {
if (path.startsWith("45/")) {
final String subpath = path.replaceFirst("45/", "");
if (path.startsWith("46/")) {
final String subpath = path.replaceFirst("46/", "");
final File importDir =
new File(
CLDRConfig.getInstance().getCldrBaseDirectory(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ private static Map<DtdType, ElementAttributeInfo> makeElementAttributeInfoMap(
addElementAttributeInfo(
result,
DtdType.keyboard3,
canonicalCommonDirectory + "/../keyboards/3.0/fr-t-k0-test.xml");
canonicalCommonDirectory
+ "/../tools/cldr-code/src/main/resources/org/unicode/cldr/util/data/und-t-k0-none.xml");
addElementAttributeInfo(
result,
DtdType.keyboardTest3,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file is here to quell ElementAttributeInfo warnings. It is the only keyboard file which uses a .dtd, which is not recommended. -->
<!DOCTYPE keyboard3 SYSTEM '../../../../../../../../../../keyboards/dtd/ldmlKeyboard3.dtd'>
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="fr-t-k0-test" conformsTo="46">
<info name="Unused Keyboard, for DTD tests" />
<!-- not a real keyboard. -->
</keyboard3>
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,6 @@ private void checkDtds(
continue;
} else if (fileName.isDirectory()) {
checkDtds(fileName, level + 1, foundAttributes, data);
} else if (fileName.getPath().contains("/keyboards/3.0/")
&& logKnownIssue(
"CLDR-17574", "With v46, parsing issues for keyboard xml files")) {
; // do nothing, skip test
} else if (name.endsWith(".xml")) {
data.add(check(fileName));
if (deepCheck // takes too long to do all the time
Expand Down Expand Up @@ -1252,6 +1248,11 @@ public void TestBasicDTDCompatibility() {
continue; // DTD didn't exist in last release
}
if (dtd == DtdType.ldmlICU) continue;
if (dtd == DtdType.keyboard3
&& CldrVersion.LAST_RELEASE_VERSION.isAsOldOrOlderThan(CldrVersion.v45_0)) {
// Sample file did not have a DTD in v45, moved to a new location in v46+
continue;
}
try {
ElementAttributeInfo oldDtd = ElementAttributeInfo.getInstance(oldCommon, dtd);
ElementAttributeInfo newDtd = ElementAttributeInfo.getInstance(dtd);
Expand Down Expand Up @@ -1566,11 +1567,6 @@ public void TestDtdComparisonsAll() {
&& file.getParentFile().getParentFile().getName().equals("keyboards")) {
return; // skip imports
}
if (file.getPath().contains("/keyboards/3.0/")
&& logKnownIssue(
"CLDR-17574", "With v46, parsing issues for keyboard xml files")) {
continue;
}
checkDtdComparatorFor(file, null);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,6 @@ public void TestNonLdml() {
) {
continue;
}
if (dir2.getPath().contains("/keyboards/3.0")
&& logKnownIssue(
"CLDR-17574", "With v46, parsing issues for keyboard xml files")) {
continue;
}

Set<Pair<String, String>> seen = new HashSet<>();
Set<String> seenStarred = new HashSet<>();
int count = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ void TestReadCommon() throws FileNotFoundException, IOException {

@Test
void TestReadKeyboard() throws FileNotFoundException, IOException {
if (true /* TODO CLDR-17574 With v46, parsing issues for keyboard xml files */) {
return;
}
for (int i = 0; i < COUNT; i++) {
new XMLFileReader()
.setHandler(new XMLFileReader.SimpleHandler())
Expand All @@ -67,9 +64,6 @@ void TestReadKeyboard() throws FileNotFoundException, IOException {
@Test
void TestReadKeyboardByte() throws IOException, SAXException {
// verify that reading via InputStream (byte) works as well
if (true /* TODO CLDR-17574 With v46, parsing issues for keyboard xml files */) {
return;
}
try (InputStream fis = new FileInputStream(KEYBOARDS_MT); ) {
InputSource is = new InputSource(fis);
is.setSystemId(KEYBOARDS_MT);
Expand All @@ -81,9 +75,6 @@ void TestReadKeyboardByte() throws IOException, SAXException {
@Test
void TestReadKeyboardChar() throws IOException, SAXException {
// verify that reading via Reader (char) works as well
if (true /* TODO CLDR-17574 With v46, parsing issues for keyboard xml files */) {
return;
}
try (InputStream fis = new FileInputStream(KEYBOARDS_MT);
InputStreamReader isr = new InputStreamReader(fis); ) {
InputSource is = new InputSource(isr);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="mt" conformsTo="45">
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="mt" conformsTo="46">
<locales>
<!-- English is also an official language in Malta.-->
<locale id="en" />
Expand All @@ -9,7 +9,7 @@
<keys>
<!-- imports -->
<!-- Error - import does not exist. -->
<import base="cldr" path="45/keys-Zyyy-DOESNOTEXIST.xml"/>
<import base="cldr" path="46/keys-Zyyy-DOESNOTEXIST.xml"/>

<!-- accent grave -->
<key id="a-grave" output="à" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="mt" conformsTo="45">
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="mt" conformsTo="46">
<locales>
<!-- English is also an official language in Malta.-->
<locale id="en" />
Expand All @@ -9,7 +9,7 @@
<keys>
<!-- imports -->
<!-- Error - unknown version. -->
<import base="UNKNOWN" path="45/keys-Zyyy-punctuation.xml"/>
<import base="UNKNOWN" path="46/keys-Zyyy-punctuation.xml"/>

<!-- accent grave -->
<key id="a-grave" output="à" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="mt" conformsTo="45">
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="mt" conformsTo="46">
<locales>
<!-- English is also an official language in Malta.-->
<locale id="en" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="mt" conformsTo="45">
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="mt" conformsTo="46">
<locales>
<!-- Error - can't import 'keys' into a 'locales' section. -->
<import base="cldr" path="45/keys-Zyyy-punctuation.xml"/>
<import base="cldr" path="46/keys-Zyyy-punctuation.xml"/>
<!-- English is also an official language in Malta.-->
<locale id="en" />
</locales>
Expand Down
Loading