From 85553c4d1600c961b4c9e1047341ddae8c0c42d1 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 3 Oct 2023 18:45:45 -0500 Subject: [PATCH] CLDR-17113 kbd: attribute naming updates - also spotless update --- docs/ldml/tr35-keyboards.md | 122 ++++++++--------- keyboards/3.0/fr-t-k0-azerty.xml | 4 + keyboards/dtd/ldmlKeyboard3.dtd | 2 +- keyboards/dtd/ldmlKeyboard3.xsd | 4 +- keyboards/import/keys-Latn-implied.xml | 126 +++++++++--------- keyboards/import/keys-Zyyy-currency.xml | 12 +- keyboards/import/keys-Zyyy-punctuation.xml | 70 +++++----- .../unicode/cldr/unittest/TestDtdData.java | 12 +- 8 files changed, 177 insertions(+), 175 deletions(-) diff --git a/docs/ldml/tr35-keyboards.md b/docs/ldml/tr35-keyboards.md index c1699cc9db7..e861ea1ad8e 100644 --- a/docs/ldml/tr35-keyboards.md +++ b/docs/ldml/tr35-keyboards.md @@ -274,11 +274,11 @@ Currently, the following attribute values allow _UnicodeSet_ notation: The `\u{...}` notation, a subset of hex notation, is described in [UTS #18 section 1.1](https://www.unicode.org/reports/tr18/#Hex_notation). It can refer to one or multiple individual codepoints. Currently, the following attribute values allow the `\u{...}` notation: -* `to`, `longPress`, `multiTap`, and `longPressDefault` on the `` element -* `to` on the `` element +* `output`, `longPress`, `multiTap`, and `longPressDefault` on the `` element +* `output` on the `` element * `from` or `to` on the `` element * `value` on the `` element -* `to` and `display` on the `` element +* `output` and `display` on the `` element * `baseCharacter` on the `` element * Some attributes on [Keyboard Test Data](#keyboard-test-data) subelements @@ -617,14 +617,14 @@ This element defines a mapping between an abstract key and its output. This elem ```xml @@ -641,7 +641,7 @@ This element defines a mapping between an abstract key and its output. This elem **Note**: The `id` attribute is required. -**Note**: _at least one of_ `switch`, `gap`, or `to` are required. +**Note**: _at least one of_ `layerId`, `gap`, or `output` are required. _Attribute:_ `id` @@ -649,9 +649,9 @@ _Attribute:_ `id` > > In the future, this attribute’s definition is expected to be updated to align with [UAX#31](https://www.unicode.org/reports/tr31/). Please see [CLDR-17043](https://unicode-org.atlassian.net/browse/CLDR-17043) for more details. -_Attribute:_ `flicks="{flick id}"` (optional) +_Attribute:_ `flickId="{flick id}"` (optional) -> The `flicks` attribute indicates that this key makes use of a [`flicks`](#Element_flicks) set with the specified id. +> The `flickId` attribute indicates that this key makes use of a [`flick`](#Element_flick) set with the specified id. _Attribute:_ `gap="true"` (optional) @@ -680,7 +680,7 @@ _Attribute:_ `multiTap` (optional) > _Example:_ > > ```xml -> +> > ``` > > Control characters, combining marks and whitespace (which is intended to be a multiTap option) in this attribute are escaped using the `\u{...}` notation. @@ -692,11 +692,11 @@ _Attribute:_ `stretch="true"` (optional) > The `stretch` attribute indicates that a touch layout may stretch this key to fill available horizontal space on the row. > This is used, for example, on the spacebar. Note that `stretch=` is ignored for hardware layouts. -_Attribute:_ `switch="shift"` (optional) +_Attribute:_ `layerId="shift"` (optional) -> The `switch` attribute indicates that this key switches to another `layer` with the specified id (such as `` in this example). -> Note that a key may have both a `switch=` and a `to=` attribute, indicating that the key outputs prior to switching layers. -> Also note that `switch=` is ignored for hardware layouts: their shifting is controlled via +> The `layerId` attribute indicates that this key switches to another `layer` with the specified id (such as `` in this example). +> Note that a key may have both a `layerId=` and a `output=` attribute, indicating that the key outputs _prior_ to switching layers. +> Also note that `layerId=` is ignored for hardware layouts: their shifting is controlled via > the modifier keys. > > This attribute is an NMTOKEN. @@ -704,11 +704,11 @@ _Attribute:_ `switch="shift"` (optional) > In the future, this attribute’s definition is expected to be updated to align with [UAX#31](https://www.unicode.org/reports/tr31/). Please see [CLDR-17043](https://unicode-org.atlassian.net/browse/CLDR-17043) for more details. -_Attribute:_ `to` +_Attribute:_ `output` -> The `to` attribute contains the output sequence of characters that is emitted when pressing this particular key. Control characters, whitespace (other than the regular space character) and combining marks in this attribute are escaped using the `\u{...}` notation. More than one key may output the same output. +> The `output` attribute contains the sequence of characters that is emitted when pressing this particular key. Control characters, whitespace (other than the regular space character) and combining marks in this attribute are escaped using the `\u{...}` notation. More than one key may output the same output. > -> The `to` attribute may also contain the `\m{…}` syntax to insert a marker. See the definition of [markers](#markers). +> The `output` attribute may also contain the `\m{…}` syntax to insert a marker. See the definition of [markers](#markers). _Attribute:_ `transform="no"` (optional) @@ -722,8 +722,8 @@ _Attribute:_ `transform="no"` (optional) ```xml - - + + @@ -745,13 +745,13 @@ _Attribute:_ `transform="no"` (optional) ```xml - - + + - + ``` @@ -759,13 +759,13 @@ Even better is to use a marker to indicate where transforms are desired: ```xml - - + + - + ``` @@ -774,7 +774,7 @@ _Attribute:_ `width="1.2"` (optional, default "1.0") > The `width` attribute indicates that this key has a different width than other keys, by the specified number of key widths. ```xml - + ``` @@ -784,23 +784,23 @@ Not all keys need to be listed explicitly. The following two can be assumed to ```xml - + ``` In addition, these 62 keys, comprising 10 digit keys, 26 Latin lower-case keys, and 26 Latin upper-case keys, where the `id` is the same as the `to`, are assumed to exist: ```xml - - - + + + … - - - + + + … - - - + + + … ``` @@ -844,7 +844,7 @@ The `flick` element is used to generate results from a "flick" of the finger on ```xml - + @@ -879,7 +879,7 @@ _Attribute:_ `id` (required) **Syntax** ```xml - + ``` > @@ -896,16 +896,16 @@ _Attribute:_ `directions` (required) > The `directions` attribute value is a space-delimited list of keywords, that describe a path, currently restricted to the cardinal and intercardinal directions `{n e s w ne nw se sw}`. -_Attribute:_ `to` (required) +_Attribute:_ `output` (required) -> The to attribute value is the result of (one or more) flicks. +> The `output` attribute value is the result of (one or more) flicks. **Example** where a flick to the Northeast then South produces two code points. ```xml - + ``` @@ -1015,7 +1015,7 @@ For combining characters, U+25CC `◌` is used as a base. It is an error to use For example, a key which outputs a combining tilde (U+0303) can be represented as follows: ```xml - + ``` This way, a key which outputs a combining tilde (U+0303) will be represented as `◌̃` (a tilde on a dotted circle). @@ -1052,7 +1052,7 @@ The `display` element describes how a character, that has come from a `keys/key` **Syntax** ```xml - + ``` > @@ -1065,23 +1065,23 @@ The `display` element describes how a character, that has come from a `keys/key` > > -One of the `to` or `id` attributes is required. +One of the `output` or `id` attributes is required. -_Attribute:_ `to` (optional) +_Attribute:_ `output` (optional) > Specifies the character or character sequence from the `keys/key` element that is to have a special display. > This attribute may be escaped with `\u` notation, see [Escaping](#Escaping). -> The `to` attribute may also contain the `\m{…}` syntax to reference a marker. See [Markers](#markers). Implementations may highlight a displayed marker, such as with a lighter text color, or a yellow highlight. +> The `output` attribute may also contain the `\m{…}` syntax to reference a marker. See [Markers](#markers). Implementations may highlight a displayed marker, such as with a lighter text color, or a yellow highlight. _Attribute:_ `id` (optional) -> Specifies the `key` id. This is useful for keys which do not produce any output (no `to=` value), such as a shift key. +> Specifies the `key` id. This is useful for keys which do not produce any output (no `output=` value), such as a shift key. > > This attribute must match `[A-Za-z0-9][A-Za-z0-9-]*` _Attribute:_ `display` (required) -> Required and specifies the character sequence that should be displayed on the keytop for any key that generates the `@to` sequence or has the `@id`. (It is an error if the value of the `display` attribute is the same as the value of the `to` attribute, this would be an extraneous entry.) +> Required and specifies the character sequence that should be displayed on the keytop for any key that generates the `@output` sequence or has the `@id`. (It is an error if the value of the `display` attribute is the same as the value of the `output` attribute, this would be an extraneous entry.) This attribute may be escaped with `\u` notation, see [Escaping](#Escaping). @@ -1090,19 +1090,19 @@ This attribute may be escaped with `\u` notation, see [Escaping](#Escaping). ```xml - - + + - - - - + + + + ``` -To allow `displays` elements to be shared across keyboards, there is no requirement that `@to` in a `display` element matches any `@to`/`@id` in any `keys/key` element in the keyboard description. +To allow `displays` elements to be shared across keyboards, there is no requirement that `@output` in a `display` element matches any `@output`/`@id` in any `keys/key` element in the keyboard description. * * * @@ -1483,11 +1483,11 @@ These may be then used in multiple contexts: - - + + - + ``` * * * @@ -1643,10 +1643,10 @@ The marker ID is any valid `NMTOKEN` (But see [CLDR-17043](https://unicode-org.a Consider the following abbreviated example: ```xml - + … - - + + ``` diff --git a/keyboards/3.0/fr-t-k0-azerty.xml b/keyboards/3.0/fr-t-k0-azerty.xml index 818ed39632e..e0a5760f271 100644 --- a/keyboards/3.0/fr-t-k0-azerty.xml +++ b/keyboards/3.0/fr-t-k0-azerty.xml @@ -29,6 +29,10 @@ 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. --> + + + + diff --git a/keyboards/dtd/ldmlKeyboard3.dtd b/keyboards/dtd/ldmlKeyboard3.dtd index 64b2fd185de..d74f948a44f 100644 --- a/keyboards/dtd/ldmlKeyboard3.dtd +++ b/keyboards/dtd/ldmlKeyboard3.dtd @@ -69,7 +69,7 @@ Please view the subcommittee page for the most recent information. - + diff --git a/keyboards/dtd/ldmlKeyboard3.xsd b/keyboards/dtd/ldmlKeyboard3.xsd index 05a86684b13..0c1a51fa45d 100644 --- a/keyboards/dtd/ldmlKeyboard3.xsd +++ b/keyboards/dtd/ldmlKeyboard3.xsd @@ -139,7 +139,7 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file - + @@ -249,7 +249,7 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file - + diff --git a/keyboards/import/keys-Latn-implied.xml b/keyboards/import/keys-Latn-implied.xml index eed84d38f82..537860aeb93 100644 --- a/keyboards/import/keys-Latn-implied.xml +++ b/keyboards/import/keys-Latn-implied.xml @@ -13,68 +13,68 @@ CLDR data files are interpreted according to the LDML specification (http://unic - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/keyboards/import/keys-Zyyy-currency.xml b/keyboards/import/keys-Zyyy-currency.xml index 778cad451ad..dd88113501b 100644 --- a/keyboards/import/keys-Zyyy-currency.xml +++ b/keyboards/import/keys-Zyyy-currency.xml @@ -13,10 +13,10 @@ CLDR data files are interpreted according to the LDML specification (http://unic --> - - - - - - + + + + + + diff --git a/keyboards/import/keys-Zyyy-punctuation.xml b/keyboards/import/keys-Zyyy-punctuation.xml index 1e540cf024e..59c6280826d 100644 --- a/keyboards/import/keys-Zyyy-punctuation.xml +++ b/keyboards/import/keys-Zyyy-punctuation.xml @@ -8,39 +8,39 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestDtdData.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestDtdData.java index b1a15621793..f9b71cd796a 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestDtdData.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestDtdData.java @@ -1,5 +1,9 @@ package org.unicode.cldr.unittest; +import com.google.common.base.Joiner; +import com.google.common.collect.Multimap; +import com.google.common.collect.TreeMultimap; +import com.ibm.icu.dev.test.TestFmwk; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -13,7 +17,6 @@ import java.util.Map.Entry; import java.util.Set; import java.util.TreeSet; - import org.unicode.cldr.util.CLDRConfig; import org.unicode.cldr.util.CLDRPaths; import org.unicode.cldr.util.DtdData; @@ -31,11 +34,6 @@ import org.unicode.cldr.util.XMLFileReader; import org.unicode.cldr.util.XPathParts; -import com.google.common.base.Joiner; -import com.google.common.collect.Multimap; -import com.google.common.collect.TreeMultimap; -import com.ibm.icu.dev.test.TestFmwk; - public class TestDtdData extends TestFmwk { private static final String COMMON_DIR = CLDRPaths.BASE_DIRECTORY + "common/"; static CLDRConfig testInfo = CLDRConfig.getInstance(); @@ -783,7 +781,7 @@ public boolean isDistinguishingOld(DtdType dtdType, String elementName, String a || elementName.equals("transform") && attribute.equals("after") || elementName.equals("flickSegment") && attribute.equals("directions") || elementName.equals("display") && attribute.equals("output") - || elementName.equals("display") && attribute.equals("id") + || elementName.equals("display") && attribute.equals("keyId") || elementName.equals("flick") && attribute.equals("id"); case keyboardTest3: return elementName.equals("tests") && attribute.equals("name")