Reference IMA language code bug

PiperOrigin-RevId: 343883034
This commit is contained in:
olly 2020-11-23 18:51:46 +00:00 committed by Ian Baker
parent d5829336eb
commit 5b51cb7284

View File

@ -1959,11 +1959,12 @@ public final class ImaAdsLoader
/** /**
* Returns a language code that's suitable for passing to {@link ImaSdkSettings#setLanguage} and * Returns a language code that's suitable for passing to {@link ImaSdkSettings#setLanguage} and
* corresponds to the device's {@link Locale#getDefault() default Locale}. * corresponds to the device's {@link Locale#getDefault() default Locale}. IMA will fall back to
* its default language code ("en") if the value returned is unsupported.
*/ */
// TODO: It may be possible to define a better mapping onto IMA's supported language codes. See: // TODO: It may be possible to define a better mapping onto IMA's supported language codes. See:
// https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/localization. // https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/localization.
// IMA will fall back to its default language code ("en") if the value returned is unsupported. // [Internal ref: b/174042000] will help if implemented.
private static String getImaLanguageCodeForDefaultLocale() { private static String getImaLanguageCodeForDefaultLocale() {
return Util.splitAtFirst(Util.getSystemLanguageCodes()[0], "-")[0]; return Util.splitAtFirst(Util.getSystemLanguageCodes()[0], "-")[0];
} }