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-16943 kbd: Normalization #3285

Merged
merged 7 commits into from
Oct 4, 2023
Merged
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
36 changes: 23 additions & 13 deletions docs/ldml/tr35-keyboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ Element containing informative properties about the layout, for displaying in us

```xml
<info author="{author}"
normalization="{form}"
layout="{hint of the layout}"
indicator="{short identifier}" />
```
Expand All @@ -505,16 +504,6 @@ _Attribute:_ `author`

> The `author` attribute contains the name of the author of the layout file.

_Attribute:_ `normalization`

> The `normalization` attribute describes the intended normalization form of the keyboard layout output. The valid values are `NFC`, `NFD` or `other`.
>
> An example use case is aiding a user to choose among the two same layouts with one outputting characters in the normalization form C and one in the normalization form D.
>
> All keyboards in the CLDR repository will be in `NFC` or `NFD` forms. However, users and implementations may produce and consume other normalization forms or mixed output, use the `other` value to indicate this case.
>
> When using `NFC` or `NFD`, tooling should verify that all possible keystrokes, gestures, and transforms on the keyboard only produce the specified normalization form, producing warnings if not.

_Attribute:_ `layout`

> The `layout` attribute describes the layout pattern, such as QWERTY, DVORAK, INSCRIPT, etc. typically used to distinguish various layouts for the same language.
Expand Down Expand Up @@ -617,7 +606,7 @@ _Attribute:_ `fallback="omit"`

> The presence of this attribute means that when a modifier key combination goes unmatched, no output is produced. The default behavior (when this attribute is not present) is to fall back to the base map when the modifier key combination goes unmatched.

If this attribute is present, it must have a value of omit.
If this attribute is present, it must have a value of `omit`.

**Example**

Expand All @@ -635,6 +624,27 @@ Indicates that:
2. If a transform is terminated, output the contents of the buffer.
3. During a transform, hide the contents of the buffer as the user is typing.

_Attribute:_ `normalization`

> Normalization will not typically be the responsibility of the keyboard author, rather this will be managed by the implementation.
> The implementation will apply normalization as appropriate when matching transform rules and `<display>` value matching.
> Output from the keyboard, following application of all transform rules, will be normalized to implementation or application-requested form.
srl295 marked this conversation as resolved.
Show resolved Hide resolved
>
> However, it is recognized that there may be some keyboards which, for compatibility or legacy reasons, need to manage their own normalization. The implementation in that case will do no normalization at all. The keyboard author must make use of transforms in the keyboard to any required normalization. In this case, the attribute value `normalization="disabled"` is used to indicate that no automatic normalization happens.
>
> **Note**: while this attribute is allowed by the specification, its use is discouraged, and keyboards with `normalization="disabled"` would not be accepted into the ClDR repository.


**Example**

```xml
<keyboard3 locale="bg">
<settings normalization="disabled" />
</keyboard3>
```

* * *

### <a name="Element_keys" href="#Element_keys">Element: keys</a>
Expand Down Expand Up @@ -960,7 +970,7 @@ The intent is for each single XML file to contain all that is needed for a keybo
`<import>` can be used as a child of a number of elements (see the _Parents_ section immediately below). Multiple `<import>` elements may be used, however, `<import>` elements must come before any other sibling elements.
If two identical elements are defined, the later element will take precedence, that is, override.

**Note:** imported files do not have any indication of their normalization mode. For this reason, the keyboard author must verify that the imported file is of a compatible normalization mode. See the [`info` element](#Element_info) for further details.
**Note:** imported files do not have any indication of their normalization mode. For this reason, the keyboard author must verify that the imported file is of a compatible normalization mode. See the [`settings` element](#element-settings) for further details.

**Syntax**
```xml
Expand Down
2 changes: 1 addition & 1 deletion keyboards/3.0/fr-t-k0-azerty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
keyboard formats -->
<!-- 'version' element is now optional -->
<version number="1.0.0" />
<info author="Team Keyboard" normalization="NFC" layout="AZERTY" indicator="FR" />
<info author="Team Keyboard" layout="AZERTY" indicator="FR" />
<names>
<name value="French Test" />
<name value="French Test AZERTY" />
Expand Down
2 changes: 1 addition & 1 deletion keyboards/3.0/mt-t-k0-47key.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- English is also an official language in Malta.-->
<locale id="en" />
</locales>
<info author="Steven R. Loomis" normalization="NFC" layout="QWERTY" indicator="MT" />
<info author="Steven R. Loomis" layout="QWERTY" indicator="MT" />

<names>
<name value="Maltese 47-key" />
Expand Down
2 changes: 1 addition & 1 deletion keyboards/3.0/mt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!-- English is also an official language in Malta.-->
<locale id="en" />
</locales>
<info author="Steven R. Loomis" normalization="NFC" layout="QWERTY" indicator="MT" />
<info author="Steven R. Loomis" layout="QWERTY" indicator="MT" />

<names>
<name value="Maltese" />
Expand Down
6 changes: 3 additions & 3 deletions keyboards/dtd/ldmlKeyboard3.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ Please view the subcommittee page for the most recent information.
<!ATTLIST info author CDATA #IMPLIED >
<!--@MATCH:any-->
<!--@VALUE-->
<!ATTLIST info normalization CDATA #IMPLIED >
<!--@MATCH:literal/NFC, NFD, other-->
<!--@VALUE-->
<!ATTLIST info layout CDATA #IMPLIED >
<!--@MATCH:any-->
<!--@VALUE-->
Expand All @@ -76,6 +73,9 @@ Please view the subcommittee page for the most recent information.
<!--@TECHPREVIEW-->
<!ATTLIST settings fallback (omit) #IMPLIED >
<!--@VALUE-->
<!ATTLIST settings normalization (disabled) #IMPLIED >
<!--@VALUE-->


<!ELEMENT displays ( import*, display*, displayOptions*, special* ) >
<!--@TECHPREVIEW-->
Expand Down
11 changes: 8 additions & 3 deletions keyboards/dtd/ldmlKeyboard3.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file
<xs:element name="info">
<xs:complexType>
<xs:attribute name="author"/>
<xs:attribute name="normalization"/>
<xs:attribute name="layout"/>
<xs:attribute name="indicator"/>
</xs:complexType>
Expand All @@ -110,8 +109,6 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file





<xs:element name="names">
<xs:complexType>
<xs:sequence>
Expand Down Expand Up @@ -142,11 +139,19 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="normalization">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="disabled"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>




<xs:element name="displays">
<xs:complexType>
<xs:sequence>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- English is also an official language in Malta.-->
<locale id="en" />
</locales>
<info author="Steven R. Loomis" normalization="NFC" layout="QWERTY" indicator="MT" />
<info author="Steven R. Loomis" layout="QWERTY" indicator="MT" />

<names>
<name value="Maltese (48-key)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- English is also an official language in Malta.-->
<locale id="en" />
</locales>
<info author="Steven R. Loomis" normalization="NFC" layout="QWERTY" indicator="MT" />
<info author="Steven R. Loomis" layout="QWERTY" indicator="MT" />

<names>
<name value="Maltese (48-key)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- English is also an official language in Malta.-->
<locale id="en" />
</locales>
<info author="Steven R. Loomis" normalization="NFC" layout="QWERTY" indicator="MT" />
<info author="Steven R. Loomis" layout="QWERTY" indicator="MT" />

<names>
<name value="Maltese (48-key)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- English is also an official language in Malta.-->
<locale id="en" />
</locales>
<info author="Steven R. Loomis" normalization="NFC" layout="QWERTY" indicator="MT" />
<info author="Steven R. Loomis" layout="QWERTY" indicator="MT" />

<names>
<!-- Error - can't import 'keys' into a 'names' section. -->
Expand Down
Loading