Skip to content

Commit

Permalink
CLDR-15034 kbd: update to pcm keyboard
Browse files Browse the repository at this point in the history
- drop normalization workaround anticipating CLDR-16943
- simplify
- re-add caps layer
- add test case

Keyman side is keymanapp/keyman#9508
  • Loading branch information
srl295 committed Aug 24, 2023
1 parent aa62879 commit 0592524
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 62 deletions.
112 changes: 50 additions & 62 deletions keyboards/3.0/pcm.xml
Original file line number Diff line number Diff line change
@@ -1,70 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM '../dtd/ldmlKeyboard.dtd'>
<keyboard locale="pcm" conformsTo="techpreview">
<version number="1.0.0" />
<names>
<name value="Nigerian Pidgin" />
<name value="Naijíriá Píjin" />
</names>
<settings fallback="omit" />
<keys>
<import base="cldr" path="techpreview/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="techpreview/keys-Zyyy-currency.xml" />
<key id="grave" to="̀" /> <!-- TODO: move to NCR -->
<key id="acute" to="́" /> <!-- TODO: move to NCR -->
<version number="1.0.0" />
<names>
<name value="Nigerian Pidgin" />
<name value="Naijíriá Píjin" />
</names>
<settings fallback="omit" />
<keys>
<import base="cldr" path="techpreview/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="techpreview/keys-Zyyy-currency.xml" />
<key id="grave" to="\u{300}" />
<key id="acute" to="\u{301}" />

<!-- accented vowels -->
<key id="odot" to="" />
<key id="Odot" to="" />
<key id="edot" to="" />
<key id="Edot" to="" />
<!-- accented vowels -->
<key id="odot" to="" />
<key id="Odot" to="" />
<key id="edot" to="" />
<key id="Edot" to="" />

<!-- currency -->
<key id="naira" to="" />
</keys>
<!-- currency -->
<key id="naira" to="" />
</keys>

<layers form="iso">
<layer modifier="none">
<row
keys="grave 1 2 3 4 5 6 7 8 9 0 hyphen equal" />
<row keys="acute w e r t y u i o p open-square close-square" />
<row keys="a s d f g h j k l odot edot slash" />
<row keys="slash z c v b n m comma period semi-colon apos" />
<row keys="space" />
</layer>
<layers form="iso">
<layer modifier="none">
<row keys="grave 1 2 3 4 5 6 7 8 9 0 hyphen equal" />
<row keys="acute w e r t y u i o p open-square close-square" />
<row keys="a s d f g h j k l odot edot slash" />
<row keys="slash z c v b n m comma period semi-colon apos" />
<row keys="space" />
</layer>

<layer modifier="shift">
<row
keys="grave bang at hash dollar naira percent amp asterisk open-paren close-paren underscore plus" />
<row keys="acute W E R T Y U I O P open-curly close-curly" />
<row keys="A S D F G H J K L Odot Edot" />
<row keys="question Z C V B N M open-angle close-angle colon double-quote" />
<row keys="space" />
</layer>
</layers>
<layer modifier="shift">
<row keys="grave bang at hash dollar naira percent amp asterisk open-paren close-paren underscore plus" />
<row keys="acute W E R T Y U I O P open-curly close-curly" />
<row keys="A S D F G H J K L Odot Edot" />
<row keys="question Z C V B N M open-angle close-angle colon double-quote" />
<row keys="space" />
</layer>

<transforms type="simple">
<transformGroup>
<!-- Change vowels with appended acute, grave, and dot below combiners to combined forms -->
<transform from="a\u{300}" to="à" />
<transform from="E\u{300}" to="È" />
<transform from="o\u{301}" to="ó" />
<transform from="O\u{300}" to="Ò" />
<transform from="o\u{323}" to="" />
<transform from="A\u{323}" to="" />
<transform from="a\u{323}" to="" />
<transform from="a\u{301}" to="á" />
<transform from="A\u{300}" to="À" />
<transform from="E\u{323}" to="" />
<transform from="O\u{323}" to="" />
<transform from="''" to="\u{323}" /> <!-- Quick way to add dot below -->
<transform from="A\u{301}" to="Á" />
<transform from="e\u{323}" to="" />
<transform from="O\u{301}" to="Ó" />
<transform from="e\u{301}" to="é" />
<transform from="e\u{300}" to="è" />
<transform from="E\u{301}" to="É" />
<transform from="o\u{300}" to="ò" />
</transformGroup>
</transforms>
</keyboard>
<layer modifier="caps">
<row keys="grave 1 2 3 4 5 6 7 8 9 0 hyphen equal" />
<row keys="acute W E R T Y U I O P open-square close-square" />
<row keys="A S D F G H J K L Odot Edot slash" />
<row keys="slash Z C V B N M comma period semi-colon apos" />
<row keys="space" />
</layer>

</layers>

<transforms type="simple">
<transformGroup>
<transform from="''" to="\u{323}" /> <!-- Quick way to add dot below -->
</transformGroup>
</transforms>
</keyboard>
21 changes: 21 additions & 0 deletions keyboards/test/pcm-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboardTest SYSTEM "../dtd/ldmlKeyboardTest.dtd">
<keyboardTest conformsTo="techpreview">
<info keyboard="pcm.xml" author="Team Keyboard" name="pcm-test" />
<repertoire name="simple-repertoire" chars="[a b c d e ọ Ọ ẹ Ẹ ₦]" type="simple" />
<tests name="key-tests">
<test name="abc-test">
<startContext to="abc" />
<keystroke key="d" />
<check result="abcd" />
</test>
<test name="dot-below-test">
<startContext to="" />
<keystroke key="e" />
<keystroke key="apos" />
<check result="e'" />
<keystroke key="apos" />
<check result="e\u{323}" />
</test>
</tests>
</keyboardTest>

0 comments on commit 0592524

Please sign in to comment.