Commit 64d11a98 by olly Committed by kim-vde

Reference IMA language code bug

PiperOrigin-RevId: 343883034
parent 3ec5ad1d
...@@ -735,11 +735,12 @@ public final class ImaAdsLoader implements Player.EventListener, AdsLoader { ...@@ -735,11 +735,12 @@ public final class ImaAdsLoader implements Player.EventListener, AdsLoader {
/** /**
* 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];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment