SudokuFX
Loading...
Searching...
No Matches
fr.softsf.sudokufx.utils.I18n Class Reference

Utility class for internationalization (i18n) support. More...

+ Collaboration diagram for fr.softsf.sudokufx.utils.I18n:

Static Public Member Functions

static String getLanguage ()
 Gets the current language of the application.
 
static String getValue (final String key)
 Retrieves the localized string value for a given key.
 
static void setLocaleBundle (final String i18n)
 Sets the current language for the application.
 

Private Member Functions

 I18n ()
 Private constructor to prevent instantiation of this utility class.
 

Static Private Attributes

static ResourceBundle bundle = FRENCH_BUNDLE
 
static final ResourceBundle ENGLISH_BUNDLE = ResourceBundle.getBundle(I_18_N_PATH, LOCALE_EN)
 
static final ResourceBundle FRENCH_BUNDLE = ResourceBundle.getBundle(I_18_N_PATH, LOCALE_FR)
 
static final String I_18_N_PATH = MyEnums.Paths.I18N_PATH.getPath()
 
static final Locale LOCALE_EN = Locale.of("en", "US")
 
static final Locale LOCALE_FR = Locale.of("fr", "FR")
 

Detailed Description

Utility class for internationalization (i18n) support.

This class manages language resources and provides methods to switch between languages and retrieve localized strings.

Constructor & Destructor Documentation

◆ I18n()

fr.softsf.sudokufx.utils.I18n.I18n ( )
private

Private constructor to prevent instantiation of this utility class.

Member Function Documentation

◆ getLanguage()

static String fr.softsf.sudokufx.utils.I18n.getLanguage ( )
static

Gets the current language of the application.

Returns
The language code as a String (e.g., "fr" for French, "en" for English)

◆ getValue()

static String fr.softsf.sudokufx.utils.I18n.getValue ( final String key)
static

Retrieves the localized string value for a given key.

Parameters
keyThe String key representing the desired localized string
Returns
The localized String value
Exceptions
java.util.MissingResourceExceptionif the key is not found in the resource bundle

◆ setLocaleBundle()

static void fr.softsf.sudokufx.utils.I18n.setLocaleBundle ( final String i18n)
static

Sets the current language for the application.

Parameters
i18nThe String representation of the language ("EN" for English, or any other value for French)

Member Data Documentation

◆ bundle

ResourceBundle fr.softsf.sudokufx.utils.I18n.bundle = FRENCH_BUNDLE
staticprivate

◆ ENGLISH_BUNDLE

final ResourceBundle fr.softsf.sudokufx.utils.I18n.ENGLISH_BUNDLE = ResourceBundle.getBundle(I_18_N_PATH, LOCALE_EN)
staticprivate

◆ FRENCH_BUNDLE

final ResourceBundle fr.softsf.sudokufx.utils.I18n.FRENCH_BUNDLE = ResourceBundle.getBundle(I_18_N_PATH, LOCALE_FR)
staticprivate

◆ I_18_N_PATH

final String fr.softsf.sudokufx.utils.I18n.I_18_N_PATH = MyEnums.Paths.I18N_PATH.getPath()
staticprivate

◆ LOCALE_EN

final Locale fr.softsf.sudokufx.utils.I18n.LOCALE_EN = Locale.of("en", "US")
staticprivate

◆ LOCALE_FR

final Locale fr.softsf.sudokufx.utils.I18n.LOCALE_FR = Locale.of("fr", "FR")
staticprivate

The documentation for this class was generated from the following file: