Skip to content

Commit

Permalink
CLDR-15034 kbd: add iso and abnt2 keyboards (#2802)
Browse files Browse the repository at this point in the history
* CLDR-15034 kbd: add iso and abnt2 keyboards

* CLDR-15034 kbd: fix errs caught by test case

* CLDR-15034 kbd: reformat source, fix comment

* CLDR-15034 kbd: fix more errs caught by test case

removing ^ from French test for now since the transforms arent there

* CLDR-15034 kbd: update display name and locale for abnt2

* CLDR-15034 kbd: fix spelling yet again
  • Loading branch information
srl295 authored Apr 27, 2023
1 parent 1161408 commit b3da9e8
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 0 deletions.
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>
65 changes: 65 additions & 0 deletions keyboards/3.0/pt-k0-abnt2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "../dtd/ldmlKeyboard.dtd">
<keyboard locale="pt-t-k0-abnt2" conformsTo="techpreview">
<locales>
<locale id="pt" />
</locales>
<version number="0.0.0" />
<names>
<name value="Portuguese (Brazil) (ABNT2)" />
</names>

<displays>
<display to="\m{acute}" display="´"/>
<display to="\m{grave}" display="`"/>
<display to="\m{umlaut}" display="¨"/>
<display to="\m{caret}" display="^"/>
<display to="\m{tilde}" display="~"/>
</displays>

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

<!-- TODO: using the proposed deadkey format -->
<key id="d-acute" to="\m{acute}"/>
<key id="d-grave" to="\m{grave}"/>
<key id="d-umlaut" to="\m{umlaut}"/>
<key id="d-caret" to="\m{caret}"/>
<key id="d-tilde" to="\m{tilde}"/>

<key id="c-cedilla" to="ç" />
<key id="C-cedilla" to="Ç" />

<key id="super-1" to="¹" />
<key id="super-2" to="²" />
<key id="super-3" to="³" />
<key id="ordinal-feminine" to="ª" />
<key id="ordinal-masculine" to="º" />
</keys>
<layers form="abnt2">
<layer modifier="none">
<row keys="apos 1 2 3 4 5 6 7 8 9 0 hyphen equal" />
<row keys="q w e r t y u i o p d-acute open-square" />
<row keys="a s d f g h j k l c-cedilla d-tilde close-square" />
<row keys="backslash z x c v b n m comma period semi-colon slash" />
<row keys="space"/>
</layer>
<layer modifier="shift">
<row keys="double-quote bang at hash dollar percent d-umlaut amp asterisk open-paren close-paren underscore plus" />
<row keys="Q W E R T Y U I O P d-grave open-curly" />
<row keys="A S D F G H J K L C-cedilla d-tilde close-curly" />
<row keys="pipe Z X C V B N M open-angle close-angle colon question" />
<row keys="space"/>
</layer>
<layer modifier="altR">
<row keys="gap super-1 super-2 super-3 pound cent not gap gap gap gap gap section" />
<row keys="slash question degree gap gap gap gap gap gap gap gap ordinal-feminine" />
<row keys="gap gap gap gap gap gap gap gap gap gap gap ordinal-masculine" />
<row keys="gap gap gap cruzeiro gap gap gap gap gap gap gap degree" />
<row keys="space"/>
</layer>
</layers>

<!-- TODO: transform! -->
</keyboard>
2 changes: 2 additions & 0 deletions keyboards/import/keys-Zyyy-currency.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ CLDR data files are interpreted according to the LDML specification (http://unic
<key id="euro" to="" />
<key id="pound" to="£" />
<key id="yen" to="¥" />
<key id="cruzeiro" to="" />
<key id="cent" to="¢" />
</keys>
27 changes: 27 additions & 0 deletions keyboards/test/ja-Latn-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboardTest SYSTEM "../dtd/ldmlKeyboardTest.dtd">
<keyboardTest conformsTo="techpreview">
<info keyboard="ja-Latn.xml" author="Team Keyboard" name="ja-Latn-test" />
<repertoire name="latn-repertoire"
chars="[a-z A-Z 0-9 !\u0022#$%\u0026\[\]\{\}=\-|¥~\^_\u0020\u003c>,./?`@\+\*]" type="simple" />
<tests name="tests">
<test name="test1">
<startContext to="" /> <!-- empty startContext -->
<keystroke key="n" />
<keystroke key="m" />
<keystroke key="comma" />
<keystroke key="period" />
<keystroke key="slash" />
<check result="nm,./" />
</test>
<test name="test2">
<startContext to="" /> <!-- empty startContext -->
<keystroke key="open-square" />
<keystroke key="8" />
<keystroke key="9" />
<keystroke key="0" />
<keystroke key="pipe" />
<check result="[890|" />
</test>
</tests>
</keyboardTest>
41 changes: 41 additions & 0 deletions keyboards/test/pt-BR-k0-abnt2-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboardTest SYSTEM "../dtd/ldmlKeyboardTest.dtd">
<keyboardTest conformsTo="techpreview">
<info keyboard="pt-BR-k0-abnt2.xml" author="Team Keyboard" name="pt-test" />
<repertoire name="latn-repertoire"
chars="[a-z A-Z 0-9 !\u0022#$%\u0026\[\]\{\}=\-|~_\u0020\u003c>,./?`@\+\*çÇ]"
type="simple" />
<repertoire name="currency-and-symbols"
chars="[₢ ° ¹²³ § ¬ ªº]" />
<tests name="tests">
<test name="test1">
<startContext to="" /> <!-- empty startContext -->
<keystroke key="n" />
<keystroke key="m" />
<keystroke key="comma" />
<keystroke key="period" />
<keystroke key="slash" />
<check result="nm,./" />
</test>
<test name="test2">
<startContext to="" /> <!-- empty startContext -->
<keystroke key="open-square" />
<keystroke key="8" />
<keystroke key="9" />
<keystroke key="0" />
<keystroke key="pipe" />
<check result="[890|" />
</test>
<test name="test3">
<startContext to="" /> <!-- empty startContext -->
<keystroke key="slash" />
<keystroke key="semi-colon" />
<keystroke key="backslash" />
<keystroke key="C-cedilla" />
<keystroke key="c-cedilla" />
<keystroke key="8" />
<keystroke key="ordinal-feminine" />
<check result="/;\u005cÇç8ª" />
</test>
</tests>
</keyboardTest>

0 comments on commit b3da9e8

Please sign in to comment.