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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static org.slf4j.Logger` | `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InternationalisationService()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Locale` | `getLocale()`
    `String` | `getString(String key)`
    `String` | `getString(String key, Object[] params)`
    `void` | `setLocale(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 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 bundle
        `params` - 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 © 2015. All rights reserved.