File tree 1 file changed +5
-6
lines changed
shell/platform/android/io/flutter/plugin/localization 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,11 @@ public void sendLocalesToFlutter(@NonNull Configuration config) {
188
188
localizationChannel .sendLocales (locales );
189
189
}
190
190
191
- @ VisibleForTesting
191
+ /**
192
+ * Computes the {@link Locale} from the provided {@code String} with format
193
+ * language[-script][-region][-...], where script is an alphabet string of length 4, and region is
194
+ * either an alphabet string of length 2 or a digit string of length 3.
195
+ */
192
196
@ NonNull
193
197
public static Locale localeFromString (@ NonNull String localeString ) {
194
198
// Use Locale.forLanguageTag if available (API 21+).
@@ -201,11 +205,6 @@ public static Locale localeFromString(@NonNull String localeString) {
201
205
// Pre-API 21, we fall back to manually parsing the locale tag.
202
206
String parts [] = localeString .split ("-" , -1 );
203
207
204
- // The format is:
205
- // language[-script][-region][-...]
206
- // where script is an alphabet string of length 4, and region is either an alphabet string of
207
- // length 2 or a digit string of length 3.
208
-
209
208
// Assume the first part is always the language code.
210
209
String languageCode = parts [0 ];
211
210
String scriptCode = "" ;
You can’t perform that action at this time.
0 commit comments