am e422c946: Fix test resource declarations and parsing a bit
* commit 'e422c94634da4d0e61a9106addebf06cbcf70c2e': Fix test resource declarations and parsing a bitmain
commit
9286ff7f2b
|
@ -161,7 +161,7 @@
|
||||||
latin:parentStyle="baseForLayoutSwitchKeyStyle" />
|
latin:parentStyle="baseForLayoutSwitchKeyStyle" />
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="comKeyStyle"
|
latin:styleName="comKeyStyle"
|
||||||
latin:keySpec="!text/keylabel_for_popular_domain|!text/keylabel_for_popular_domain"
|
latin:keySpec="!text/keylabel_for_popular_domain"
|
||||||
latin:keyLabelFlags="autoXScale|fontNormal|hasPopupHint|preserveCase"
|
latin:keyLabelFlags="autoXScale|fontNormal|hasPopupHint|preserveCase"
|
||||||
latin:moreKeys="!text/more_keys_for_popular_domain" />
|
latin:moreKeys="!text/more_keys_for_popular_domain" />
|
||||||
</merge>
|
</merge>
|
||||||
|
|
|
@ -149,7 +149,7 @@
|
||||||
latin:parentStyle="baseForLayoutSwitchKeyStyle" />
|
latin:parentStyle="baseForLayoutSwitchKeyStyle" />
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="comKeyStyle"
|
latin:styleName="comKeyStyle"
|
||||||
latin:keySpec="!text/keylabel_for_popular_domain|!text/keylabel_for_popular_domain"
|
latin:keySpec="!text/keylabel_for_popular_domain"
|
||||||
latin:keyLabelFlags="autoXScale|fontNormal|hasPopupHint|preserveCase"
|
latin:keyLabelFlags="autoXScale|fontNormal|hasPopupHint|preserveCase"
|
||||||
latin:moreKeys="!text/more_keys_for_popular_domain"
|
latin:moreKeys="!text/more_keys_for_popular_domain"
|
||||||
latin:backgroundType="functional" />
|
latin:backgroundType="functional" />
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
<!-- U+066A: "٪" ARABIC PERCENT SIGN -->
|
<!-- U+066A: "٪" ARABIC PERCENT SIGN -->
|
||||||
<string name="keylabel_for_symbols_percent">٪</string>
|
<string name="keylabel_for_symbols_percent">٪</string>
|
||||||
<!-- U+00BF: "¿" INVERTED QUESTION MARK -->
|
<!-- U+00BF: "¿" INVERTED QUESTION MARK -->
|
||||||
<string name="more_keys_for_question">\?,¿</string>
|
<string name="more_keys_for_question">?,¿</string>
|
||||||
<string name="more_keys_for_symbols_semicolon">;</string>
|
<string name="more_keys_for_symbols_semicolon">;</string>
|
||||||
<!-- U+2030: "‰" PER MILLE SIGN -->
|
<!-- U+2030: "‰" PER MILLE SIGN -->
|
||||||
<string name="more_keys_for_symbols_percent">\\%,‰</string>
|
<string name="more_keys_for_symbols_percent">\\%,‰</string>
|
||||||
|
@ -85,7 +85,7 @@
|
||||||
<string name="keylabel_for_tablet_comma">"،"</string>
|
<string name="keylabel_for_tablet_comma">"،"</string>
|
||||||
<string name="keyhintlabel_for_tablet_comma">"؟"</string>
|
<string name="keyhintlabel_for_tablet_comma">"؟"</string>
|
||||||
<string name="more_keys_for_tablet_comma">"!fixedColumnOrder!4,:,!,؟,؛,-,/,\",\'"</string>
|
<string name="more_keys_for_tablet_comma">"!fixedColumnOrder!4,:,!,؟,؛,-,/,\",\'"</string>
|
||||||
<string name="more_keys_for_punctuation">"!fixedColumnOrder!8,\",\',#,-,:,!,،,؟,\@,&,\\%,+,؛,/,(|),)|("</string>
|
<string name="more_keys_for_punctuation">"!fixedColumnOrder!8,\",\',#,-,:,!,،,؟,@,&,\\%,+,؛,/,(|),)|("</string>
|
||||||
<!-- U+266A: "♪" EIGHTH NOTE -->
|
<!-- U+266A: "♪" EIGHTH NOTE -->
|
||||||
<string name="more_keys_for_bullet">♪</string>
|
<string name="more_keys_for_bullet">♪</string>
|
||||||
<!-- U+2605: "★" BLACK STAR
|
<!-- U+2605: "★" BLACK STAR
|
||||||
|
|
|
@ -71,8 +71,8 @@
|
||||||
U+0142: "ł" LATIN SMALL LETTER L WITH STROKE -->
|
U+0142: "ł" LATIN SMALL LETTER L WITH STROKE -->
|
||||||
<string name="more_keys_for_l">l·l,ł</string>
|
<string name="more_keys_for_l">l·l,ł</string>
|
||||||
<!-- U+00B7: "·" MIDDLE DOT -->
|
<!-- U+00B7: "·" MIDDLE DOT -->
|
||||||
<string name="more_keys_for_punctuation">"!fixedColumnOrder!9,;,/,(,),#,·,!,\\,,\?,&,\\%,+,\",-,:,',\@"</string>
|
<string name="more_keys_for_punctuation">"!fixedColumnOrder!9,;,/,(,),#,·,!,\\,,?,&,\\%,+,\",-,:,',@"</string>
|
||||||
<string name="more_keys_for_tablet_punctuation">"!fixedColumnOrder!8,;,/,(,),#,·,',\\,,&,\\%,+,\",-,:,\@"</string>
|
<string name="more_keys_for_tablet_punctuation">"!fixedColumnOrder!8,;,/,(,),#,·,',\\,,&,\\%,+,\",-,:,@"</string>
|
||||||
<!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA -->
|
<!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA -->
|
||||||
<string name="keylabel_for_spanish_row2_10">ç</string>
|
<string name="keylabel_for_spanish_row2_10">ç</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -69,5 +69,5 @@
|
||||||
<string name="more_keys_for_c">ç,ć,č</string>
|
<string name="more_keys_for_c">ç,ć,č</string>
|
||||||
<!-- U+00A1: "¡" INVERTED EXCLAMATION MARK
|
<!-- U+00A1: "¡" INVERTED EXCLAMATION MARK
|
||||||
U+00BF: "¿" INVERTED QUESTION MARK -->
|
U+00BF: "¿" INVERTED QUESTION MARK -->
|
||||||
<string name="more_keys_for_punctuation">"!fixedColumnOrder!9,¡,;,/,(,),#,!,\\,,\?,¿,&,\\%,+,\",-,:,',\@"</string>
|
<string name="more_keys_for_punctuation">"!fixedColumnOrder!9,¡,;,/,(,),#,!,\\,,?,¿,&,\\%,+,\",-,:,',@"</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
<!-- U+066A: "٪" ARABIC PERCENT SIGN -->
|
<!-- U+066A: "٪" ARABIC PERCENT SIGN -->
|
||||||
<string name="keylabel_for_symbols_percent">٪</string>
|
<string name="keylabel_for_symbols_percent">٪</string>
|
||||||
<!-- U+00BF: "¿" INVERTED QUESTION MARK -->
|
<!-- U+00BF: "¿" INVERTED QUESTION MARK -->
|
||||||
<string name="more_keys_for_question">\?,¿</string>
|
<string name="more_keys_for_question">?,¿</string>
|
||||||
<string name="more_keys_for_symbols_semicolon">;</string>
|
<string name="more_keys_for_symbols_semicolon">;</string>
|
||||||
<!-- U+2030: "‰" PER MILLE SIGN -->
|
<!-- U+2030: "‰" PER MILLE SIGN -->
|
||||||
<string name="more_keys_for_symbols_percent">\\%,‰</string>
|
<string name="more_keys_for_symbols_percent">\\%,‰</string>
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
<!-- U+061F: "؟" ARABIC QUESTION MARK
|
<!-- U+061F: "؟" ARABIC QUESTION MARK
|
||||||
U+060C: "،" ARABIC COMMA
|
U+060C: "،" ARABIC COMMA
|
||||||
U+061B: "؛" ARABIC SEMICOLON -->
|
U+061B: "؛" ARABIC SEMICOLON -->
|
||||||
<string name="more_keys_for_punctuation">"!fixedColumnOrder!8,\",\',#,-,:,!,،,؟,\@,&,\\%,+,؛,/,!text/keyspec_left_parenthesis,!text/keyspec_right_parenthesis"</string>
|
<string name="more_keys_for_punctuation">"!fixedColumnOrder!8,\",\',#,-,:,!,،,؟,@,&,\\%,+,؛,/,!text/keyspec_left_parenthesis,!text/keyspec_right_parenthesis"</string>
|
||||||
<!-- U+266A: "♪" EIGHTH NOTE -->
|
<!-- U+266A: "♪" EIGHTH NOTE -->
|
||||||
<string name="more_keys_for_bullet">♪</string>
|
<string name="more_keys_for_bullet">♪</string>
|
||||||
<!-- U+2605: "★" BLACK STAR
|
<!-- U+2605: "★" BLACK STAR
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<!-- U+0966: "०" DEVANAGARI DIGIT ZERO -->
|
<!-- U+0966: "०" DEVANAGARI DIGIT ZERO -->
|
||||||
<string name="keylabel_for_symbols_0">०</string>
|
<string name="keylabel_for_symbols_0">०</string>
|
||||||
<!-- Label for "switch to symbols" key. -->
|
<!-- Label for "switch to symbols" key. -->
|
||||||
<string name="label_to_symbol_key">\?१२३</string>
|
<string name="label_to_symbol_key">?१२३</string>
|
||||||
<!-- Label for "switch to symbols with microphone" key. This string shouldn't include the "mic"
|
<!-- Label for "switch to symbols with microphone" key. This string shouldn't include the "mic"
|
||||||
part because it'll be appended by the code. -->
|
part because it'll be appended by the code. -->
|
||||||
<string name="label_to_symbol_with_microphone_key">१२३</string>
|
<string name="label_to_symbol_with_microphone_key">१२३</string>
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<!-- U+0966: "०" DEVANAGARI DIGIT ZERO -->
|
<!-- U+0966: "०" DEVANAGARI DIGIT ZERO -->
|
||||||
<string name="keylabel_for_symbols_0">०</string>
|
<string name="keylabel_for_symbols_0">०</string>
|
||||||
<!-- Label for "switch to symbols" key. -->
|
<!-- Label for "switch to symbols" key. -->
|
||||||
<string name="label_to_symbol_key">\?१२३</string>
|
<string name="label_to_symbol_key">?१२३</string>
|
||||||
<!-- Label for "switch to symbols with microphone" key. This string shouldn't include the "mic"
|
<!-- Label for "switch to symbols with microphone" key. This string shouldn't include the "mic"
|
||||||
part because it'll be appended by the code. -->
|
part because it'll be appended by the code. -->
|
||||||
<string name="label_to_symbol_with_microphone_key">१२३</string>
|
<string name="label_to_symbol_with_microphone_key">१२३</string>
|
||||||
|
|
|
@ -83,8 +83,8 @@
|
||||||
<string name="more_keys_for_currency_dollar">¢,£,€,¥,₱</string>
|
<string name="more_keys_for_currency_dollar">¢,£,€,¥,₱</string>
|
||||||
<string name="keylabel_for_currency">$</string>
|
<string name="keylabel_for_currency">$</string>
|
||||||
<string name="more_keys_for_currency">$,¢,€,£,¥,₱</string>
|
<string name="more_keys_for_currency">$,¢,€,£,¥,₱</string>
|
||||||
<string name="more_keys_for_punctuation">"!fixedColumnOrder!8,;,/,!text/keyspec_left_parenthesis,!text/keyspec_right_parenthesis,#,!,\\,,\?,&,\\%,+,\",-,:,',\@"</string>
|
<string name="more_keys_for_punctuation">"!fixedColumnOrder!8,;,/,!text/keyspec_left_parenthesis,!text/keyspec_right_parenthesis,#,!,\\,,?,&,\\%,+,\",-,:,',@"</string>
|
||||||
<string name="more_keys_for_tablet_punctuation">"!fixedColumnOrder!7,;,/,!text/keyspec_left_parenthesis,!text/keyspec_right_parenthesis,#,',\\,,&,\\%,+,\",-,:,\@"</string>
|
<string name="more_keys_for_tablet_punctuation">"!fixedColumnOrder!7,;,/,!text/keyspec_left_parenthesis,!text/keyspec_right_parenthesis,#,',\\,,&,\\%,+,\",-,:,@"</string>
|
||||||
<!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE -->
|
<!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE -->
|
||||||
<string name="keylabel_for_spanish_row2_10">ñ</string>
|
<string name="keylabel_for_spanish_row2_10">ñ</string>
|
||||||
<!-- U+2020: "†" DAGGER
|
<!-- U+2020: "†" DAGGER
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
<string name="keylabel_for_symbols_9">9</string>
|
<string name="keylabel_for_symbols_9">9</string>
|
||||||
<string name="keylabel_for_symbols_0">0</string>
|
<string name="keylabel_for_symbols_0">0</string>
|
||||||
<!-- Label for "switch to symbols" key. -->
|
<!-- Label for "switch to symbols" key. -->
|
||||||
<string name="label_to_symbol_key">\?123</string>
|
<string name="label_to_symbol_key">?123</string>
|
||||||
<!-- Label for "switch to symbols with microphone" key. This string shouldn't include the "mic"
|
<!-- Label for "switch to symbols with microphone" key. This string shouldn't include the "mic"
|
||||||
part because it'll be appended by the code. -->
|
part because it'll be appended by the code. -->
|
||||||
<string name="label_to_symbol_with_microphone_key">123</string>
|
<string name="label_to_symbol_with_microphone_key">123</string>
|
||||||
|
@ -189,7 +189,7 @@
|
||||||
<string name="keylabel_for_tablet_period">.</string>
|
<string name="keylabel_for_tablet_period">.</string>
|
||||||
<string name="keyhintlabel_for_tablet_period"></string>
|
<string name="keyhintlabel_for_tablet_period"></string>
|
||||||
<string name="more_keys_for_tablet_period">!text/more_keys_for_tablet_punctuation</string>
|
<string name="more_keys_for_tablet_period">!text/more_keys_for_tablet_punctuation</string>
|
||||||
<string name="keylabel_for_symbols_question">\?</string>
|
<string name="keylabel_for_symbols_question">?</string>
|
||||||
<string name="keylabel_for_symbols_semicolon">;</string>
|
<string name="keylabel_for_symbols_semicolon">;</string>
|
||||||
<string name="keylabel_for_symbols_percent">%</string>
|
<string name="keylabel_for_symbols_percent">%</string>
|
||||||
<!-- U+00A1: "¡" INVERTED EXCLAMATION MARK -->
|
<!-- U+00A1: "¡" INVERTED EXCLAMATION MARK -->
|
||||||
|
@ -205,11 +205,11 @@
|
||||||
<string name="keylabel_for_w">w</string>
|
<string name="keylabel_for_w">w</string>
|
||||||
<string name="keylabel_for_y">y</string>
|
<string name="keylabel_for_y">y</string>
|
||||||
<string name="keylabel_for_x">x</string>
|
<string name="keylabel_for_x">x</string>
|
||||||
<string name="more_keys_for_am_pm">!fixedColumnOrder!2,!hasLabels!,\@string/label_time_am,\@string/label_time_pm</string>
|
<string name="more_keys_for_am_pm">!fixedColumnOrder!2,!hasLabels!,!text/label_time_am,!text/label_time_pm</string>
|
||||||
<string name="settings_as_more_key">!icon/settings_key|!code/key_settings</string>
|
<string name="settings_as_more_key">!icon/settings_key|!code/key_settings</string>
|
||||||
<string name="shortcut_as_more_key">!icon/shortcut_key|!code/key_shortcut</string>
|
<string name="shortcut_as_more_key">!icon/shortcut_key|!code/key_shortcut</string>
|
||||||
<string name="action_next_as_more_key">!hasLabels!,\@string/label_next_key|!code/key_action_next</string>
|
<string name="action_next_as_more_key">!hasLabels!,!text/label_next_key|!code/key_action_next</string>
|
||||||
<string name="action_previous_as_more_key">!hasLabels!,\@string/label_previous_key|!code/key_action_previous</string>
|
<string name="action_previous_as_more_key">!hasLabels!,!text/label_previous_key|!code/key_action_previous</string>
|
||||||
<!-- Label for "switch to more symbol" modifier key ("= \ <"). Must be short to fit on key! -->
|
<!-- Label for "switch to more symbol" modifier key ("= \ <"). Must be short to fit on key! -->
|
||||||
<string name="label_to_more_symbol_key">= \\\\ <</string>
|
<string name="label_to_more_symbol_key">= \\\\ <</string>
|
||||||
<!-- Label for "switch to more symbol" modifier key on tablets. Must be short to fit on key! -->
|
<!-- Label for "switch to more symbol" modifier key on tablets. Must be short to fit on key! -->
|
||||||
|
|
|
@ -29,6 +29,7 @@ import java.util.Comparator;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.jar.JarFile;
|
import java.util.jar.JarFile;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class MoreKeysResources {
|
public class MoreKeysResources {
|
||||||
private static final String TEXT_RESOURCE_NAME = "donottranslate-more-keys.xml";
|
private static final String TEXT_RESOURCE_NAME = "donottranslate-more-keys.xml";
|
||||||
|
@ -287,23 +288,7 @@ public class MoreKeysResources {
|
||||||
sb.append(String.format("\\u%04X", (int)c));
|
sb.append(String.format("\\u%04X", (int)c));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return replaceIncompatibleEscape(sb.toString());
|
return sb.toString();
|
||||||
}
|
|
||||||
|
|
||||||
private static String replaceIncompatibleEscape(final String text) {
|
|
||||||
String t = text;
|
|
||||||
t = replaceAll(t, "\\?", "?");
|
|
||||||
t = replaceAll(t, "\\@", "@");
|
|
||||||
t = replaceAll(t, "@string/", "!text/");
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String replaceAll(final String text, final String target, final String replace) {
|
|
||||||
String t = text;
|
|
||||||
while (t.indexOf(target) >= 0) {
|
|
||||||
t = t.replace(target, replace);
|
|
||||||
}
|
|
||||||
return t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void close(final Closeable stream) {
|
private static void close(final Closeable stream) {
|
||||||
|
|
Loading…
Reference in New Issue