From f53e034a174b473519c0a4755fb9440dc9ecbfcf Mon Sep 17 00:00:00 2001 From: Seigo Nonaka Date: Wed, 22 Jul 2020 14:08:35 -0700 Subject: [PATCH] =?UTF-8?q?Update=20language=20to=20comply=20with=20Androi?= =?UTF-8?q?d=E2=80=99s=20inclusive=20language=20guidance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://source.android.com/setup/contribute/respectful-code for reference Bug: 161896447 Test: tapas LatinIME && m Change-Id: I2ffb39ff70f61e579b62761d3da526a545dead1f --- java/res/xml-sw600dp/key_styles_common.xml | 2 +- java/res/xml/key_styles_common.xml | 2 +- java/res/xml/prefs_screen_accounts.xml | 2 +- .../dictionarypack/MetadataDbHelper.java | 2 +- .../com/android/inputmethod/event/Event.java | 2 +- .../inputmethod/keyboard/KeyboardView.java | 2 +- .../keyboard/internal/KeyboardTextsTable.java | 2 +- .../latin/BinaryDictionaryGetter.java | 6 ++-- .../inputmethod/latin/InputAttributes.java | 2 +- .../latin/RichInputMethodSubtype.java | 30 +++++++++---------- .../latin/about/AboutPreferences.java | 2 +- .../latin/inputlogic/InputLogic.java | 4 +-- .../settings/CustomInputStylePreference.java | 2 +- .../latin/utils/CapsModeUtils.java | 4 +-- .../latin/utils/RecapitalizeStatus.java | 2 +- 15 files changed, 33 insertions(+), 33 deletions(-) diff --git a/java/res/xml-sw600dp/key_styles_common.xml b/java/res/xml-sw600dp/key_styles_common.xml index ea8f29250..3d25f4295 100644 --- a/java/res/xml-sw600dp/key_styles_common.xml +++ b/java/res/xml-sw600dp/key_styles_common.xml @@ -38,7 +38,7 @@ - + - + - = 0 && index < TEXTS_DEFAULT.length) { return TEXTS_DEFAULT[index]; } diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java index 60016371b..c13f0e20a 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java @@ -196,8 +196,8 @@ final public class BinaryDictionaryGetter { } // ## HACK ## we prevent usage of a dictionary before version 18. The reason for this is, since - // those do not include whitelist entries, the new code with an old version of the dictionary - // would lose whitelist functionality. + // those do not include allowlist entries, the new code with an old version of the dictionary + // would lose allowlist functionality. private static boolean hackCanUseDictionaryFile(final File file) { if (!SHOULD_USE_DICT_VERSION) { return true; @@ -211,7 +211,7 @@ final public class BinaryDictionaryGetter { // No version in the options : the format is unexpected return false; } - // Version 18 is the first one to include the whitelist + // Version 18 is the first one to include the allowlist. // Obviously this is a big ## HACK ## return Integer.parseInt(version) >= 18; } catch (java.io.FileNotFoundException e) { diff --git a/java/src/com/android/inputmethod/latin/InputAttributes.java b/java/src/com/android/inputmethod/latin/InputAttributes.java index 37effeead..86c7810f4 100644 --- a/java/src/com/android/inputmethod/latin/InputAttributes.java +++ b/java/src/com/android/inputmethod/latin/InputAttributes.java @@ -66,7 +66,7 @@ public final class InputAttributes { || InputTypeUtils.isVisiblePasswordInputType(inputType); if (inputClass != InputType.TYPE_CLASS_TEXT) { // If we are not looking at a TYPE_CLASS_TEXT field, the following strange - // cases may arise, so we do a couple sanity checks for them. If it's a + // cases may arise, so we do a couple validity checks for them. If it's a // TYPE_CLASS_TEXT field, these special cases cannot happen, by construction // of the flags. if (null == editorInfo) { diff --git a/java/src/com/android/inputmethod/latin/RichInputMethodSubtype.java b/java/src/com/android/inputmethod/latin/RichInputMethodSubtype.java index cc589229e..95204265d 100644 --- a/java/src/com/android/inputmethod/latin/RichInputMethodSubtype.java +++ b/java/src/com/android/inputmethod/latin/RichInputMethodSubtype.java @@ -174,35 +174,35 @@ public class RichInputMethodSubtype { } } - // Dummy no language QWERTY subtype. See {@link R.xml.method}. - private static final int SUBTYPE_ID_OF_DUMMY_NO_LANGUAGE_SUBTYPE = 0xdde0bfd3; - private static final String EXTRA_VALUE_OF_DUMMY_NO_LANGUAGE_SUBTYPE = + // Placeholer for no language QWERTY subtype. See {@link R.xml.method}. + private static final int SUBTYPE_ID_OF_PLACEHOLDER_NO_LANGUAGE_SUBTYPE = 0xdde0bfd3; + private static final String EXTRA_VALUE_OF_PLACEHOLDER_NO_LANGUAGE_SUBTYPE = "KeyboardLayoutSet=" + SubtypeLocaleUtils.QWERTY + "," + Constants.Subtype.ExtraValue.ASCII_CAPABLE + "," + Constants.Subtype.ExtraValue.ENABLED_WHEN_DEFAULT_IS_NOT_ASCII_CAPABLE + "," + Constants.Subtype.ExtraValue.EMOJI_CAPABLE; @Nonnull - private static final RichInputMethodSubtype DUMMY_NO_LANGUAGE_SUBTYPE = + private static final RichInputMethodSubtype PLACEHOLDER_NO_LANGUAGE_SUBTYPE = new RichInputMethodSubtype(InputMethodSubtypeCompatUtils.newInputMethodSubtype( R.string.subtype_no_language_qwerty, R.drawable.ic_ime_switcher_dark, SubtypeLocaleUtils.NO_LANGUAGE, KEYBOARD_MODE, - EXTRA_VALUE_OF_DUMMY_NO_LANGUAGE_SUBTYPE, + EXTRA_VALUE_OF_PLACEHOLDER_NO_LANGUAGE_SUBTYPE, false /* isAuxiliary */, false /* overridesImplicitlyEnabledSubtype */, - SUBTYPE_ID_OF_DUMMY_NO_LANGUAGE_SUBTYPE)); + SUBTYPE_ID_OF_PLACEHOLDER_NO_LANGUAGE_SUBTYPE)); // Caveat: We probably should remove this when we add an Emoji subtype in {@link R.xml.method}. // Dummy Emoji subtype. See {@link R.xml.method}. - private static final int SUBTYPE_ID_OF_DUMMY_EMOJI_SUBTYPE = 0xd78b2ed0; - private static final String EXTRA_VALUE_OF_DUMMY_EMOJI_SUBTYPE = + private static final int SUBTYPE_ID_OF_PLACEHOLDER_EMOJI_SUBTYPE = 0xd78b2ed0; + private static final String EXTRA_VALUE_OF_PLACEHOLDER_EMOJI_SUBTYPE = "KeyboardLayoutSet=" + SubtypeLocaleUtils.EMOJI + "," + Constants.Subtype.ExtraValue.EMOJI_CAPABLE; @Nonnull - private static final RichInputMethodSubtype DUMMY_EMOJI_SUBTYPE = new RichInputMethodSubtype( + private static final RichInputMethodSubtype PLACEHOLDER_EMOJI_SUBTYPE = new RichInputMethodSubtype( InputMethodSubtypeCompatUtils.newInputMethodSubtype( R.string.subtype_emoji, R.drawable.ic_ime_switcher_dark, SubtypeLocaleUtils.NO_LANGUAGE, KEYBOARD_MODE, - EXTRA_VALUE_OF_DUMMY_EMOJI_SUBTYPE, + EXTRA_VALUE_OF_PLACEHOLDER_EMOJI_SUBTYPE, false /* isAuxiliary */, false /* overridesImplicitlyEnabledSubtype */, - SUBTYPE_ID_OF_DUMMY_EMOJI_SUBTYPE)); + SUBTYPE_ID_OF_PLACEHOLDER_EMOJI_SUBTYPE)); private static RichInputMethodSubtype sNoLanguageSubtype; private static RichInputMethodSubtype sEmojiSubtype; @@ -223,8 +223,8 @@ public class RichInputMethodSubtype { } Log.w(TAG, "Can't find any language with QWERTY subtype"); Log.w(TAG, "No input method subtype found; returning dummy subtype: " - + DUMMY_NO_LANGUAGE_SUBTYPE); - return DUMMY_NO_LANGUAGE_SUBTYPE; + + PLACEHOLDER_NO_LANGUAGE_SUBTYPE); + return PLACEHOLDER_NO_LANGUAGE_SUBTYPE; } @Nonnull @@ -244,7 +244,7 @@ public class RichInputMethodSubtype { } Log.w(TAG, "Can't find emoji subtype"); Log.w(TAG, "No input method subtype found; returning dummy subtype: " - + DUMMY_EMOJI_SUBTYPE); - return DUMMY_EMOJI_SUBTYPE; + + PLACEHOLDER_EMOJI_SUBTYPE); + return PLACEHOLDER_EMOJI_SUBTYPE; } } diff --git a/java/src/com/android/inputmethod/latin/about/AboutPreferences.java b/java/src/com/android/inputmethod/latin/about/AboutPreferences.java index f60b189f1..ec7e6def5 100644 --- a/java/src/com/android/inputmethod/latin/about/AboutPreferences.java +++ b/java/src/com/android/inputmethod/latin/about/AboutPreferences.java @@ -19,7 +19,7 @@ package com.android.inputmethod.latin.about; import android.app.Fragment; /** - * Dummy class of AboutPreferences. Never use this. + * Placeholer class of AboutPreferences. Never use this. */ public final class AboutPreferences extends Fragment { private AboutPreferences() { diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index 1dd5850f8..a7804a13f 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -805,7 +805,7 @@ public final class InputLogic { if (SpaceState.PHANTOM == inputTransaction.mSpaceState && !settingsValues.isWordConnector(codePoint)) { if (isComposingWord) { - // Sanity check + // Validity check throw new RuntimeException("Should not be composing here"); } insertAutomaticSpaceIfOptionsAndTextAllow(settingsValues); @@ -1370,7 +1370,7 @@ public final class InputLogic { * @return whether it's fine to apply the transformation after this code point. */ private static boolean canBeFollowedByDoubleSpacePeriod(final int codePoint) { - // TODO: This should probably be a blacklist rather than a whitelist. + // TODO: This should probably be a denylist rather than a allowlist. // TODO: This should probably be language-dependant... return Character.isLetterOrDigit(codePoint) || codePoint == Constants.CODE_SINGLE_QUOTE diff --git a/java/src/com/android/inputmethod/latin/settings/CustomInputStylePreference.java b/java/src/com/android/inputmethod/latin/settings/CustomInputStylePreference.java index 21ea8f859..44a98c1be 100644 --- a/java/src/com/android/inputmethod/latin/settings/CustomInputStylePreference.java +++ b/java/src/com/android/inputmethod/latin/settings/CustomInputStylePreference.java @@ -330,7 +330,7 @@ final class CustomInputStylePreference extends DialogPreference R.array.predefined_layouts); // TODO: Should filter out already existing combinations of locale and layout. for (final String layout : predefinedKeyboardLayoutSet) { - // This is a dummy subtype with NO_LANGUAGE, only for display. + // This is a placeholder for a subtype with NO_LANGUAGE, only for display. final InputMethodSubtype subtype = AdditionalSubtypeUtils.createDummyAdditionalSubtype( SubtypeLocaleUtils.NO_LANGUAGE, layout); diff --git a/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java b/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java index 0dbc7c858..47f65499d 100644 --- a/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java @@ -194,10 +194,10 @@ public final class CapsModeUtils { // English is a special case in that "American typography" rules, which are the most common // in English, state that a sentence terminator immediately following a quotation mark // should be swapped with it and de-duplicated (included in the quotation mark), - // e.g. <> + // e.g. <> // No other language has such a rule as far as I know, instead putting inside the quotation // mark as the exact thing quoted and handling the surrounding punctuation independently, - // e.g. <> + // e.g. <> if (spacingAndPunctuations.mUsesAmericanTypography) { for (; j > 0; j--) { // Here we look to go over any closing punctuation. This is because in dominant diff --git a/java/src/com/android/inputmethod/latin/utils/RecapitalizeStatus.java b/java/src/com/android/inputmethod/latin/utils/RecapitalizeStatus.java index a381649a4..737e33228 100644 --- a/java/src/com/android/inputmethod/latin/utils/RecapitalizeStatus.java +++ b/java/src/com/android/inputmethod/latin/utils/RecapitalizeStatus.java @@ -81,7 +81,7 @@ public class RecapitalizeStatus { private static final int[] EMPTY_STORTED_SEPARATORS = {}; public RecapitalizeStatus() { - // By default, initialize with dummy values that won't match any real recapitalize. + // By default, initialize with fake values that won't match any real recapitalize. start(-1, -1, "", Locale.getDefault(), EMPTY_STORTED_SEPARATORS); stop(); }