Lang

play.api.i18n.Lang
See theLang companion object
case class Lang(locale: Locale)

A Lang supported by the application.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def asJava: Lang

Attributes

Returns

the Java version for this Lang.

Attributes

Returns

The country for this Lang, or "" if none exists.

Attributes

Returns

The language for this Lang.

def script: String

Attributes

Returns

The script tag for this Lang, or "" if none exists.

def toLocale: Locale

Convert to a Java Locale value.

Convert to a Java Locale value.

Attributes

Attributes

Returns

The variant tag for this Lang, or "" if none exists.

Deprecated methods

def satisfies(accept: Lang): Boolean

Whether this lang satisfies the given lang.

Whether this lang satisfies the given lang.

If the other lang defines a country code, then this is equivalent to equals, if it doesn't, then the equals is only done on language and the country of this lang is ignored.

This implements the language matching specified by RFC2616 Section 14.4. Equality is case insensitive as per Section 3.10.

Value parameters

accept

The accepted language

Attributes

Deprecated
true

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Concrete fields

lazy val code: String

The language tag (such as fr or en-US).

The language tag (such as fr or en-US).

Attributes