Compartir a través de


ULocale.AcceptLanguage Method

Definition

Overloads

AcceptLanguage(ULocale[], Boolean[])

<strong>[icu]</strong> Based on an ordered array of acceptable locales, determine an available locale for the user.

AcceptLanguage(String, Boolean[])

<strong>[icu]</strong> Based on a HTTP formatted list of acceptable locales, determine an available locale for the user.

AcceptLanguage(ULocale[], ULocale[], Boolean[])

<strong>[icu]</strong> Based on a list of acceptable locales, determine an available locale for the user.

AcceptLanguage(String, ULocale[], Boolean[])

<strong>[icu]</strong> Based on a HTTP formatted list of acceptable locales, determine an available locale for the user.

AcceptLanguage(ULocale[], Boolean[])

<strong>[icu]</strong> Based on an ordered array of acceptable locales, determine an available locale for the user.

[Android.Runtime.Register("acceptLanguage", "([Landroid/icu/util/ULocale;[Z)Landroid/icu/util/ULocale;", "", ApiSince=24)]
public static Android.Icu.Util.ULocale? AcceptLanguage (Android.Icu.Util.ULocale[]? acceptLanguageList, bool[]? fallback);
[<Android.Runtime.Register("acceptLanguage", "([Landroid/icu/util/ULocale;[Z)Landroid/icu/util/ULocale;", "", ApiSince=24)>]
static member AcceptLanguage : Android.Icu.Util.ULocale[] * bool[] -> Android.Icu.Util.ULocale

Parameters

acceptLanguageList
ULocale[]

ordered array of acceptable locales (preferred are listed first)

fallback
Boolean[]

if non-null, a 1-element array containing a boolean to be set with the fallback status

Returns

one of the locales from the ULocale.getAvailableLocales() list, or null if none match

Attributes

Remarks

<strong>[icu]</strong> Based on an ordered array of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null. If fallback is non-null, it will contain true if a fallback locale (one not in the acceptLanguageList) was returned. The value on entry is ignored. ULocale will be one of the locales in availableLocales, or the ROOT ULocale if if a ROOT locale was used as a fallback (because nothing else in availableLocales matched). No ULocale array element should be null; behavior is undefined if this is the case. This function will choose a locale from the ULocale.getAvailableLocales() list as available.

Java documentation for android.icu.util.ULocale.acceptLanguage(android.icu.util.ULocale[], boolean[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

AcceptLanguage(String, Boolean[])

<strong>[icu]</strong> Based on a HTTP formatted list of acceptable locales, determine an available locale for the user.

[Android.Runtime.Register("acceptLanguage", "(Ljava/lang/String;[Z)Landroid/icu/util/ULocale;", "", ApiSince=24)]
public static Android.Icu.Util.ULocale? AcceptLanguage (string? acceptLanguageList, bool[]? fallback);
[<Android.Runtime.Register("acceptLanguage", "(Ljava/lang/String;[Z)Landroid/icu/util/ULocale;", "", ApiSince=24)>]
static member AcceptLanguage : string * bool[] -> Android.Icu.Util.ULocale

Parameters

acceptLanguageList
String

list in HTTP "Accept-Language:" format of acceptable locales

fallback
Boolean[]

if non-null, a 1-element array containing a boolean to be set with the fallback status

Returns

one of the locales from the ULocale.getAvailableLocales() list, or null if none match

Attributes

Remarks

<strong>[icu]</strong> Based on a HTTP formatted list of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null. If fallback is non-null, it will contain true if a fallback locale (one not in the acceptLanguageList) was returned. The value on entry is ignored. ULocale will be one of the locales in availableLocales, or the ROOT ULocale if if a ROOT locale was used as a fallback (because nothing else in availableLocales matched). No ULocale array element should be null; behavior is undefined if this is the case. This function will choose a locale from the ULocale.getAvailableLocales() list as available.

Java documentation for android.icu.util.ULocale.acceptLanguage(java.lang.String, boolean[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

AcceptLanguage(ULocale[], ULocale[], Boolean[])

<strong>[icu]</strong> Based on a list of acceptable locales, determine an available locale for the user.

[Android.Runtime.Register("acceptLanguage", "([Landroid/icu/util/ULocale;[Landroid/icu/util/ULocale;[Z)Landroid/icu/util/ULocale;", "", ApiSince=24)]
public static Android.Icu.Util.ULocale? AcceptLanguage (Android.Icu.Util.ULocale[]? acceptLanguageList, Android.Icu.Util.ULocale[]? availableLocales, bool[]? fallback);
[<Android.Runtime.Register("acceptLanguage", "([Landroid/icu/util/ULocale;[Landroid/icu/util/ULocale;[Z)Landroid/icu/util/ULocale;", "", ApiSince=24)>]
static member AcceptLanguage : Android.Icu.Util.ULocale[] * Android.Icu.Util.ULocale[] * bool[] -> Android.Icu.Util.ULocale

Parameters

acceptLanguageList
ULocale[]

list of acceptable locales

availableLocales
ULocale[]

list of available locales. One of these will be returned.

fallback
Boolean[]

if non-null, a 1-element array containing a boolean to be set with the fallback status

Returns

one of the locales from the availableLocales list, or null if none match

Attributes

Remarks

<strong>[icu]</strong> Based on a list of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null. If fallback is non-null, it will contain true if a fallback locale (one not in the acceptLanguageList) was returned. The value on entry is ignored. ULocale will be one of the locales in availableLocales, or the ROOT ULocale if if a ROOT locale was used as a fallback (because nothing else in availableLocales matched). No ULocale array element should be null; behavior is undefined if this is the case.

Java documentation for android.icu.util.ULocale.acceptLanguage(android.icu.util.ULocale[], android.icu.util.ULocale[], boolean[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

AcceptLanguage(String, ULocale[], Boolean[])

<strong>[icu]</strong> Based on a HTTP formatted list of acceptable locales, determine an available locale for the user.

[Android.Runtime.Register("acceptLanguage", "(Ljava/lang/String;[Landroid/icu/util/ULocale;[Z)Landroid/icu/util/ULocale;", "", ApiSince=24)]
public static Android.Icu.Util.ULocale? AcceptLanguage (string? acceptLanguageList, Android.Icu.Util.ULocale[]? availableLocales, bool[]? fallback);
[<Android.Runtime.Register("acceptLanguage", "(Ljava/lang/String;[Landroid/icu/util/ULocale;[Z)Landroid/icu/util/ULocale;", "", ApiSince=24)>]
static member AcceptLanguage : string * Android.Icu.Util.ULocale[] * bool[] -> Android.Icu.Util.ULocale

Parameters

acceptLanguageList
String

list in HTTP "Accept-Language:" format of acceptable locales

availableLocales
ULocale[]

list of available locales. One of these will be returned.

fallback
Boolean[]

if non-null, a 1-element array containing a boolean to be set with the fallback status

Returns

one of the locales from the availableLocales list, or null if none match

Attributes

Remarks

<strong>[icu]</strong> Based on a HTTP formatted list of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null. If fallback is non-null, it will contain true if a fallback locale (one not in the acceptLanguageList) was returned. The value on entry is ignored. ULocale will be one of the locales in availableLocales, or the ROOT ULocale if if a ROOT locale was used as a fallback (because nothing else in availableLocales matched). No ULocale array element should be null; behavior is undefined if this is the case.

Java documentation for android.icu.util.ULocale.acceptLanguage(java.lang.String, android.icu.util.ULocale[], boolean[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to