Cleanup plurals in Settings, change <one> to <1> in string res file.
"One" and "1" are not same, such as "1st place" vs "a place". Also in many languages, plurals expression is different with English, for more detail please check: go/android-i18n-plurals. So in string res file, replace "one" with excat value "1" is a more proper way. Test: Existing unit tests still pass. Bug: 199230342 Change-Id: I832abc38afc5d8816fa803865c25e6017cffa2c6
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user