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(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> availableLangs)
Guess the preferred lang in the langs set passed as argument.
|
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, 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 codepublic static java.util.List<Lang> availables(Application app)
app
- the current application.public static Lang preferred(Application app, java.util.List<Lang> availableLangs)
app
- the currept applicationavailableLangs
- the set of langs from which to guess the preferred