SudokuFX
Loading...
Searching...
No Matches
fr.softsf.sudokufx.common.enums.I18n Enum Reference

Singleton enum for internationalization (i18n) support. More...

+ Collaboration diagram for fr.softsf.sudokufx.common.enums.I18n:

Public Member Functions

String getHostEnvironmentLanguageCode ()
 
String getLanguage ()
 
String getValue (final String key)
 Returns the localized string for the given key.
 
ObjectProperty< Locale > localeProperty ()
 
void setLanguageBasedOnTheHostEnvironment ()
 Sets the language to match host system (defaulting to English if not French).
 
synchronized I18n setLocaleBundle (final String i18n)
 Updates the current locale and bundle based on language code.
 

Static Public Member Functions

 [static initializer]
 

Public Attributes

 INSTANCE
 

Static Private Attributes

static ResourceBundle bundle
 
static final ResourceBundle ENGLISH_BUNDLE
 
static final ResourceBundle FRENCH_BUNDLE
 
static final String I_18_N_PATH = AppPaths.I18N_PATH.getPath()
 
static final ObjectProperty< Locale > LOCALE
 
static final Locale LOCALE_EN = Locale.of("en", "US")
 
static final Locale LOCALE_FR = Locale.of("fr", "FR")
 
static final Logger LOG = LoggerFactory.getLogger(I18n.class)
 

Detailed Description

Singleton enum for internationalization (i18n) support.

Manages language resources and locale synchronization.

Member Function Documentation

◆ [static initializer]()

fr.softsf.sudokufx.common.enums.I18n.[static initializer]
static

◆ getHostEnvironmentLanguageCode()

String fr.softsf.sudokufx.common.enums.I18n.getHostEnvironmentLanguageCode ( )
Returns
Host system language code.

◆ getLanguage()

String fr.softsf.sudokufx.common.enums.I18n.getLanguage ( )
Returns
Current language code ("en", "fr", etc.).

◆ getValue()

String fr.softsf.sudokufx.common.enums.I18n.getValue ( final String key)

Returns the localized string for the given key.

Parameters
keyResource key.
Returns
Translated value or fallback.

◆ localeProperty()

ObjectProperty< Locale > fr.softsf.sudokufx.common.enums.I18n.localeProperty ( )
Returns
Observable locale property.

◆ setLanguageBasedOnTheHostEnvironment()

void fr.softsf.sudokufx.common.enums.I18n.setLanguageBasedOnTheHostEnvironment ( )

Sets the language to match host system (defaulting to English if not French).

+ Here is the call graph for this function:

◆ setLocaleBundle()

synchronized I18n fr.softsf.sudokufx.common.enums.I18n.setLocaleBundle ( final String i18n)

Updates the current locale and bundle based on language code.

"EN" sets English; any other value defaults to French.

Parameters
i18nLanguage code.
Returns
Singleton instance.

Member Data Documentation

◆ bundle

ResourceBundle fr.softsf.sudokufx.common.enums.I18n.bundle
staticprivate

◆ ENGLISH_BUNDLE

final ResourceBundle fr.softsf.sudokufx.common.enums.I18n.ENGLISH_BUNDLE
staticprivate

◆ FRENCH_BUNDLE

final ResourceBundle fr.softsf.sudokufx.common.enums.I18n.FRENCH_BUNDLE
staticprivate

◆ I_18_N_PATH

final String fr.softsf.sudokufx.common.enums.I18n.I_18_N_PATH = AppPaths.I18N_PATH.getPath()
staticprivate

◆ INSTANCE

fr.softsf.sudokufx.common.enums.I18n.INSTANCE

◆ LOCALE

final ObjectProperty<Locale> fr.softsf.sudokufx.common.enums.I18n.LOCALE
staticprivate
Initial value:
=
new SimpleObjectProperty<>(Locale.getDefault())

◆ LOCALE_EN

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

◆ LOCALE_FR

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

◆ LOG

final Logger fr.softsf.sudokufx.common.enums.I18n.LOG = LoggerFactory.getLogger(I18n.class)
staticprivate

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