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

Commit a3f00c0d authored by tom hsu's avatar tom hsu
Browse files

[ApnEditor] Create another string id for translation

 - make translation of MVNO value be diversity.

Bug: 185209214
Test: Maunal test passed
 - https://screenshot.googleplex.com/33vyFFBp8EnTpQ8
 - atest passed
Change-Id: I9b26e23bf61f06a987682fe64d9ce079e2194818
parent 463805b1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3768,6 +3768,8 @@
    <string name="apn_edit">Edit access point</string>
    <!-- Edit access point label summary text when no value has been set -->
    <string name="apn_not_set">Not set</string>
    <!-- Edit access point label summary text when no value has been set for mvno value. [CHAR LIMIT=NONE]-->
    <string name="apn_not_set_for_mvno">Not set</string>
    <!-- Edit access point labels: A label the user can give to the APN to allow him to differentiate it from the others -->
    <string name="apn_name">Name</string>
    <!-- Edit access point labels: The actual access point name-->
+10 −2
Original line number Diff line number Diff line
@@ -632,7 +632,7 @@ public class ApnEditor extends SettingsPreferenceFragment
                checkNull(bearerMultiDescription(mBearerMulti.getValues())));
        mMvnoType.setSummary(
                checkNull(mvnoDescription(mMvnoType.getValue())));
        mMvnoMatchData.setSummary(checkNull(mMvnoMatchData.getText()));
        mMvnoMatchData.setSummary(checkNullforMvnoValue(mMvnoMatchData.getText()));
        // allow user to edit carrier_enabled for some APN
        final boolean ceEditable = getResources().getBoolean(
                R.bool.config_allow_edit_carrier_enabled);
@@ -791,7 +791,7 @@ public class ApnEditor extends SettingsPreferenceFragment
            }
            mMvnoType.setValue((String) newValue);
            mMvnoType.setSummary(mvno);
            mMvnoMatchData.setSummary(checkNull(mMvnoMatchData.getText()));
            mMvnoMatchData.setSummary(checkNullforMvnoValue(mMvnoMatchData.getText()));
        } else if (KEY_PASSWORD.equals(key)) {
            mPassword.setSummary(starify(newValue != null ? String.valueOf(newValue) : ""));
        } else if (KEY_CARRIER_ENABLED.equals(key)) {
@@ -1216,6 +1216,14 @@ public class ApnEditor extends SettingsPreferenceFragment
        return TextUtils.isEmpty(value) ? sNotSet : value;
    }

    /**
     * To make traslation be diversity, use another string id for MVNO value.
     */
    private String checkNullforMvnoValue(String value) {
        String notSetForMvnoValue = getResources().getString(R.string.apn_not_set_for_mvno);
        return TextUtils.isEmpty(value) ? notSetForMvnoValue : value;
    }

    /**
     * Returns null if the given string {@code value} equals to {@link #sNotSet}. This method
     * should be used when convert a string value from preference to database.