ninja.i18n
Class LangImpl
java.lang.Object
ninja.i18n.LangImpl
- All Implemented Interfaces:
- Lang
public class LangImpl
- extends Object
- implements Lang
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LangImpl
@Inject
public LangImpl(NinjaProperties ninjaProperties)
get
public String get(String key,
Locale locale,
Object... params)
- Returns a possibly formatted message.
- Specified by:
get
in interface Lang
- Parameters:
key
- params
-
- Returns:
- a pssibly formatted message or null if not found.
getAll
public Map<Object,Object> getAll(Locale locale,
Object... params)
- Description copied from interface:
Lang
- The language is determined by the provided locale or a suitable fallback.
This returns all resources as one map. Usually you want to use that
inside your templating engines so that they can access all correctly
translated messages.
- Specified by:
getAll
in interface Lang
getWithDefault
public String getWithDefault(String key,
String defaultMessage,
Locale locale,
Object... params)
- Returns a possibly formatted message.
- Specified by:
getWithDefault
in interface Lang
- Parameters:
key
- The keydefaultMessage
- The default message if the key isn't foundlocale
- The localeparams
- The params
- Returns:
- The formatted message
Copyright © 2012. All Rights Reserved.