private Boolean Iszh () {locale locale = Getresources (). GetConfiguration (). Locale; String language = Locale.getlanguage (); if (Locale.getlanguage (). Equals (new Locale ( zh ", , return true Span style= "color: #000000;" >; else return false ; }
Reference: Http://docs.oracle.com/javase/6/docs/api/java/util/Locale.html#getLanguage ()
GetLanguage
GetLanguage ()
-
Returns The language code for this locale, which'll either be the empty string or a lowercase ISO 639 code.
Note:iso 639 is not a stable standard--some languages ' codes has changed. Locale ' s constructor recognizes both the new and the old codes for the languages whose codes has changed, but this functi On all returns the old code. If you want to check for a specific language whose code have changed, don ' t do
if (Locale.getlanguage (). equals ("he")) ... Instead, do
if (Locale.getlanguage (). Equals (new locale ("he", "", ""). GetLanguage ())) ...
-
-
-
See Also:
-
getdisplaylanguage ( )