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

Commit fd39b53f authored by XingHai Lu's avatar XingHai Lu Committed by Android (Google) Code Review
Browse files

Merge "Cleanup plurals in Settings, change <one> to <1> in string res file."

parents a464ca0e b5293a2d
Loading
Loading
Loading
Loading
+48 −48
Original line number Diff line number Diff line
@@ -8042,15 +8042,15 @@
    <!-- [CHAR LIMIT=NONE] Zen mode summary spoken when changing mode by voice: switch to alarms only forever. -->
    <string name="zen_mode_summary_alarms_only_indefinite">Change to alarms only indefinitely</string>
    <!-- [CHAR LIMIT=NONE] Zen mode summary spoken when changing mode by voice: switch to alarms only for < 60 minutes. -->
    <plurals name="zen_mode_summary_alarms_only_by_minute">
        <item quantity="one">Change to alarms only for one minute until <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g></item>
        <item quantity="other">Change to alarms only for <xliff:g id="duration" example="2">%1$d</xliff:g> minutes (until <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
    </plurals>
    <string name="zen_mode_summary_alarms_only_by_minute">{count, plural,
      =1      {Change to alarms only for one minute until {time}}
      other   {Change to alarms only for # minutes (until {time})}
    }</string>
    <!-- [CHAR LIMIT=NONE] Zen mode summary spoken when changing mode by voice: switch to alarms only for N hours. -->
    <plurals name="zen_mode_summary_alarms_only_by_hour">
        <item quantity="one">Change to alarms only for one hour until <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g></item>
        <item quantity="other">Change to alarms only for <xliff:g id="duration" example="2">%1$d</xliff:g> hours until <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g></item>
    </plurals>
    <string name="zen_mode_summary_alarms_only_by_hour">{count, plural,
      =1      {Change to alarms only for one hour until {time}}
      other   {Change to alarms only for # hours until {time}}
    }</string>
    <!-- [CHAR LIMIT=NONE] Zen mode summary spoken when changing mode by voice: switch to alarms only until a specific time. -->
    <string name="zen_mode_summary_alarms_only_by_time">Change to alarms only until <xliff:g id="formattedTime" example="10:00 PM">%1$s</xliff:g></string>
    <!-- [CHAR LIMIT=NONE] Zen mode summary spoken when changing mode by voice: Turn on all notifications. -->
@@ -8241,14 +8241,14 @@
    <string name="app_launch_footer">An app can verify links to automatically open in the app.</string>
    <!-- Title, message and button for verified links dialog. -->
    <plurals name="app_launch_verified_links_title">
        <item quantity="one"><xliff:g id="count">%d</xliff:g> verified link</item>
        <item quantity="other"><xliff:g id="count">%d</xliff:g> verified links</item>
    </plurals>
    <plurals name="app_launch_verified_links_message">
        <item quantity="one">This link is verified and automatically opens in this app.</item>
        <item quantity="other">These links are verified and automatically open in this app.</item>
    </plurals>
    <string name="app_launch_verified_links_title">{count, plural,
      =1      {# verified link}
      other   {# verified links}
    }</string>
    <string name="app_launch_verified_links_message">{count, plural,
      =1      {This link is verified and automatically opens in this app.}
      other   {These links are verified and automatically open in this app.}
    }</string>
    <!-- OK button for verified links dialog. [CHAR LIMIT=20] -->
    <string name="app_launch_dialog_ok">OK</string>
    <!-- Info icon description of the verified links. [CHAR LIMIT=NONE] -->
@@ -8260,10 +8260,10 @@
    <string name="app_launch_dialog_cancel">Cancel</string>
    <!-- Title and button for supported links dialog. -->
    <plurals name="app_launch_supported_links_title">
        <item quantity="one"><xliff:g id="count">%d</xliff:g> supported link</item>
        <item quantity="other"><xliff:g id="count">%d</xliff:g> supported links</item>
    </plurals>
    <string name="app_launch_supported_links_title">{count, plural,
      =1      {# supported link}
      other   {# supported links}
    }</string>
    <!-- Add button for supported links dialog. [CHAR LIMIT=20] -->
    <string name="app_launch_supported_links_add">Add</string>
    <!-- The subtext of the link title in supported links dialog. [CHAR LIMIT=30] -->
@@ -8294,16 +8294,16 @@
    <string name="notifications_enabled_with_info"><xliff:g id="notifications_sent" example="~6 per week">%1$s</xliff:g> / <xliff:g id="notifications_categories_off" example="3 categories turned off">%2$s</xliff:g> </string>
    <!-- Permissions preference summary [CHAR LIMIT=40] -->
    <plurals name="notifications_categories_off">
        <item quantity="one"><xliff:g id="count" example="1">%d</xliff:g> category turned off</item>
        <item quantity="other"><xliff:g id="count" example="10">%d</xliff:g> categories turned off</item>
    </plurals>
    <string name="notifications_categories_off">{count, plural,
      =1      {# category turned off}
      other   {# categories turned off}
    }</string>
    <!-- Runtime permissions preference summary.  Number of additional permissions granted. [CHAR LIMIT=40] -->
    <plurals name="runtime_permissions_additional_count">
        <item quantity="one"><xliff:g id="count" example="1">%d</xliff:g> additional permission</item>
        <item quantity="other"><xliff:g id="count" example="10">%d</xliff:g> additional permissions</item>
    </plurals>
    <string name="runtime_permissions_additional_count">{count, plural,
      =1      {# additional permission}
      other   {# additional permissions}
    }</string>
    <!-- Runtime permissions preference summary, shown when the app has no permissions granted. [CHAR LIMIT=40] -->
    <string name="runtime_permissions_summary_no_permissions_granted">No permissions granted</string>
@@ -8324,10 +8324,10 @@
    <string name="unused_apps">Unused apps</string>
    <!-- Summary of number of apps that have not been used for months. [CHAR LIMIT=40]-->
    <plurals name="unused_apps_summary">
        <item quantity="one"><xliff:g id="count" example="1">%d</xliff:g> unused app</item>
        <item quantity="other"><xliff:g id="count" example="10">%d</xliff:g> unused apps</item>
    </plurals>
    <string name="unused_apps_summary">{count, plural,
      =1      {# unused app}
      other   {# unused apps}
    }</string>
    <!-- Label for category for unused app settings for an app. [CHAR LIMIT=40]-->
    <string name="unused_apps_category">Unused app settings</string>
@@ -8382,10 +8382,10 @@
    <string name="app_link_open_never">Don&#8217;t allow app to open links</string>
    <!-- Summary for allow app to open supported links [CHAR LIMIT=42] -->
    <plurals name="app_link_open_always_summary">
        <item quantity="one">App claims to handle <xliff:g id="count">%d</xliff:g> link</item>
        <item quantity="other">App claims to handle <xliff:g id="count">%d</xliff:g> links</item>
    </plurals>
    <string name="app_link_open_always_summary">{count, plural,
      =1      {App claims to handle # link}
      other   {App claims to handle # links}
    }</string>
    <!-- Footer of open supported links settings [CHAR LIMIT=NONE] -->
    <string name="open_supported_links_footer">App claims to handle following links:</string>
@@ -8645,10 +8645,10 @@
    <string name="memory_usage_apps">Memory used by apps</string>
    <!-- Description of number of apps using memory [CHAR LIMIT=NONE] -->
    <plurals name="memory_usage_apps_summary">
        <item quantity="one">1 app used memory in the last <xliff:g id="duration" example="3 hours">%2$s</xliff:g></item>
        <item quantity="other"><xliff:g id="count" example="10">%1$d</xliff:g> apps used memory in the last <xliff:g id="duration" example="3 hours">%2$s</xliff:g></item>
    </plurals>
    <string name="memory_usage_apps_summary">{count, plural,
      =1      {1 app used memory in the last {time}}
      other   {# apps used memory in the last {time}}
    }</string>
    <!-- Label for frequency that the app is runnig (e.g. always, sometimes, etc.) [CHAR LIMIT=25] -->
    <string name="running_frequency">Frequency</string>
@@ -9037,10 +9037,10 @@
    <string name="data_usage_other_apps">Other apps included in usage</string>
    <!-- Description of number of apps allowed to ignore Data Saver [CHAR LIMIT=NONE] -->
    <plurals name="data_saver_unrestricted_summary">
        <item quantity="one">1 app allowed to use unrestricted data when Data Saver is on</item>
        <item quantity="other"><xliff:g id="count" example="10">%1$d</xliff:g> apps allowed to use unrestricted data when Data Saver is on</item>
    </plurals>
    <string name="data_saver_unrestricted_summary">{count, plural,
      =1      {1 app allowed to use unrestricted data when Data Saver is on}
      other   {# apps allowed to use unrestricted data when Data Saver is on}
    }</string>
    <!-- Data usage title text [CHAR LIMIT=30] -->
    <string name="data_usage_title">Primary data</string>
@@ -9064,10 +9064,10 @@
    <string name="data_usage_chart_no_data_content_description">No data in this date range</string>
    <!-- Informational text about time left in billing cycle [CHAR LIMIT=60] -->
    <plurals name="billing_cycle_days_left">
        <item quantity="one">%d day left</item>
        <item quantity="other">%d days left</item>
    </plurals>
    <string name="billing_cycle_days_left">{count, plural,
      =1      {# day left}
      other   {# days left}
    }</string>
    <!-- Informational text about time left in billing cycle [CHAR LIMIT=60] -->
    <string name="billing_cycle_none_left">No time remaining</string>
+10 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.provider.DeviceConfig.NAMESPACE_APP_HIBERNATION;
import static com.android.settings.Utils.PROPERTY_APP_HIBERNATION_ENABLED;

import android.content.Context;
import android.icu.text.MessageFormat;
import android.permission.PermissionControllerManager;
import android.provider.DeviceConfig;

@@ -35,6 +36,9 @@ import com.android.settings.core.BasePreferenceController;

import com.google.common.annotations.VisibleForTesting;

import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.Executor;

/**
@@ -67,9 +71,13 @@ public final class HibernatedAppsPreferenceController extends BasePreferenceCont

    @Override
    public CharSequence getSummary() {
        MessageFormat msgFormat = new MessageFormat(
                mContext.getResources().getString(R.string.unused_apps_summary),
                Locale.getDefault());
        Map<String, Object> arguments = new HashMap<>();
        arguments.put("count", mUnusedCount);
        return mLoadedUnusedCount
                ? mContext.getResources().getQuantityString(
                        R.plurals.unused_apps_summary, mUnusedCount, mUnusedCount)
                ? msgFormat.format(arguments)
                : mContext.getResources().getString(R.string.summary_placeholder);
    }

+10 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.content.pm.PackageManager.INTENT_FILTER_DOMAIN_VERIFICATIO

import android.app.settings.SettingsEnums;
import android.content.pm.PackageManager;
import android.icu.text.MessageFormat;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
@@ -35,6 +36,9 @@ import com.android.settings.Utils;
import com.android.settingslib.widget.FooterPreference;
import com.android.settingslib.widget.SelectorWithWidgetPreference;

import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;

/**
@@ -89,10 +93,14 @@ public class OpenSupportedLinks extends AppInfoWithHeader implements
        mPreferenceCategory = findPreference(RADIO_GROUP_KEY);
        mAllowOpening = makeRadioPreference(KEY_LINK_OPEN_ALWAYS, R.string.app_link_open_always);
        final int entriesNo = getEntriesNo();
        MessageFormat msgFormat = new MessageFormat(
                getResources().getString(R.string.app_link_open_always_summary),
                Locale.getDefault());
        Map<String, Object> arguments = new HashMap<>();
        arguments.put("count", entriesNo);
        //This to avoid the summary line wrap
        mAllowOpening.setAppendixVisibility(View.GONE);
        mAllowOpening.setSummary(getResources().getQuantityString(
                R.plurals.app_link_open_always_summary, entriesNo, entriesNo));
        mAllowOpening.setSummary(msgFormat.format(arguments));
        mAskEveryTime = makeRadioPreference(KEY_LINK_OPEN_ASK, R.string.app_link_open_ask);
        mNotAllowed = makeRadioPreference(KEY_LINK_OPEN_NEVER, R.string.app_link_open_never);

+11 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.settings.applications;

import android.app.settings.SettingsEnums;
import android.content.Context;
import android.icu.text.MessageFormat;
import android.os.Bundle;
import android.text.format.Formatter;
import android.text.format.Formatter.BytesResult;
@@ -30,6 +31,10 @@ import com.android.settings.Utils;
import com.android.settings.applications.ProcStatsData.MemInfo;
import com.android.settings.core.SubSettingLauncher;

import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

public class ProcessStatsSummary extends ProcessStatsBase implements OnPreferenceClickListener {

    private static final String KEY_STATUS_HEADER = "status_header";
@@ -94,8 +99,12 @@ public class ProcessStatsSummary extends ProcessStatsBase implements OnPreferenc
        mFree.setSummary(freeString);
        String durationString = getString(sDurationLabels[mDurationIndex]);
        int numApps = mStatsManager.getEntries().size();
        mAppListPreference.setSummary(getResources().getQuantityString(
                R.plurals.memory_usage_apps_summary, numApps, numApps, durationString));
        MessageFormat msgFormat = new MessageFormat(
                getResources().getString(R.string.memory_usage_apps_summary), Locale.getDefault());
        Map<String, Object> arguments = new HashMap<>();
        arguments.put("count", numApps);
        arguments.put("time", durationString);
        mAppListPreference.setSummary(msgFormat.format(arguments));
    }

    @Override
+11 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.settings.applications.appinfo;
import static com.android.settings.SettingsActivity.EXTRA_FRAGMENT_ARG_KEY;

import android.content.Context;
import android.icu.text.MessageFormat;
import android.os.Bundle;

import androidx.preference.Preference;
@@ -31,6 +32,10 @@ import com.android.settings.notification.app.AppNotificationSettings;
import com.android.settingslib.applications.AppUtils;
import com.android.settingslib.applications.ApplicationsState;

import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

public class AppNotificationPreferenceController extends AppInfoPreferenceControllerBase {

    private String mChannelId = null;
@@ -103,10 +108,14 @@ public class AppNotificationPreferenceController extends AppInfoPreferenceContro
            if (appRow.blockedChannelCount == 0) {
                return NotificationBackend.getSentSummary(context, appRow.sentByApp, false);
            }
            MessageFormat msgFormat = new MessageFormat(
                    context.getString(R.string.notifications_categories_off),
                    Locale.getDefault());
            Map<String, Object> arguments = new HashMap<>();
            arguments.put("count", appRow.blockedChannelCount);
            return context.getString(R.string.notifications_enabled_with_info,
                    NotificationBackend.getSentSummary(context, appRow.sentByApp, false),
                    context.getResources().getQuantityString(R.plurals.notifications_categories_off,
                            appRow.blockedChannelCount, appRow.blockedChannelCount));
                    msgFormat.format(arguments));
        }
    }
}
Loading