Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76dca164 authored by Mihai Nita's avatar Mihai Nita Committed by android-build-merger
Browse files

Merge "Framework: change the TTS text to use the current locale" into nyc-dev

am: 344bd5c6

* commit '344bd5c6':
  Framework: change the TTS text to use the current locale

Change-Id: I1c6148c1cbcd25e20bb75d4084d6d81420da0d48
parents ff54c9ee 344bd5c6
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -126,12 +126,18 @@ public class LocaleStore {
            return mFullCountryNameNative;
            return mFullCountryNameNative;
        }
        }


        String getFullCountryNameInUiLanguage() {
            // We don't cache the UI name because the default locale keeps changing
            return LocaleHelper.getDisplayCountry(mLocale);
        }

        /** Returns the name of the locale in the language of the UI.
        /** Returns the name of the locale in the language of the UI.
         * It is used for search, but never shown.
         * It is used for search, but never shown.
         * For instance German will show as "Deutsch" in the list, but we will also search for
         * For instance German will show as "Deutsch" in the list, but we will also search for
         * "allemand" if the system UI is in French.
         * "allemand" if the system UI is in French.
         */
         */
        public String getFullNameInUiLanguage() {
        public String getFullNameInUiLanguage() {
            // We don't cache the UI name because the default locale keeps changing
            return LocaleHelper.getDisplayName(mLocale, true /* sentence case */);
            return LocaleHelper.getDisplayName(mLocale, true /* sentence case */);
        }
        }


@@ -154,6 +160,14 @@ public class LocaleStore {
            }
            }
        }
        }


        String getContentDescription(boolean countryMode) {
            if (countryMode) {
                return getFullCountryNameInUiLanguage();
            } else {
                return getFullNameInUiLanguage();
            }
        }

        public boolean getChecked() {
        public boolean getChecked() {
            return mIsChecked;
            return mIsChecked;
        }
        }
+1 −0
Original line number Original line Diff line number Diff line
@@ -159,6 +159,7 @@ public class SuggestedLocaleAdapter extends BaseAdapter implements Filterable {
                LocaleStore.LocaleInfo item = (LocaleStore.LocaleInfo) getItem(position);
                LocaleStore.LocaleInfo item = (LocaleStore.LocaleInfo) getItem(position);
                text.setText(item.getLabel(mCountryMode));
                text.setText(item.getLabel(mCountryMode));
                text.setTextLocale(item.getLocale());
                text.setTextLocale(item.getLocale());
                text.setContentDescription(item.getContentDescription(mCountryMode));
                if (mCountryMode) {
                if (mCountryMode) {
                    int layoutDir = TextUtils.getLayoutDirectionFromLocale(item.getParent());
                    int layoutDir = TextUtils.getLayoutDirectionFromLocale(item.getParent());
                    //noinspection ResourceType
                    //noinspection ResourceType