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:
@@ -28,6 +28,7 @@ import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.verify.domain.DomainVerificationManager;
|
||||
import android.content.pm.verify.domain.DomainVerificationUserState;
|
||||
import android.icu.text.MessageFormat;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.ArraySet;
|
||||
@@ -52,7 +53,10 @@ import com.android.settingslib.widget.FooterPreference;
|
||||
import com.android.settingslib.widget.MainSwitchPreference;
|
||||
import com.android.settingslib.widget.OnMainSwitchChangeListener;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -287,13 +291,21 @@ public class AppLaunchSettings extends AppInfoBase implements
|
||||
|
||||
@VisibleForTesting
|
||||
String getVerifiedLinksTitle(int linksNo) {
|
||||
return getResources().getQuantityString(
|
||||
R.plurals.app_launch_verified_links_title, linksNo, linksNo);
|
||||
MessageFormat msgFormat = new MessageFormat(
|
||||
getResources().getString(R.string.app_launch_verified_links_title),
|
||||
Locale.getDefault());
|
||||
Map<String, Object> arguments = new HashMap<>();
|
||||
arguments.put("count", linksNo);
|
||||
return msgFormat.format(arguments);
|
||||
}
|
||||
|
||||
private String getVerifiedLinksMessage(int linksNo) {
|
||||
return getResources().getQuantityString(
|
||||
R.plurals.app_launch_verified_links_message, linksNo, linksNo);
|
||||
MessageFormat msgFormat = new MessageFormat(
|
||||
getResources().getString(R.string.app_launch_verified_links_message),
|
||||
Locale.getDefault());
|
||||
Map<String, Object> arguments = new HashMap<>();
|
||||
arguments.put("count", linksNo);
|
||||
return msgFormat.format(arguments);
|
||||
}
|
||||
|
||||
/** Add selected links items */
|
||||
|
Reference in New Issue
Block a user