public class Lang
extends play.api.i18n.Lang
Constructor and Description |
---|
Lang(play.api.i18n.Lang underlyingLang) |
Lang(Locale locale) |
Modifier and Type | Method and Description |
---|---|
static List<Lang> |
availables(Application app)
Retrieve Lang availables from the application configuration.
|
String |
code()
The language tag (such as fr or en-US).
|
String |
country()
A valid ISO Country Code.
|
static Lang |
defaultLang()
The default Lang (platform default).
|
static Lang |
forCode(String code)
Create a Lang value from a code (such as fr or en-US).
|
String |
language()
A valid ISO Language Code.
|
static Lang |
preferred(Application app,
List<Lang> availableLangs)
Guess the preferred lang in the langs set passed as argument.
|
String |
script()
The script tag for this Lang
|
Locale |
toLocale()
Convert to a Java Locale value.
|
String |
variant()
The variant tag for this Lang
|
apply, apply, apply, apply$default$2, apply$default$3, apply$default$4, asJava, canEqual, copy, copy$default$1, equals, get, hashCode, jsonOReads, jsonOWrites, jsonTagReads, jsonTagWrites, locale, logger, productArity, productElement, productElementName, productElementNames, productIterator, productPrefix, satisfies, toString, unapply
public Lang(play.api.i18n.Lang underlyingLang)
public Lang(Locale locale)
public String language()
language
in class play.api.i18n.Lang
public String country()
country
in class play.api.i18n.Lang
public String script()
script
in class play.api.i18n.Lang
public String variant()
variant
in class play.api.i18n.Lang
public String code()
code
in class play.api.i18n.Lang
public Locale toLocale()
toLocale
in class play.api.i18n.Lang
public static Lang forCode(String code)
code
- the language codepublic static List<Lang> availables(Application app)
app
- the current application.public static Lang preferred(Application app, List<Lang> availableLangs)
app
- the currept applicationavailableLangs
- the set of langs from which to guess the preferredpublic static Lang defaultLang()