public class Lang
extends play.api.i18n.Lang
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
|
apply, apply, apply, apply$default$2, apply$default$3, apply$default$4, canEqual, copy, copy$default$1, defaultLang, equals, get, hashCode, jsonOReads, jsonOWrites, jsonTagReads, jsonTagWrites, locale, preferred, productArity, productElement, productIterator, productPrefix, satisfies, toString, unapply
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)
app
- the current application.@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)
app
- the currept applicationlangs
- the set of langs from which to guess the preferred