/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/ |
D | DictionaryInfoUtils.java | 83 public DictionaryInfo(@Nonnull String id, @Nonnull Locale locale, in DictionaryInfo() argument 87 mLocale = locale; in DictionaryInfo() 243 public static String getCacheDirectoryForLocale(final String locale, final Context context) { 244 final String relativeDirectoryName = replaceFileNameDangerousCharacters(locale); 250 Log.e(TAG, "Could not create the directory for locale" + locale); 271 public static String getCacheFileName(String id, String locale, Context context) { 273 return getCacheDirectoryForLocale(locale, context) + File.separator + fileName; 276 public static String getStagingFileName(String id, String locale, Context context) { 287 locale + TEMP_DICT_FILE_SUB + id); 310 final String locale = localeAndFileId[0]; [all …]
|
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ |
D | LocaleSet.java | 52 static boolean isLanguageChinese(@Nullable Locale locale) { in isLanguageChinese() argument 53 return locale != null && "zh".equals(locale.getLanguage()); in isLanguageChinese() 57 static boolean isLanguageJapanese(@Nullable Locale locale) { in isLanguageJapanese() argument 58 return locale != null && "ja".equals(locale.getLanguage()); in isLanguageJapanese() 62 static boolean isLanguageKorean(@Nullable Locale locale) { in isLanguageKorean() argument 63 return locale != null && "ko".equals(locale.getLanguage()); in isLanguageKorean() 67 static boolean isLocaleCJK(@Nullable Locale locale) { in isLocaleCJK() argument 68 return isLanguageChinese(locale) || in isLocaleCJK() 69 isLanguageJapanese(locale) || in isLocaleCJK() 70 isLanguageKorean(locale); in isLocaleCJK() [all …]
|
/packages/apps/Settings/src/com/android/settings/inputmethod/ |
D | UserDictionaryListPreferenceController.java | 56 public void setLocale(String locale) { in setLocale() argument 57 mLocale = locale; in setLocale() 93 final String locale = cursor.getString(columnIndex); in getUserDictionaryLocalesSet() local 94 localeSet.add(null != locale ? locale : ""); in getUserDictionaryLocalesSet() 116 final String locale = subtype.getLocale(); in getUserDictionaryLocalesSet() local 117 if (!TextUtils.isEmpty(locale)) { in getUserDictionaryLocalesSet() 118 localeSet.add(locale); in getUserDictionaryLocalesSet() 176 for (String locale : localeSet) { in createUserDictSettings() 177 final Preference pref = createUserDictionaryPreference(locale); in createUserDictSettings() 191 private Preference createUserDictionaryPreference(String locale) { in createUserDictionaryPreference() argument [all …]
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/inputmethod/ |
D | UserDictionaryListPreferenceController.java | 56 public void setLocale(String locale) { in setLocale() argument 57 mLocale = locale; in setLocale() 93 final String locale = cursor.getString(columnIndex); in getUserDictionaryLocalesSet() local 94 localeSet.add(null != locale ? locale : ""); in getUserDictionaryLocalesSet() 116 final String locale = subtype.getLocale(); in getUserDictionaryLocalesSet() local 117 if (!TextUtils.isEmpty(locale)) { in getUserDictionaryLocalesSet() 118 localeSet.add(locale); in getUserDictionaryLocalesSet() 176 for (String locale : localeSet) { in createUserDictSettings() 177 final Preference pref = createUserDictionaryPreference(locale); in createUserDictSettings() 191 private Preference createUserDictionaryPreference(String locale) { in createUserDictionaryPreference() argument [all …]
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/spellcheck/ |
D | AndroidSpellCheckerService.java | 107 private static String getKeyboardLayoutNameForLocale(final Locale locale) { in getKeyboardLayoutNameForLocale() argument 109 if (locale.getLanguage().equals("sr")) { in getKeyboardLayoutNameForLocale() 112 final int script = ScriptUtils.getScriptFromSpellCheckerLocale(locale); in getKeyboardLayoutNameForLocale() 160 public boolean isValidWord(final Locale locale, final String word) { in isValidWord() argument 164 mDictionaryFacilitatorCache.get(locale); in isValidWord() 171 public SuggestionResults getSuggestionResults(final Locale locale, in getSuggestionResults() argument 179 mDictionaryFacilitatorCache.get(locale); in getSuggestionResults() 191 public boolean hasMainDictionaryForLocale(final Locale locale) { in hasMainDictionaryForLocale() argument 195 mDictionaryFacilitatorCache.get(locale); in hasMainDictionaryForLocale() 214 public Keyboard getKeyboardForLocale(final Locale locale) { in getKeyboardForLocale() argument [all …]
|
/packages/apps/Contacts/src/com/android/contacts/datepicker/ |
D | TwoDigitFormatter.java | 26 final Locale locale = Locale.getDefault(); in TwoDigitFormatter() local 27 init(locale); in TwoDigitFormatter() 30 private void init(Locale locale) { in init() argument 31 mFmt = createFormatter(locale); in init() 32 mZeroDigit = getZeroDigit(locale); in init() 46 private static char getZeroDigit(Locale locale) { in getZeroDigit() argument 49 return DecimalFormatSymbols.getInstance(locale).getZeroDigit(); in getZeroDigit() 52 private java.util.Formatter createFormatter(Locale locale) { in createFormatter() argument 53 return new java.util.Formatter(mBuilder, locale); in createFormatter()
|
/packages/inputmethods/LatinIME/tools/make-keyboard-text/src/com/android/inputmethod/keyboard/tools/ |
D | MoreKeysResources.java | 76 for (final String locale : mResourcesMap.keySet()) { in MoreKeysResources() 77 final StringResourceMap resMap = mResourcesMap.get(locale); in MoreKeysResources() 81 throw new RuntimeException(res.mName + " in " + locale in MoreKeysResources() 169 private static String getArrayNameForLocale(final Locale locale) { in getArrayNameForLocale() argument 170 return TEXTS_ARRAY_NAME_PREFIX + LocaleUtils.getLocaleCode(locale); in getArrayNameForLocale() 175 final Locale locale = resMap.mLocale; in dumpTexts() local 178 locale, LocaleUtils.getLocaleDisplayName(locale)); in dumpTexts() 179 out.format(" private static final String[] " + getArrayNameForLocale(locale) in dumpTexts() 189 final Locale locale = resMap.mLocale; in dumpLocalesMap() local 190 final String localeStr = LocaleUtils.getLocaleCode(locale); in dumpLocalesMap() [all …]
|
D | LocaleUtils.java | 91 final Locale locale = builder.build(); in constructLocaleFromString() local 92 sLocaleCache.put(localeStr, locale); in constructLocaleFromString() 93 return locale; in constructLocaleFromString() 151 public static String getLocaleCode(final Locale locale) { in getLocaleCode() argument 152 if (locale == DEFAULT_LOCALE) { in getLocaleCode() 155 return locale.toString(); in getLocaleCode() 158 public static String getLocaleDisplayName(final Locale locale) { in getLocaleDisplayName() argument 159 if (locale == DEFAULT_LOCALE) { in getLocaleDisplayName() 162 if (locale.getLanguage().equals(NO_LANGUAGE_LOCALE_CODE)) { in getLocaleDisplayName() 165 return locale.getDisplayName(Locale.ENGLISH); in getLocaleDisplayName()
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/ |
D | DictionaryFactory.java | 47 final Locale locale) { in createMainDictionaryFromManager() argument 48 if (null == locale) { in createMainDictionaryFromManager() 50 return new DictionaryCollection(Dictionary.TYPE_MAIN, locale, in createMainDictionaryFromManager() 51 createReadOnlyBinaryDictionary(context, locale)); in createMainDictionaryFromManager() 56 BinaryDictionaryGetter.getDictionaryFiles(locale, context, true); in createMainDictionaryFromManager() 61 false /* useFullEditDistance */, locale, Dictionary.TYPE_MAIN); in createMainDictionaryFromManager() 75 return new DictionaryCollection(Dictionary.TYPE_MAIN, locale, dictList); in createMainDictionaryFromManager() 128 final Locale locale) { in createReadOnlyBinaryDictionary() argument 132 context.getResources(), locale); in createReadOnlyBinaryDictionary() 147 false /* useFullEditDistance */, locale, Dictionary.TYPE_MAIN); in createReadOnlyBinaryDictionary()
|
D | DictionaryFacilitatorImpl.java | 103 public boolean isForLocale(final Locale locale) { in isForLocale() argument 104 return locale != null && locale.equals(mDictionaryGroup.mLocale); in isForLocale() 153 public DictionaryGroup(@Nullable final Locale locale, in DictionaryGroup() argument 157 mLocale = locale; in DictionaryGroup() 252 final Context context, final Locale locale, final File dictFile, in getSubDict() argument 263 new Object[] { context, locale, dictFile, dictNamePrefix, account }); in getSubDict() 274 final Locale locale) { in findDictionaryGroupWithLocale() argument 275 return locale.equals(dictionaryGroup.mLocale) ? dictionaryGroup : null; in findDictionaryGroupWithLocale() 382 final Locale locale, final DictionaryInitializationListener listener) { in asyncReloadUninitializedMainDictionaries() argument 389 context, locale, listener, latchForWaitingLoadingMainDictionary); in asyncReloadUninitializedMainDictionaries() [all …]
|
D | BinaryDictionaryGetter.java | 166 public static File[] getCachedWordLists(final String locale, final Context context) { in getCachedWordLists() argument 174 final int matchLevel = LocaleUtils.getMatchLevel(dirLocale, locale); in getCachedWordLists() 242 public static ArrayList<AssetFileAddress> getDictionaryFiles(final Locale locale, in getDictionaryFiles() argument 246 context, locale); in getDictionaryFiles() 252 locale, context, hasDefaultWordList); in getDictionaryFiles() 257 final File[] cachedWordLists = getCachedWordLists(locale.toString(), context); in getDictionaryFiles() 258 final String mainDictId = DictionaryInfoUtils.getMainDictId(locale); in getDictionaryFiles() 275 Log.e(TAG, "Found a cached dictionary file for " + locale.toString() in getDictionaryFiles() 282 DictionaryInfoUtils.getMainDictionaryResourceId(context.getResources(), locale); in getDictionaryFiles()
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/personalization/ |
D | UserHistoryDictionary.java | 47 UserHistoryDictionary(final Context context, final Locale locale, in UserHistoryDictionary() argument 49 …super(context, getUserHistoryDictName(NAME, locale, null /* dictFile */, account), locale, Diction… in UserHistoryDictionary() 59 static String getUserHistoryDictName(final String name, final Locale locale, in getUserHistoryDictName() argument 62 return getDictName(name, locale, dictFile); in getUserHistoryDictName() 64 return getUserHistoryDictNamePerAccount(name, locale, dictFile, account); in getUserHistoryDictName() 70 private static String getUserHistoryDictNamePerAccount(final String name, final Locale locale, in getUserHistoryDictNamePerAccount() argument 75 String dictName = name + "." + locale.toString(); in getUserHistoryDictNamePerAccount() 85 public static UserHistoryDictionary getDictionary(final Context context, final Locale locale, in getDictionary() argument 87 return PersonalizationHelper.getUserHistoryDictionary(context, locale, account); in getDictionary()
|
/packages/apps/Messaging/src/com/android/messaging/util/ |
D | Dates.java | 109 context.getResources().getConfiguration().locale, false /*abbreviated*/, in getMessageDetailsTimeString() 123 context.getResources().getConfiguration().locale, flags, minPeriodToday); in getTimeString() 128 final boolean abbreviated, final Locale locale, final int flags, in getTimestamp() argument 139 return getThisWeekTimestamp(time, locale, abbreviated, flags); in getTimestamp() 141 return getThisYearTimestamp(time, locale, abbreviated, flags); in getTimestamp() 143 return getOlderThanAYearTimestamp(time, locale, abbreviated, flags); in getTimestamp() 178 final Locale locale, final boolean abbreviated, final int flags) { in getThisWeekTimestamp() argument 184 if (locale.equals(Locale.US)) { in getThisWeekTimestamp() 195 private static CharSequence getThisYearTimestamp(final long time, final Locale locale, in getThisYearTimestamp() argument 203 if (locale.equals(Locale.US)) { in getThisYearTimestamp() [all …]
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/keyboard/layout/expected/ |
D | ExpectedKey.java | 147 public ExpectedKey toUpperCase(Locale locale) { in toUpperCase() argument 148 return newInstance(mVisual.toUpperCase(locale), mOutput.toUpperCase(locale)); in toUpperCase() 222 public ExpectedAdditionalMoreKey toUpperCase(final Locale locale) { in toUpperCase() argument 223 final ExpectedKey upperCaseKey = super.toUpperCase(locale); in toUpperCase() 242 public ExpectedKey toUpperCase(final Locale locale) { in toUpperCase() argument 245 upperCaseMoreKeys[i] = mMoreKeys[i].toUpperCase(locale); in toUpperCase() 247 return newInstance(getVisual().toUpperCase(locale), getOutput().toUpperCase(locale), in toUpperCase() 347 public ExpectedKey toUpperCase(final Locale locale) { in toUpperCase() argument 351 upperCaseMoreKeys[i] = moreKeys[i].toUpperCase(locale); in toUpperCase() 356 upperCaseAdditionalMoreKeys[i] = mAdditionalMoreKeys[i].toUpperCase(locale); in toUpperCase() [all …]
|
/packages/inputmethods/LatinIME/common/src/com/android/inputmethod/latin/common/ |
D | StringUtils.java | 202 @Nonnull final Locale locale) { in capitalizeFirstCodePoint() argument 204 return s.toUpperCase(getLocaleUsedForToTitleCase(locale)); in capitalizeFirstCodePoint() 209 return s.substring(0, cutoff).toUpperCase(getLocaleUsedForToTitleCase(locale)) in capitalizeFirstCodePoint() 215 @Nonnull final Locale locale) { in capitalizeFirstAndDowncaseRest() argument 217 return s.toUpperCase(getLocaleUsedForToTitleCase(locale)); in capitalizeFirstAndDowncaseRest() 227 return s.substring(0, cutoff).toUpperCase(getLocaleUsedForToTitleCase(locale)) in capitalizeFirstAndDowncaseRest() 228 + s.substring(cutoff).toLowerCase(locale); in capitalizeFirstAndDowncaseRest() 405 @Nonnull final int[] sortedSeparators, @Nonnull final Locale locale) { in capitalizeEachWord() argument 412 builder.append(nextChar.toUpperCase(locale)); in capitalizeEachWord() 414 builder.append(nextChar.toLowerCase(locale)); in capitalizeEachWord() [all …]
|
D | LocaleUtils.java | 178 final Locale locale; in constructLocaleFromString() local 180 locale = new Locale(elements[0] /* language */); in constructLocaleFromString() 182 locale = new Locale(elements[0] /* language */, elements[1] /* country */); in constructLocaleFromString() 184 locale = new Locale(elements[0] /* language */, elements[1] /* country */, in constructLocaleFromString() 187 sLocaleCache.put(localeString, locale); in constructLocaleFromString() 188 return locale; in constructLocaleFromString() 207 public static boolean isRtlLanguage(@Nonnull final Locale locale) { in isRtlLanguage() argument 208 return sRtlLanguageCodes.contains(locale.getLanguage()); in isRtlLanguage()
|
/packages/inputmethods/LatinIME/tools/make-keyboard-text/res/src/com/android/inputmethod/keyboard/internal/ |
D | KeyboardTextsTable.tmpl | 32 * tools/make-keyboard-text/res/values-<locale>/donottranslate-more-keys.xml 49 // Texts table to locale maps. 55 throw new RuntimeException("Unknown text name=" + name + " locale=" 69 + " locale=" + sTextsTableToLocaleMap.get(textsTable)); 72 public static String[] getTextsTable(final Locale locale) { 73 final String localeKey = locale.toString(); 77 final String languageKey = locale.getLanguage(); 98 // "locale", TEXT_ARRAY, /* numberOfNonNullText/lengthOf_TEXT_ARRAY localeName */ 108 final String locale = (String)LOCALES_AND_TEXTS[i]; 110 sLocaleToTextsTableMap.put(locale, textsTable); [all …]
|
/packages/inputmethods/LatinIME/native/jni/src/suggest/core/layout/ |
D | additional_proximity_chars.h | 43 AK_FORCE_INLINE static bool isEnLocale(const std::vector<int> *locale) { in isEnLocale() argument 45 if (locale->size() < NCHARS) { in isEnLocale() 49 if ((*locale)[i] != LOCALE_EN_US[i]) { in isEnLocale() 57 static int getAdditionalCharsSize(const std::vector<int> *locale, const int c) { in getAdditionalCharsSize() argument 58 if (!isEnLocale(locale)) { in getAdditionalCharsSize() 77 static const int *getAdditionalChars(const std::vector<int> *locale, const int c) { in getAdditionalChars() argument 78 if (!isEnLocale(locale)) { in getAdditionalChars()
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/common/ |
D | StringUtilsTests.java | 39 private static void assert_toTitleCaseOfKeyLabel(final Locale locale, in assert_toTitleCaseOfKeyLabel() argument 41 assertEquals(lowerCase + " in " + locale, expected, in assert_toTitleCaseOfKeyLabel() 42 StringUtils.toTitleCaseOfKeyLabel(lowerCase, locale)); in assert_toTitleCaseOfKeyLabel() 122 private static void assert_toTitleCaseOfKeyCode(final Locale locale, final int lowerCase, in assert_toTitleCaseOfKeyCode() argument 124 assertEquals(lowerCase + " in " + locale, expected, in assert_toTitleCaseOfKeyCode() 125 StringUtils.toTitleCaseOfKeyCode(lowerCase, locale)); in assert_toTitleCaseOfKeyCode() 155 private static void assert_capitalizeFirstCodePoint(final Locale locale, final String text, in assert_capitalizeFirstCodePoint() argument 157 assertEquals(text + " in " + locale, expected, in assert_capitalizeFirstCodePoint() 158 StringUtils.capitalizeFirstCodePoint(text, locale)); in assert_capitalizeFirstCodePoint() 175 private static void assert_capitalizeFirstAndDowncaseRest(final Locale locale, in assert_capitalizeFirstAndDowncaseRest() argument [all …]
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/keyboard/internal/ |
D | KeyboardTextsSetTests.java | 75 final Locale locale = SubtypeLocaleUtils.getSubtypeLocale(subtype); in testSwitchToAlphaKeyLabel() local 76 textsSet.setLocale(locale, context); in testSwitchToAlphaKeyLabel() 79 assertNotNull("Switch to alpha key label of " + locale, switchToAlphaKeyLabel); in testSwitchToAlphaKeyLabel() 80 assertFalse("Switch to alpha key label of " + locale, switchToAlphaKeyLabel.isEmpty()); in testSwitchToAlphaKeyLabel() 102 final Locale locale = SubtypeLocaleUtils.getSubtypeLocale(subtype); in testTextFromResources() local 103 textsSet.setLocale(locale, context); in testTextFromResources() 106 assertNotNull(name + " of " + locale, text); in testTextFromResources() 107 assertFalse(name + " of " + locale, text.isEmpty()); in testTextFromResources()
|
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/common/ |
D | LocaleTestUtils.java | 83 public void setLocale(Locale locale) { in setLocale() argument 88 mSavedContextLocale = setResourcesLocale(mContext.getResources(), locale); in setLocale() 89 mSavedSystemLocale = setResourcesLocale(Resources.getSystem(), locale); in setLocale() 114 private Locale setResourcesLocale(Resources resources, Locale locale) { in setResourcesLocale() argument 116 Locale savedLocale = contextConfiguration.locale; in setResourcesLocale() 117 contextConfiguration.locale = locale; in setResourcesLocale()
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/userdictionary/ |
D | UserDictionarySettings.java | 133 final String locale; in onActivityCreated() local 135 locale = localeFromArguments; in onActivityCreated() 137 locale = localeFromIntent; in onActivityCreated() 139 locale = null; in onActivityCreated() 142 mLocale = locale; in onActivityCreated() 148 mCursor = createCursor(locale); in onActivityCreated() 177 private Cursor createCursor(final String locale) { in createCursor() argument 188 if ("".equals(locale)) { in createCursor() 194 final String queryLocale = null != locale ? locale : Locale.getDefault().toString(); in createCursor() 217 final Locale systemLocale = getResources().getConfiguration().locale; in onCreateOptionsMenu()
|
D | UserDictionaryList.java | 70 final String locale = cursor.getString(columnIndex); in getUserDictionaryLocalesSet() local 71 localeSet.add(null != locale ? locale : ""); in getUserDictionaryLocalesSet() 91 final String locale = subtype.getLocale(); in getUserDictionaryLocalesSet() local 92 if (!TextUtils.isEmpty(locale)) { in getUserDictionaryLocalesSet() 93 localeSet.add(locale); in getUserDictionaryLocalesSet() 128 for (String locale : localeSet) { in createUserDictSettings() 129 userDictGroup.addPreference(createUserDictionaryPreference(locale)); in createUserDictSettings()
|
/packages/apps/Car/Settings/src/com/android/car/settings/tts/ |
D | TtsPlaybackPreferenceController.java | 256 private void updateLanguageTo(Locale locale) { in updateLanguageTo() argument 257 int selectedLocaleIndex = findLocaleIndex(locale); in updateLanguageTo() 263 if (mTtsPlaybackManager.updateTtsLocale(locale)) { in updateLanguageTo() 271 private int findLocaleIndex(Locale locale) { in findLocaleIndex() argument 272 String localeString = (locale != null) ? locale.toString() : ""; in findLocaleIndex() 345 Locale locale = mEnginesHelper.parseLocaleString(availableLangs.get(i)); in updateDefaultLanguagePreference() local 346 if (locale != null) { in updateDefaultLanguagePreference() 347 locales.add(locale); in updateDefaultLanguagePreference() 361 for (Locale locale : locales) { in updateDefaultLanguagePreference() 362 entries[i] = locale.getDisplayName(); in updateDefaultLanguagePreference() [all …]
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/compat/ |
D | UserDictionaryCompatUtils.java | 29 final int freq, final String shortcut, final Locale locale) { in addWord() argument 31 addWordWithShortcut(context, word, freq, shortcut, locale); in addWord() 35 final Locale currentLocale = context.getResources().getConfiguration().locale; in addWord() 36 final int localeType = currentLocale.equals(locale) in addWord() 45 final int freq, final String shortcut, final Locale locale) { in addWordWithShortcut() argument 46 UserDictionary.Words.addWord(context, word, freq, shortcut, locale); in addWordWithShortcut()
|