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

Commit b267d4b3 authored by Elike24's avatar Elike24 Committed by Danny Baumann
Browse files

Contacts: Fixed "%s" appearing in contact options in some languages

In the contacts-app, when looking at a contact, there is a entry in the options called "Copy to SIM" (or similar) in most cases.
The text in the translation file for this is "Copy to <xliff:g id="destination">%s</xliff:g>" (%s at the end), while the text is "Nach <xliff:g id="destination">%s</xliff:g> kopieren" (%s in the middle) in the German translation for example.
The problem is that the destination (e.g. "SIM") is added using the plus operator instead of replacing the %s.
This does not cause any trouble if the %s stands at the end, such as in English, but in German it causes "Nach %s kopierenSIM" instead of "Nach SIM kopieren".
Adding "SIM" as second parameter in getString() instead of using "+" should replace %s by "SIM" and fix the problem.

Change-Id: I81d3d1b366e7bbff3e331af67295c53100f5840a
parent 420be572
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -754,8 +754,6 @@
    <!-- Prefix for messages that you sent [CHAR LIMIT=40] -->
    <string name="message_from_you_prefix">You: <xliff:g id="sms_body">%s</xliff:g></string>

    <string name="menu_copyTo">"Copy to "</string>
    <string name="no_empty_email_in_usim">"Email is full, some record copy failed "</string>
    <!-- File Authority for the photo picker -->
    <string name="photo_file_provider_authority" translatable="false">com.android.contacts.files</string>

+16 −16
Original line number Diff line number Diff line
@@ -2495,21 +2495,21 @@ public class QuickContactActivity extends ContactsActivity {
            if (!TextUtils.isEmpty(accoutType)) {
                if (SimContactsConstants.ACCOUNT_TYPE_SIM.equals(accoutType)) {
                    copyToPhoneMenu.setVisible(true);
                    copyToPhoneMenu.setTitle(getString(R.string.menu_copyTo)
                            + getString(R.string.phoneLabelsGroup));
                    copyToPhoneMenu.setTitle(getString(R.string.menu_copyTo,
                            getString(R.string.phoneLabelsGroup)));
                    if (TelephonyManager.getDefault().isMultiSimEnabled()) {
                        if (SimContactsConstants.SIM_NAME_1.equals(accoutName)
                                && simIsReady(SimContactsConstants.SUB_2)) {
                            copyToSim2Menu.setTitle(getString(R.string.menu_copyTo)
                                    + MoreContactUtils.getMultiSimAliasesName(
                                            this, SimContactsConstants.SUB_2));
                            copyToSim2Menu.setTitle(getString(R.string.menu_copyTo,
                                    MoreContactUtils.getMultiSimAliasesName(
                                            this, SimContactsConstants.SUB_2)));
                            copyToSim2Menu.setVisible(true);
                        }
                        if (SimContactsConstants.SIM_NAME_2.equals(accoutName)
                                && simIsReady(SimContactsConstants.SUB_1)) {
                            copyToSim1Menu.setTitle(getString(R.string.menu_copyTo)
                                    + MoreContactUtils.getMultiSimAliasesName(
                                                this, SimContactsConstants.SUB_1));
                            copyToSim1Menu.setTitle(getString(R.string.menu_copyTo,
                                    MoreContactUtils.getMultiSimAliasesName(
                                                this, SimContactsConstants.SUB_1)));
                            copyToSim1Menu.setVisible(true);
                        }
                    }
@@ -2518,21 +2518,21 @@ public class QuickContactActivity extends ContactsActivity {
                    boolean hasPhoneOrEmail = hasPhoneOrEmailDate(mContactData);
                    if (TelephonyManager.getDefault().isMultiSimEnabled()) {
                        if (hasPhoneOrEmail && simIsReady(SimContactsConstants.SUB_1)) {
                            copyToSim1Menu.setTitle(getString(R.string.menu_copyTo)
                                    + MoreContactUtils.getMultiSimAliasesName(
                                            this, SimContactsConstants.SUB_1));
                            copyToSim1Menu.setTitle(getString(R.string.menu_copyTo,
                                    MoreContactUtils.getMultiSimAliasesName(
                                            this, SimContactsConstants.SUB_1)));
                            copyToSim1Menu.setVisible(true);
                        }
                        if (hasPhoneOrEmail && simIsReady(SimContactsConstants.SUB_2)) {
                            copyToSim2Menu.setTitle(getString(R.string.menu_copyTo)
                                    + MoreContactUtils.getMultiSimAliasesName(
                                            this, SimContactsConstants.SUB_2));
                            copyToSim2Menu.setTitle(getString(R.string.menu_copyTo,
                                    MoreContactUtils.getMultiSimAliasesName(
                                            this, SimContactsConstants.SUB_2)));
                            copyToSim2Menu.setVisible(true);
                        }
                    } else {
                        if (hasPhoneOrEmail && simIsReady(SimContactsConstants.SUB_1)) {
                            copyToSim1Menu.setTitle(getString(R.string.menu_copyTo)
                                    + SimContactsConstants.SIM_NAME);
                            copyToSim1Menu.setTitle(getString(R.string.menu_copyTo,
                                    SimContactsConstants.SIM_NAME));
                            copyToSim1Menu.setVisible(true);
                        }
                    }