Merge "[ToA] Should strip u extension when check locale" into main
This commit is contained in:
@@ -36,9 +36,10 @@ import java.util.Locale;
|
|||||||
|
|
||||||
public class TermsOfAddressCategoryController extends PreferenceCategoryController {
|
public class TermsOfAddressCategoryController extends PreferenceCategoryController {
|
||||||
|
|
||||||
private static final String TAG = "TermsOfAddressCategoryController";
|
private static final String TAG = "TermsOfAddressCategory";
|
||||||
private static final String KEY_CATEGORY_TERMS_OF_ADDRESS = "key_category_terms_of_address";
|
private static final String KEY_CATEGORY_TERMS_OF_ADDRESS = "key_category_terms_of_address";
|
||||||
private static final String KEY_TERMS_OF_ADDRESS = "key_terms_of_address";
|
private static final String KEY_TERMS_OF_ADDRESS = "key_terms_of_address";
|
||||||
|
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||||
|
|
||||||
public TermsOfAddressCategoryController(Context context, String key) {
|
public TermsOfAddressCategoryController(Context context, String key) {
|
||||||
super(context, key);
|
super(context, key);
|
||||||
@@ -79,11 +80,13 @@ public class TermsOfAddressCategoryController extends PreferenceCategoryControll
|
|||||||
mContext.getResources().getStringArray(
|
mContext.getResources().getStringArray(
|
||||||
R.array.terms_of_address_unsupported_locales));
|
R.array.terms_of_address_unsupported_locales));
|
||||||
|
|
||||||
final Locale locale = localeInfo.getLocale();
|
final Locale locale = localeInfo.getLocale().stripExtensions();
|
||||||
final String language = locale.getLanguage();
|
final String language = locale.getLanguage();
|
||||||
final String localeTag = locale.toLanguageTag();
|
final String localeTag = locale.toLanguageTag();
|
||||||
|
if (DEBUG) {
|
||||||
Log.d(TAG, "current language: " + language);
|
Log.d(TAG, "current language: " + language);
|
||||||
Log.d(TAG, "current locale tag: " + localeTag);
|
Log.d(TAG, "current locale tag: " + localeTag);
|
||||||
|
}
|
||||||
|
|
||||||
// Supported locales:
|
// Supported locales:
|
||||||
// 1. All French is supported except fr-CA.
|
// 1. All French is supported except fr-CA.
|
||||||
|
Reference in New Issue
Block a user