Skip to content

Commit bf05980

Browse files
committedJan 21, 2024
improve layout for gujarati, fixes #417
1 parent 8601b84 commit bf05980

File tree

3 files changed

+31
-33
lines changed

3 files changed

+31
-33
lines changed
 

‎app/src/main/assets/layouts/gujarati.json

+28-31
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
},
1919
{ "$": "shift_state_selector",
2020
"manualOrLocked": { "label": "" },
21-
"default": { "label": "" }
21+
"default": { "label": "" }
2222
},
2323
{ "$": "shift_state_selector",
2424
"manualOrLocked": { "label": "" },
25-
"default": { "label": "" }
25+
"default": { "label": "" }
2626
},
2727
{ "$": "shift_state_selector",
2828
"manualOrLocked": { "label": "" },
29-
"default": { "label": "" }
29+
"default": { "label": "" }
3030
},
3131
{ "$": "shift_state_selector",
3232
"manualOrLocked": { "label": "" },
33-
"default": { "label": "" }
33+
"default": { "label": "" }
3434
},
3535
{ "$": "shift_state_selector",
3636
"manualOrLocked": { "label": "" },
@@ -48,85 +48,82 @@
4848
[
4949
{ "$": "shift_state_selector",
5050
"manualOrLocked": { "label": "" },
51-
"default": { "label": "", "popup": { "main": { "label": "" } } }
51+
"default": { "label": "", "popup": { "main": { "label": "" } } }
5252
},
5353
{ "$": "shift_state_selector",
5454
"manualOrLocked": { "label": "" },
55-
"default": { "label": "", "popup": { "main": { "label": "" } } }
55+
"default": { "label": "", "popup": { "main": { "label": "" } } }
5656
},
5757
{ "$": "shift_state_selector",
5858
"manualOrLocked": { "label": "" },
59-
"default": { "label": "", "popup": { "main": { "label": "" } } }
59+
"default": { "label": "", "popup": { "main": { "label": "" } } }
6060
},
6161
{ "$": "shift_state_selector",
6262
"manualOrLocked": { "label": "" },
63-
"default": { "label": "", "popup": { "main": { "label": "" } } }
63+
"default": { "label": "", "popup": { "main": { "label": "" } } }
6464
},
6565
{ "$": "shift_state_selector",
6666
"manualOrLocked": { "label": "" },
67-
"default": { "label": "", "popup": { "main": { "label": "" } } }
67+
"default": { "label": "", "popup": { "main": { "label": "" } } }
6868
},
6969
{ "$": "shift_state_selector",
70-
"manualOrLocked": { "label": "ક્ષ" },
71-
"default": { "label": "", "popup": { "main": { "label": "" } } }
70+
"manualOrLocked": { "label": "ક્ષ", "labelFlags": 128 },
71+
"default": { "label": "", "popup": { "main": { "label": "" } } }
7272
},
7373
{ "$": "shift_state_selector",
74-
"manualOrLocked": { "label": "જ્ઞ" },
75-
"default": { "label": "", "popup": { "main": { "label": "" } } }
74+
"manualOrLocked": { "label": "જ્ઞ", "labelFlags": 128 },
75+
"default": { "label": "", "popup": { "main": { "label": "ત્ર" } } }
7676
},
7777
{ "$": "shift_state_selector",
7878
"manualOrLocked": { "label": "" },
79-
"default": { "label": "", "popup": { "main": { "label": "૿" } } }
79+
"default": { "label": "", "popup": { "main": { "label": "ત્ત" } } }
8080
},
8181
{ "$": "shift_state_selector",
8282
"manualOrLocked": { "label": "" },
83-
"default": { "label": "", "popup": { "main": { "label": "ત્ર" } } }
83+
"default": { "label": "", "popup": { "main": { "label": "દ્વ" } } }
8484
},
8585
{ "$": "shift_state_selector",
8686
"manualOrLocked": { "label": "" },
87-
"default": { "label": "", "popup": { "main": { "label": "શ્ર" } } }
87+
"default": { "label": "", "popup": { "main": { "label": "દ્ધ" } } }
8888
},
8989
{ "$": "shift_state_selector",
9090
"manualOrLocked": { "label": "" },
91-
"default": { "label": "", "popup": { "main": { "label": "શ્ર" } } }
91+
"default": { "label": "", "popup": { "main": { "label": "દ્ર" } } }
9292
}
9393
],
9494
[
9595
{ "$": "shift_state_selector",
9696
"manualOrLocked": { "label": "" },
97-
"default": { "label": "", "popup": { "main": { "label": "શ્વ" } } }
97+
"default": { "label": ""}
9898
},
9999
{ "$": "shift_state_selector",
100100
"manualOrLocked": { "label": "" },
101-
"default": { "label": "", "popup": { "main": { "label": "ત્ત" } } }
101+
"default": { "label": "", "popup": { "main": { "label": "શ્ર" } } }
102102
},
103103
{ "$": "shift_state_selector",
104104
"manualOrLocked": { "label": "" },
105-
"default": { "label": "", "popup": { "main": { "label": "દ્ર" } } }
105+
"default": { "label": "", "popup": { "main": { "label": "શ્વ" } } }
106106
},
107107
{ "$": "shift_state_selector",
108108
"manualOrLocked": { "label": "" },
109-
"default": { "label": "", "popup": { "main": { "label": "દ્વ" } } }
109+
"default": { "label": "", "popup": { "main": { "label": "દ્દ" } } }
110110
},
111111
{ "$": "shift_state_selector",
112112
"manualOrLocked": { "label": "" },
113-
"default": { "label": "", "popup": { "main": { "label": "દ્દ" } } }
113+
"default": { "label": "", "popup": { "main": { "label": "હ્ય" } } }
114114
},
115115
{ "$": "shift_state_selector",
116-
"manualOrLocked": { "label": "અં" },
117-
"default": { "label": "", "popup": { "main": { "label": "દ્ય" } } }
116+
"manualOrLocked": { "label": "અં", "labelFlags": 128 },
117+
"default": { "label": "", "popup": { "main": { "label": "" } } }
118118
},
119119
{ "$": "shift_state_selector",
120-
"manualOrLocked": { "label": "અઃ" },
121-
"default": { "label": "", "popup": { "main": { "label": "" } } }
120+
"manualOrLocked": { "label": "અઃ", "labelFlags": 128 },
121+
"default": { "label": "", "popup": { "main": { "label": "" } } }
122122
},
123123
{ "$": "shift_state_selector",
124124
"manualOrLocked": { "label": "" },
125-
"default": { "label": "", "popup": { "main": { "label": "" } } }
125+
"default": { "label": "", "popup": { "main": { "label": "" } } }
126126
},
127-
{ "$": "shift_state_selector",
128-
"manualOrLocked": { "label": "" },
129-
"default": { "label": "", "popup": { "main": { "label": "" } } }
130-
}
127+
{ "label": "", "popup": { "main": { "label": "" } } }
131128
]
132129
]

‎app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/keyboard_parser/LocaleKeyTexts.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class LocaleKeyTexts(dataStream: InputStream?, locale: Locale) {
6767
val colonSpaceRegex = ":\\s+".toRegex()
6868
reader.forEachLine { l ->
6969
val line = l.trim()
70+
if (line.isEmpty()) return@forEachLine
7071
when (line) {
7172
"[morekeys]" -> { mode = READER_MODE_MORE_KEYS; return@forEachLine }
7273
"[extra_keys]" -> { mode = READER_MODE_EXTRA_KEYS; return@forEachLine }
@@ -284,7 +285,7 @@ private fun getCurrencyKey(locale: Locale): Pair<String, Array<String>> {
284285
return genericCurrencyKey(getCurrency(locale))
285286
if (locale.country != "IN" && locale.language == "ta")
286287
return genericCurrencyKey("")
287-
if (locale.country == "IN" || locale.language.matches("hi|kn|ml|mr|ta|te".toRegex()))
288+
if (locale.country == "IN" || locale.language.matches("hi|kn|ml|mr|ta|te|gu".toRegex()))
288289
return rupee
289290
if (locale.country == "GB")
290291
return pound

‎app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/PreferencesSettingsFragment.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private void setLocalizedNumberRowVisibility() {
102102
final Preference pref = findPreference(Settings.PREF_LOCALIZED_NUMBER_ROW);
103103
if (pref == null) return;
104104
// locales that have a number row defined (not good to have it hardcoded, but reading a bunch of files may be noticeably slow)
105-
final String[] numberRowLocales = new String[] { "ar", "bn", "fa", "hi", "mr", "ne", "ur" };
105+
final String[] numberRowLocales = new String[] { "ar", "bn", "fa", "gu", "hi", "mr", "ne", "ur" };
106106
for (final InputMethodSubtype subtype : SubtypeSettingsKt.getEnabledSubtypes(getSharedPreferences(), true)) {
107107
if (ArraysKt.any(numberRowLocales, (l) -> l.equals(subtype.getLocale().substring(0, 2)))) {
108108
pref.setVisible(true);

0 commit comments

Comments
 (0)
Please sign in to comment.