com.gisgraphy.service.impl
Class InternationalisationService
java.lang.Object
com.gisgraphy.service.impl.InternationalisationService
- All Implemented Interfaces:
- IInternationalisationService
public class InternationalisationService
- extends Object
- implements IInternationalisationService
Allow i18n and L10n When we are not in a web context
- Author:
- David Masclet
Field Summary |
static org.slf4j.Logger |
logger
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
public static final org.slf4j.Logger logger
InternationalisationService
public InternationalisationService()
getString
public String getString(String key)
- Specified by:
getString
in interface IInternationalisationService
- Parameters:
key
- the key in the bundle
- Returns:
- the localized string or the key if not found
getString
public String getString(String key,
Object[] params)
- Specified by:
getString
in interface IInternationalisationService
- Parameters:
key
- the key in the bundleparams
- the param to inject in localised message
- Returns:
- the localized string or the key if not found
getLocale
public Locale getLocale()
- Specified by:
getLocale
in interface IInternationalisationService
- Returns:
- the current locale
setLocale
public void setLocale(Locale locale)
- Description copied from interface:
IInternationalisationService
- set the locale, if not return the default JVM one.
- Specified by:
setLocale
in interface IInternationalisationService
- Parameters:
locale
- the locale to set
setResourceBundle
public void setResourceBundle(org.springframework.context.support.ReloadableResourceBundleMessageSource resourceBundle)
Copyright © 2012. All Rights Reserved.