Lines Matching refs:locale
23 import java.util.Locale;
50 * locales. The user can select a locale and apply it or it can create or remove
51 * a custom locale.
65 /** Menu item id for applying a locale */
67 /** Menu item id for removing a custom locale */
72 /** Textview used to display current locale */
134 String locale = data.getExtras().getString(NewLocaleDialog.INTENT_EXTRA_LOCALE);
135 if (locale != null && locale.length() > 0) {
136 // Get current custom locale list
141 customLocales = locale;
143 customLocales += CUSTOM_LOCALES_SEP + locale;
153 getString(R.string.added_custom_locale_1s, locale),
161 checkLocaleInList(locale);
164 changeSystemLocale(locale);
185 menu.setHeaderTitle("System Locale");
188 menu.setHeaderTitle("Custom Locale");
215 for (String locale : locales) {
216 if (locale != null && locale.length() > 0) {
217 Locale loc = new Locale(locale);
218 data.add(new LocaleInfo(locale, loc.getDisplayName()));
228 for (String locale : customLocales.split(CUSTOM_LOCALES_SEP)) {
229 if (locale != null && locale.length() > 0) {
230 Locale loc = new Locale(locale);
232 locale,
253 private void changeSystemLocale(String locale) {
254 if (ChangeLocale.changeSystemLocale(locale)) {
256 getString(R.string.select_locale_1s, locale),
267 if (config.locale != null) {
269 config.locale.toString(),
270 config.locale.getDisplayName());
273 checkLocaleInList(config.locale.toString());
277 Log.e(TAG, "get current locale failed", e);
282 /** Find the locale by code to select it in the list view */
283 private void checkLocaleInList(String locale) {
289 if (code != null && code.equals(locale)) {
314 /** Update the Select/Remove buttons based on the currently checked locale. */
323 // Enable the remove button only for custom locales and set the tag to the locale
350 * Creates a dialog to ask for confirmation before actually remove the custom locale.
380 // Get current custom locale list
389 for (String locale : oldLocales.split(CUSTOM_LOCALES_SEP)) {
390 if (locale != null && locale.length() > 0 && !locale.equals(localeToRemove)) {
394 sb.append(locale);
424 public LocaleInfo(String locale, String displayName, boolean isCustom) {
425 mLocale = locale;
430 public LocaleInfo(String locale, String displayName) {
431 this(locale, displayName, false /*custom*/);