Skip to content

Commit

Permalink
Reference IMA language code bug
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 343883034
  • Loading branch information
ojw28 authored and icbaker committed Nov 30, 2020
1 parent d582933 commit 5b51cb7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1959,11 +1959,12 @@ public AdsLoader createAdsLoader(

/**
* 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:
// 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() {
return Util.splitAtFirst(Util.getSystemLanguageCodes()[0], "-")[0];
}
Expand Down

0 comments on commit 5b51cb7

Please sign in to comment.