DefaultLangs

play.api.i18n.DefaultLangs
@Singleton
class DefaultLangs(val availables: Seq[Lang]) extends Langs

Attributes

Graph
Supertypes
trait Langs
class Object
trait Matchable
class Any

Members list

Value members

Constructors

def this()

Inherited methods

def asJava: Langs

Attributes

Returns

the Java version for this Langs.

Inherited from:
Langs
def preferred(candidates: Seq[Lang]): Lang

Select a preferred language, given the list of candidates.

Select a preferred language, given the list of candidates.

Will select the preferred language, based on what languages are available, or return the default language if none of the candidates are available.

This implements the Matching of Language Tags specified in RFC 4647 section 3.4.

Value parameters

candidates

List of candidates ordered by user's preferences

Attributes

Inherited from:
Langs

Concrete fields

The available languages.

The available languages.

These can be configured in application.conf, like so:

play.i18n.langs = ["fr", "en", "de"]

Attributes