Skip to content

Commit

Permalink
CLDR-15034 kbd: Keyboard 3.0 DTD and Data Files (#3114)
Browse files Browse the repository at this point in the history
* CLDR-15034 kbd: Keyboard 3.0 Data Files

- originally many, many commits and PRs

Co-authored-by: Marc Durdin <[email protected]>
(cherry picked from commit 1716d10929d39b19cc8f03f6feba8d4f789bacd3)

* CLDR-15034 fix fr-azerty test file

- the 'extra' key is questionable, but it should at least be defined.

* CLDR-15034 remove old (pre-v44) Keyboard files

- these files aren't compatible with the new Keyboard DTD
- these files remain available in the CLDR download archives

* CLDR-15034 kbd data: skip keyboards in PathHeader test

* CLDR-15034 kbd data: reinstate DTD match for bcp47 and semver

* CLDR-15034 kbd data: fix for test case

- TestPaths: fix verbosity and a test skip logic err
- maven.yml: schema (xsd) tests are advisory and won't fail a build
  • Loading branch information
srl295 authored Aug 16, 2023
1 parent 4e9370c commit 5964d1e
Show file tree
Hide file tree
Showing 640 changed files with 1,795 additions and 193,389 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,20 @@ jobs:
-Dexec.cleanupDaemonThreads=false
-Dexec.args="-q --schema=common/dtd/ldml.xsd common/main"
|| (echo 'Schema failed, rerun GenerateDtd' ; exit 0)
- name: Keyboard Schema Check
run: >
mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
-Dexec.cleanupDaemonThreads=false
-Dexec.args="--schema=keyboards/dtd/ldmlKeyboard.xsd keyboards/3.0"
|| (echo 'Schema failed, rerun GenerateDtd' ; exit 0)
- name: Keyboard Test Schema Check
run: >
mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
-Dexec.cleanupDaemonThreads=false
-Dexec.args="--schema=keyboards/dtd/ldmlKeyboardTest.xsd keyboards/test"
|| (echo 'Schema failed, rerun GenerateDtd' ; exit 0)
- name: Setup MySQL
run: |
sudo systemctl start mysql.service
Expand Down
2 changes: 2 additions & 0 deletions common/dtd/ldmlSupplemental.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1723,6 +1723,7 @@




<xs:element name="convertUnits">

<xs:complexType>
Expand Down Expand Up @@ -1767,6 +1768,7 @@




<xs:element name="unitPreferenceData">

<xs:complexType>
Expand Down
17 changes: 3 additions & 14 deletions common/supplemental/attributeValueValidity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</variable>
<!-- The following are exceptional cases.
In v44 this contains a copy of the previous $language list to make review of CLDR-16789 easier;
this should be rationalized later.
this should be rationalized later.
-->
<variable id='$languageExceptions' type='choice'>
af agq ak am ann apc ar as asa ast az
Expand Down Expand Up @@ -449,26 +449,15 @@
<attributeValues dtds='ldml' elements='displayName' attributes='count' type='localeSpecific'>pluralOrdinal</attributeValues>
<attributeValues dtds='ldml' elements='relativeTimePattern' attributes='count' type='localeSpecific'>pluralOrdinal</attributeValues>
<attributeValues dtds='ldml' elements='unitPattern' attributes='count' type='localeSpecific'>pluralOrdinal</attributeValues>
<attributeValues dtds='keyboard' elements='keyMap' attributes='modifiers' type='TODO'></attributeValues>
<attributeValues dtds='keyboard' elements='keyboard' attributes='locale' type='TODO'></attributeValues>
<attributeValues dtds='keyboard' elements='map' attributes='iso' type='list'>A00 A01 A02 A03 A04 A05 B00 B01 B02 B03 B04 B05 B06 B07 B08
B09 B10 B11 B12 C01 C02 C03 C04 C05 C06 C07 C08 C09 C10 C11 C12 D01 D02 D03 D04 D05 D06 D07 D08 D09 D10 D11 D12 D13 E00 E01 E02 E03 E04 E05 E06
E07 E08 E09 E10 E11 E12 E13</attributeValues>
<attributeValues dtds='keyboard' elements='map' attributes='longPress' type='TODO'></attributeValues>
<attributeValues dtds='keyboard' elements='map' attributes='to' type='TODO'></attributeValues>
<!-- <attributeValues dtds='keyboard' elements='map' attributes='longPress' type='TODO'></attributeValues>
<attributeValues dtds='keyboard' elements='map' attributes='to' type='TODO'></attributeValues> -->
<attributeValues dtds='keyboard' elements='name' attributes='value' type='TODO'></attributeValues>
<attributeValues dtds='keyboard' elements='transform' attributes='from' type='TODO'></attributeValues>
<attributeValues dtds='keyboard' elements='transform' attributes='to' type='TODO'></attributeValues>
<attributeValues dtds='keyboard' elements='transforms' attributes='type' type='choice'>simple</attributeValues>
<attributeValues dtds='keyboard' elements='version' attributes='cldrVersion' type='list'>28</attributeValues>
<attributeValues dtds='keyboard' elements='version' attributes='number' type='TODO'></attributeValues>
<attributeValues dtds='keyboard' elements='version' attributes='platform' type='TODO'></attributeValues>
<attributeValues dtds='platform' elements='map' attributes='iso' type='list'>A03 B00 B01 B02 B03 B04 B05 B06 B07 B08 B09 B10 B11 C01 C02
C03 C04 C05 C06 C07 C08 C09 C10 C11 C12 D01 D02 D03 D04 D05 D06 D07 D08 D09 D10 D11 D12 D13 E00 E01 E02 E03 E04 E05 E06 E07 E08 E09 E10 E11 E12
E13</attributeValues>
<attributeValues dtds='platform' elements='map' attributes='keycode' type='list'>0 1 10 11 115 12 13 132 14 15 16 17 18 19 2 20 21 22 23
24 25 26 27 28 29 3 30 31 32 33 34 35 36 37 38 39 4 40 41 42 43 44 45 46 47 48 49 5 50 51 52 53 54 55 56 57 58 59 6 60 61 65 7 8 86 9 93 94 97</attributeValues>
<attributeValues dtds='platform' elements='platform' attributes='id' type='list'>android chromeos osx windows</attributeValues>
</validity>
</metadata>
</supplementalData>
210 changes: 210 additions & 0 deletions keyboards/3.0/fr-t-k0-azerty.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "../dtd/ldmlKeyboard.dtd">
<!--
This file is part of the CLDR Keyboard Technical Preview.
This is a sample data file.
This file is subject to change.
Please see https://cldr.unicode.org/index/keyboard-workgroup for the latest information.
Also NOTE: this is really a test keyboard. CLDR-12026 will be for the real new azerty keyboard
-->
<keyboard locale="fr-t-k0-azerty" conformsTo="techpreview">
<locales>
<locale id="br" /> <!-- example of including Breton -->
</locales>
<!-- 'conformsTo' gives CLDR spec conformance. Distinguishes from prior
keyboard formats -->
<!-- 'version' element is now optional -->
<version number="1.0.0" />
<info author="Team Keyboard" normalization="NFC" layout="AZERTY" indicator="FR" />
<names>
<name value="French Test" />
<name value="French Test AZERTY" />
</names>
<settings fallback="omit" />

<vkeys>
<vkey from="Q" to="A" />
<vkey from="W" to="Z" />
<vkey from="A" to="Q" />
<vkey from="Z" to="W" />
<vkey from="BKQUOTE" to="QUOTE" /> <!-- i.e., OEM_3 >>> OEM_7 -->
<vkey from="MINUS" to="LBRKT" />
<vkey from="LBRKT" to="RBRKT" />
<vkey from="COLON" to="M" />
<vkey from="QUOTE" to="BKQUOTE" />
<vkey from="M" to="COMMA" />
<vkey from="COMMA" to="PERIOD" />
<vkey from="PERIOD" to="SLASH" />
<vkey from="SLASH" to="EXCLAMATION" /> <!-- i.e., OEM_2 >>> OEM_8 -->
</vkeys>

<displays>
<!-- Note: displays is only used for keycap presentation -->
<!-- this example is not required for this keyboard as we use the spacing
modifiers -->
<display to="\u0300" display="${grave}" /> <!-- display combining grave as modifier letter grave ˋ -->
<!-- Note: We discussed why the existing displayMap was used for display.
rather than adding something closer to the key layout. 1. This way we can
tell the renderer what to do. Could be double diacritics, spacing issues,
etc. 2. We expect that keys have output. Otherwise the input content is malformed.
3. Don't Repeat Yourself : multiple keys (i.e. on different symbol layers)
may have the same display. -->
<displayOptions baseCharacter="x" />
</displays>

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

<!-- switch keys -->
<key id="shift" switch="shift" />
<key id="numeric" switch="numeric" />
<key id="symbol" switch="symbol" />
<key id="base" switch="base" />

<!--
TODO: need discussion
<key id="bksp" gap="true" /> -->
<key id="extra" gap="true" />
<!--
TODO: need discussion
<key id="enter" to="\u{000A}" />
-->

<!-- extra keys -->
<key id="u-grave" to="ü" />
<key id="e-grave" to="é" /> <!-- 2 -->
<key id="e-acute" to="è" /> <!-- 7 -->
<key id="c-cedilla" to="ç" /> <!-- 9 -->
<key id="a-acute" to="à" /> <!-- 0 -->

<!-- extra symbols -->
<key id="bullet" to="" />
<key id="umlaut" to="¨" />
<key id="super-2" to="²" longPress="" />

<!-- test key -->
<key id="a" flicks="a" to="a" longPress="à â á ä ã å ā" />
<flicks id="a">
<flick directions="nw" to="\u1234" />
<flick directions="nw se" to="\uFFFF" />
<flick directions="e" to="\uFFF0" />
</flicks>

<!-- test key -->
<key id="A" flicks="b" to="A" longPress="À Á Ä Ã Å Ā" />

<!-- test flick -->
<flicks id="b">
<flick directions="nw" to="\u4567" />
<flick directions="nw se" to="\uFFFF" />
<flick directions="e" to="\uFFF0" />
</flicks>

<!-- TODO: all additional maps, hardware and touch -->
</keys>

<layers form="iso">
<!-- in DTD: required if conformsTo ≥ 41 -->
<layer modifier="none">
<row
keys="super-2 amp e-grave double-quote apos open-paren hyphen e-acute underscore c-cedilla a-acute close-paren equal" />
<row keys="a z e r t y u i o p caret dollar" />
<row keys="q s d f g h j k l m u-grave asterisk" />
<row keys="open-angle w x c v b n comma semi-colon colon bang" />
<row keys="space" />
</layer>

<layer modifier="shift">
<row keys="1 2 3 4 5 6 7 8 9 0 degree plus" />
<row keys="A Z E R T Y U I O P umlaut pound" />
<row keys="Q S D F G H J K L M percent micro" />
<row keys="close-angle W X C V B N question period slash section" />
<row keys="space" />
</layer>
</layers>

<layers form="touch" minDeviceWidth="150">
<!-- optional attribute for min physical device size -->
<layer id="base">
<row keys="a z e r t y u i o p" />
<row keys="q s d f g h j k l m" />
<row keys="shift gap w x c v b n gap" /> <!--TODO: + bksp -->
<row keys="numeric extra space enter" />
</layer>

<layer id="shift">
<row keys="A Z E R T Y U I O P" />
<row keys="Q S D F G H J K L M" />
<row keys="base W X C V B N" /> <!--TODO: + bksp -->
<row keys="numeric extra space enter" />
</layer>

<layer id="numeric">
<row keys="1 2 3 4 5 6 7 8 9 0" />
<row
keys="hyphen slash colon semi-colon open-paren close-paren dollar amp at double-quote" />
<row keys="symbol period comma question bang double-quote" /> <!--TODO: + bksp -->
<row keys="base extra space enter" />
</layer>

<layer id="symbol">
<row
keys="open-square close-square open-curly close-curly hash percent caret asterisk plus equal" />
<row keys="underscore backslash pipe tilde open-angle close-angle euro pound yen bullet" />
<row keys="numeric period comma question bang double-quote" /> <!--TODO: + bksp -->
<row keys="base extra space enter" />
</layer>
</layers>

<variables>
<!-- spacing accents as string variables -->
<string id="grave" value="`" />
<string id="caret" value="^" />
<string id="umlaut" value="¨" />
<string id="tilde" value="~" />

<!-- sets representing vowels and accented vowels. -->
<!-- There's an extra space between the lower and upper case for visual separation -->
<!-- but, there are only 10 items in the following four sets -->
<set id="vowel" value="a e i o u A E I O U" />
<set id="graveVowel" value="à è ì ò ù À È Ì Ò Ù" />
<set id="caretVowel" value="â ê î ô û Â Ê Î Ô Û" />
<set id="umlautVowel" value="ä ë ï ö ü Ä Ë Ï Ö Ü" />

<!-- a set containing all spacing accents -->
<set id="spacing_accent" value="${grave} ${caret} ${umlaut} ${tilde}" />
</variables>

<transforms type="simple">
<transformGroup>
<!-- use sets for those that fit neatly into sets -->
<transform from="${grave}($[vowel])" to="$[1:graveVowel]" />
<transform from="${caret}($[vowel])" to="$[1:caretVowel]" />
<transform from="${umlaut}($[vowel])" to="$[1:umlautVowel]" />

<!-- y also takes umlaut (in this sample) -->
<transform from="${umlaut}y" to="ÿ" />

<!-- tilde is on a subset, not all vowels, + n -->
<transform from="${tilde}a" to="ã" />
<transform from="${tilde}A" to="Ã" />
<transform from="${tilde}n" to="ñ" />
<transform from="${tilde}N" to="Ñ" />
<transform from="${tilde}o" to="õ" />
<transform from="${tilde}O" to="Õ" />

<!-- accent + space = spacing accent -->
<transform from="($[spacing_accent]) " to="$1" />
</transformGroup>
<transformGroup>
<!-- this is a reorder group -->
<!-- nod-Lana partial example -->
<reorder from="\u1A60" order="127" />
<reorder from="\u1A6B" order="42" />
<reorder from="[\u1A75-\u1A79]" order="55" />
<!-- ... partial example ... -->
</transformGroup>
</transforms>
</keyboard>
34 changes: 34 additions & 0 deletions keyboards/3.0/ja-Latn.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "../dtd/ldmlKeyboard.dtd">
<keyboard locale="ja-Latn" conformsTo="techpreview">
<locales>
<locale id="en" />
</locales>
<version number="0.0.0" />
<names>
<!-- this is the Romaji (English) layer of the JIS keyboard -->
<name value="Romaji (JIS)" />
</names>

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

<layers form="jis">
<layer modifier="none">
<row keys="1 2 3 4 5 6 7 8 9 0 hyphen caret yen" />
<row keys="q w e r t y u i o p at open-square" />
<row keys="a s d f g h j k l semi-colon colon close-square" />
<row keys="z x c v b n m comma period slash underscore" />
<row keys="space"/>
</layer>
<layer modifier="shift">
<row keys="bang double-quote hash dollar percent amp apos open-paren close-paren 0 equal tilde pipe" /> <!-- 0 is repeated from "none" -->
<row keys="Q W E R T Y U I O P grave open-curly" />
<row keys="A S D F G H J K L plus asterisk close-curly" />
<row keys="Z X C V B N M open-angle close-angle question underscore" /> <!-- underscore is repeated from "none" -->
<row keys="space"/>
</layer>
</layers>
</keyboard>
Loading

0 comments on commit 5964d1e

Please sign in to comment.