public class Lang
extends play.api.i18n.Lang
Modifier and Type | Field and Description |
---|---|
play.api.i18n.Lang |
underlyingLang
Deprecated.
All instances of play.i18n.Lang can be used as a play.api.i18n.Lang (2.5.1)
|
Constructor and Description |
---|
Lang(play.api.i18n.Lang underlyingLang) |
Lang(java.util.Locale locale) |
Modifier and Type | Method and Description |
---|---|
static java.util.List<Lang> |
availables()
Deprecated.
Please use Lang.availables(app), since 2.5.0
|
static java.util.List<Lang> |
availables(Application app)
Retrieve Lang availables from the application configuration.
|
java.lang.String |
code()
The language tag (such as fr or en-US).
|
java.lang.String |
country()
A valid ISO Country Code.
|
static Lang |
forCode(java.lang.String code)
Create a Lang value from a code (such as fr or en-US).
|
java.lang.String |
language()
A valid ISO Language Code.
|
static Lang |
preferred(Application app,
java.util.List<Lang> langs)
Guess the preferred lang in the langs set passed as argument.
|
static Lang |
preferred(java.util.List<Lang> langs)
Deprecated.
Please use preferred(app, langs). Deprecated since 2.5.0.
|
java.lang.String |
script()
The script tag for this Lang
|
java.util.Locale |
toLocale()
Convert to a Java Locale value.
|
java.lang.String |
variant()
The variant tag for this Lang
|
$lessinit$greater$default$2, apply, apply, apply, apply, apply$default$2, apply$default$3, apply$default$4, canEqual, copy, defaultLang, equals, get, hashCode, locale, preferred, productArity, productElement, productIterator, productPrefix, satisfies, toString, unapply
@Deprecated public final play.api.i18n.Lang underlyingLang
public Lang(play.api.i18n.Lang underlyingLang)
public Lang(java.util.Locale locale)
public java.lang.String language()
language
in class play.api.i18n.Lang
public java.lang.String country()
country
in class play.api.i18n.Lang
public java.lang.String script()
script
in class play.api.i18n.Lang
public java.lang.String variant()
variant
in class play.api.i18n.Lang
public java.lang.String code()
code
in class play.api.i18n.Lang
public java.util.Locale toLocale()
toLocale
in class play.api.i18n.Lang
public static Lang forCode(java.lang.String code)
code
- the language code@Deprecated public static java.util.List<Lang> availables()
public static java.util.List<Lang> availables(Application app)
@Deprecated public static Lang preferred(java.util.List<Lang> langs)
langs
- the set of langs from which to guess the preferredpublic static Lang preferred(Application app, java.util.List<Lang> langs)
langs
- the set of langs from which to guess the preferred