com.gisgraphy.service.impl
Class InternationalisationService

java.lang.Object
  extended by com.gisgraphy.service.impl.InternationalisationService
All Implemented Interfaces:
IInternationalisationService

public class InternationalisationService
extends java.lang.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
           
 
Constructor Summary
InternationalisationService()
           
 
Method Summary
 java.util.Locale getLocale()
           
 java.lang.String getString(java.lang.String key)
           
 java.lang.String getString(java.lang.String key, java.lang.Object[] params)
           
 void setLocale(java.util.Locale locale)
          set the locale, if not return the default JVM one.
 void setResourceBundle(org.springframework.context.support.ReloadableResourceBundleMessageSource resourceBundle)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final org.slf4j.Logger logger
Constructor Detail

InternationalisationService

public InternationalisationService()
Method Detail

getString

public java.lang.String getString(java.lang.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 java.lang.String getString(java.lang.String key,
                                  java.lang.Object[] params)
Specified by:
getString in interface IInternationalisationService
Parameters:
key - the key in the bundle
params - the param to inject in localised message
Returns:
the localized string or the key if not found

getLocale

public java.util.Locale getLocale()
Specified by:
getLocale in interface IInternationalisationService
Returns:
the current locale

setLocale

public void setLocale(java.util.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 © 2010. All Rights Reserved.