Home | History | Annotate | Download | only in customlocale2

Lines Matching refs:locale

28  * Broadcast receiver that can change the system's locale.

31 * to easily trigger a locale change on an emulator as such:
34 * --es com.android.intent.extra.LOCALE en_US
44 /** An extra String that specifies the locale to set, in the form "en_US". */
45 public static final String EXTRA_LOCALE = "com.android.intent.extra.LOCALE";
57 String locale = intent.getStringExtra(EXTRA_LOCALE);
59 // Enforce the locale string is either in the form "ab" or "ab_cd"
60 boolean is_ok = locale != null;
61 is_ok = is_ok && (locale.length() == 2 || locale.length() == 5);
62 if (is_ok && locale.length() >= 2) {
63 is_ok = Character.isLetter(locale.charAt(0)) &&
64 Character.isLetter(locale.charAt(1));
66 if (is_ok && locale.length() == 5) {
67 is_ok = locale.charAt(2) == '_' &&
68 Character.isLetter(locale.charAt(3)) &&
69 Character.isLetter(locale.charAt(4));
73 Log.e(TAG, "Invalid locale: expected ab_CD but got " + locale);
75 ChangeLocale.changeSystemLocale(locale);
76 setResult(Activity.RESULT_OK, locale, null);