play.i18n
类 Lang

java.lang.Object
  继承者 play.i18n.Lang

public class Lang
extends java.lang.Object

Language support


字段摘要
static java.lang.ThreadLocal<java.lang.String> current
           
 
构造方法摘要
Lang()
           
 
方法摘要
static void change(java.lang.String locale)
          Change language for next requests
static void clear()
          Clears the current language - This wil trigger resolving language from request if not manually set.
static java.lang.String get()
          Retrieve the current language or null
static java.util.Locale getLocale()
           
static java.util.Locale getLocale(java.lang.String localeStr)
           
static boolean set(java.lang.String locale)
          Force the current language
static void setDefaultLocale()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

current

public static java.lang.ThreadLocal<java.lang.String> current
构造方法详细信息

Lang

public Lang()
方法详细信息

get

public static java.lang.String get()
Retrieve the current language or null

返回:
The current language (fr, ja, it ...) or null

set

public static boolean set(java.lang.String locale)
Force the current language

参数:
locale - (fr, ja, it ...)
返回:
false if the language is not supported by the application

clear

public static void clear()
Clears the current language - This wil trigger resolving language from request if not manually set.


change

public static void change(java.lang.String locale)
Change language for next requests

参数:
locale - (e.g. "fr", "ja", "it", "en_ca", "fr_be", ...)

setDefaultLocale

public static void setDefaultLocale()

getLocale

public static java.util.Locale getLocale()
返回:
the default locale if the Locale cannot be found otherwise the locale associated to the current Lang.

getLocale

public static java.util.Locale getLocale(java.lang.String localeStr)


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly