This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
shell/platform/android/io/flutter/plugin/localization Expand file tree Collapse file tree 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) {
188188 localizationChannel .sendLocales (locales );
189189 }
190190
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+ */
192196 @ NonNull
193197 public static Locale localeFromString (@ NonNull String localeString ) {
194198 // Use Locale.forLanguageTag if available (API 21+).
@@ -201,11 +205,6 @@ public static Locale localeFromString(@NonNull String localeString) {
201205 // Pre-API 21, we fall back to manually parsing the locale tag.
202206 String parts [] = localeString .split ("-" , -1 );
203207
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-
209208 // Assume the first part is always the language code.
210209 String languageCode = parts [0 ];
211210 String scriptCode = "" ;
You can’t perform that action at this time.
0 commit comments