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

Commit c4c1eae3 authored by Jackeagle's avatar Jackeagle
Browse files

Updater: Switch to custom strings



- There are translations to existing strings, since we have stopped maintaining Q these translations cannot be updated anymore.

Signed-off-by: default avatarJackeagle <jackeagle102@gmail.com>
parent 6fac27b6
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -120,13 +120,13 @@
    <string name="apply_update_dialog_message_ab">You are about to update to <xliff:g id="update_name">%1$s</xliff:g>.\n\nIf you press <xliff:g id="ok">%2$s</xliff:g>, the device will begin installing in the background.\n\nOnce completed, you will be prompted to reboot.</string>

    <string name="version_upgrade_dialog_title">Version Upgrade!</string>
    <string name="version_upgrade_dialog_message">
    <string name="custom_version_upgrade_dialog_message">
        You are about to upgrade to <xliff:g id="update_name">%1$s</xliff:g>, based on Android <xliff:g id="version_android">%2$s</xliff:g>\n\n
        <xliff:g id="warning_message">⚠️ Warning ⚠️: If you have been using Adoptable Storage, upgrading will lead to data loss and SD Card corruption, including internal storage.\n\n</xliff:g>
        Remember: it is always recommended to backup your data before upgrades.\n\n
        If you press <xliff:g id="ok">%3$s</xliff:g>, the device will restart itself into recovery mode to install the update.
    </string>
    <string name="version_upgrade_dialog_message_ab">
    <string name="custom_version_upgrade_dialog_message_ab">
        You are about to upgrade to <xliff:g id="update_name">%1$s</xliff:g>, based on Android <xliff:g id="version_android">%2$s</xliff:g>.\n\n
        <xliff:g id="warning_message">⚠️ Warning ⚠️: If you have been using Adoptable Storage, upgrading may lead to data loss and SD Card corruption, including internal storage.\n\n</xliff:g>
        Remember: it is always recommended to backup your data before upgrades.\n\n
@@ -162,9 +162,9 @@
    <string name="checkbox_mobile_data_warning">Do not show again</string>
    <string name="menu_mobile_data_warning">Mobile data warning</string>

    <string name="blocked_update_dialog_title">Update blocked</string>
    <string name="blocked_update_dialog_message">This upgrade cannot be installed because Adoptable Storage is not supported on Android 11. Upgrading will result in data loss and SD card corruption for users with Adoptable Storage enabled.</string>
    <string name="blocked_update_info_url" translatable="false">https://doc.e.foundation/devices/<xliff:g id="device_name">%1$s</xliff:g></string>
    <string name="custom_blocked_update_dialog_title">Update blocked</string>
    <string name="custom_blocked_update_dialog_message">This upgrade cannot be installed because Adoptable Storage is not supported on Android 11. Upgrading will result in data loss and SD card corruption for users with Adoptable Storage enabled.</string>
    <string name="custom_blocked_update_info_url" translatable="false">https://doc.e.foundation/devices/<xliff:g id="device_name">%1$s</xliff:g></string>

    <string name="export_channel_title">Export completion</string>
    <string name="new_updates_channel_title">New updates</string>
+4 −4
Original line number Diff line number Diff line
@@ -546,10 +546,10 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
            } else {
                title = R.string.version_upgrade_dialog_title;
                if (Utils.isABUpdate(update.getFile())) {
                    message = mActivity.getString(R.string.version_upgrade_dialog_message_ab, buildInfoText,
                    message = mActivity.getString(R.string.custom_version_upgrade_dialog_message_ab, buildInfoText,
                            update.getAndroidVersion(), mActivity.getString(android.R.string.ok));
                } else {
                    message = mActivity.getString(R.string.version_upgrade_dialog_message, buildInfoText,
                    message = mActivity.getString(R.string.custom_version_upgrade_dialog_message, buildInfoText,
                            update.getAndroidVersion(), mActivity.getString(android.R.string.ok));
                }
            }
@@ -673,7 +673,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.

    private void showInfoDialog() {
        String messageString = String.format(StringGenerator.getCurrentLocale(mActivity),
                mActivity.getString(R.string.blocked_update_dialog_message),
                mActivity.getString(R.string.custom_blocked_update_dialog_message),
                Utils.getUpgradeBlockedURL(mActivity));
        SpannableString message = new SpannableString(messageString);
        Linkify.addLinks(message, Linkify.WEB_URLS);
@@ -681,7 +681,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
            infoDialog.dismiss();
        }
        infoDialog = new AlertDialog.Builder(mActivity)
                .setTitle(R.string.blocked_update_dialog_title)
                .setTitle(R.string.custom_blocked_update_dialog_title)
                .setPositiveButton(android.R.string.ok, null)
                .setMessage(message)
                .show();
+1 −1
Original line number Diff line number Diff line
@@ -367,7 +367,7 @@ public class UpdaterService extends Service {
                if (!Utils.canInstall(this, update) || !Utils.isBatteryLevelOk(this)
                        || !hasRequiredSpace) {
                    /* Show notification if any of the below condition didn't met. */
                    text = getString(R.string.blocked_update_dialog_title) + ". ";
                    text = getString(R.string.custom_blocked_update_dialog_title) + ". ";
                    if (!Utils.isBatteryLevelOk(this)) {
                        text = text + getString(R.string.dialog_battery_low_title);
                    } else if (!hasRequiredSpace) {
+1 −1
Original line number Diff line number Diff line
@@ -288,7 +288,7 @@ public class Utils {
    public static String getUpgradeBlockedURL(Context context) {
        String device = SystemProperties.get(Constants.PROP_NEXT_DEVICE,
                SystemProperties.get(Constants.PROP_DEVICE));
        return context.getString(R.string.blocked_update_info_url, device);
        return context.getString(R.string.custom_blocked_update_info_url, device);
    }

    public static String getChangelogURL(Context context) {