play.i18n
Class Lang

java.lang.Object
  extended by play.api.i18n.Lang
      extended by play.i18n.Lang
All Implemented Interfaces:
java.io.Serializable, scala.Equals, scala.Product, scala.ScalaObject

public class Lang
extends play.api.i18n.Lang

A Lang supported by the application.

See Also:
Serialized Form

Field Summary
 play.api.i18n.Lang underlyingLang
           
 
Fields inherited from class play.api.i18n.Lang
bitmap$0
 
Constructor Summary
Lang(play.api.i18n.Lang underlyingLang)
           
 
Method Summary
static java.util.List<Lang> availables()
          Retrieve Lang availables from the application configuration.
 java.lang.String code()
          The Lang code (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(java.util.List<Lang> langs)
          Guess the preferred lang in the langs set passed as argument.
 java.util.Locale toLocale()
          Convert to a Java Locale value.
 
Methods inherited from class play.api.i18n.Lang
apply, apply$default$2, availables, canEqual, copy, copy$default$1, copy$default$2, defaultLang, equals, hashCode, init$default$2, preferred, productArity, productElement, productElements, productIterator, productPrefix, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

underlyingLang

public final play.api.i18n.Lang underlyingLang
Constructor Detail

Lang

public Lang(play.api.i18n.Lang underlyingLang)
Method Detail

language

public java.lang.String language()
A valid ISO Language Code.

Overrides:
language in class play.api.i18n.Lang

country

public java.lang.String country()
A valid ISO Country Code.

Overrides:
country in class play.api.i18n.Lang

code

public java.lang.String code()
The Lang code (such as fr or en-US).

Overrides:
code in class play.api.i18n.Lang

toLocale

public java.util.Locale toLocale()
Convert to a Java Locale value.

Overrides:
toLocale in class play.api.i18n.Lang

forCode

public static Lang forCode(java.lang.String code)
Create a Lang value from a code (such as fr or en-US).


availables

public static java.util.List<Lang> availables()
Retrieve Lang availables from the application configuration.


preferred

public static Lang preferred(java.util.List<Lang> langs)
Guess the preferred lang in the langs set passed as argument. The first Lang that matches an available Lang wins, otherwise returns the first Lang available in this application.