Constructor and Description |
---|
LangImpl(NinjaProperties ninjaProperties) |
Modifier and Type | Method and Description |
---|---|
void |
clearLanguage(Result result)
Clears the current language.
|
com.google.common.base.Optional<String> |
getLanguage(Context context,
com.google.common.base.Optional<Result> result)
Retrieve the current language or null if not set.
|
boolean |
isLanguageDirectlySupportedByThisApplication(String language)
application.conf usually contains the following:
application.languages=en,de
This little helper checks if the language is supported.
|
Result |
setLanguage(String locale,
Result result)
Force a language in Ninja framwork.
|
@Inject public LangImpl(NinjaProperties ninjaProperties)
public void clearLanguage(Result result)
Lang
clearLanguage
in interface Lang
public Result setLanguage(String locale, Result result)
Lang
setLanguage
in interface Lang
locale
- (fr, ja, it ...)public com.google.common.base.Optional<String> getLanguage(Context context, com.google.common.base.Optional<Result> result)
Lang
getLanguage
in interface Lang
public boolean isLanguageDirectlySupportedByThisApplication(String language)
Lang
isLanguageDirectlySupportedByThisApplication
in interface Lang
language
- The language to check (en, en-US etc)Copyright © 2013. All Rights Reserved.