@Singleton public class Langs extends Object
Constructor and Description |
---|
Langs(play.api.i18n.Langs langs) |
Modifier and Type | Method and Description |
---|---|
play.api.i18n.Langs |
asScala() |
List<Lang> |
availables()
The available languages.
|
Lang |
preferred(Collection<Lang> candidates)
Select a preferred language, given the list of candidates.
|
public List<Lang> availables()
These can be configured in {$code application.conf}, like so:
play.i18n.langs = ["fr", "en", "de"]
public Lang preferred(Collection<Lang> candidates)
Will select the preferred language, based on what languages are available, or return the default language if none of the candidates are available.
candidates
- The candidate languagespublic play.api.i18n.Langs asScala()