Internationalization (i18n) support. More...
Public Member Functions | |
| I18n () | |
| Initializes bundles and binds the locale property to the system default. | |
| String | getHostEnvironmentLanguageCode () |
| String | getLanguage () |
| String | getValue (final String key) |
| Retrieves a translated string from the active bundle. | |
| ReadOnlyObjectProperty< Locale > | localeProperty () |
| void | setLanguageBasedOnTheHostEnvironment () |
| Matches the application language to the host environment. | |
| I18n | setLocaleBundle (final String i18n) |
| Updates the current bundle and synchronizes the locale property. | |
Public Attributes | |
| INSTANCE | |
Private Attributes | |
| ResourceBundle | bundle |
| final ResourceBundle | englishBundle |
| final ResourceBundle | frenchBundle |
| final ReadOnlyObjectWrapper< Locale > | locale |
| Observable locale property. | |
Static Private Attributes | |
| static final Logger | LOG = LoggerFactory.getLogger(I18n.class) |
Internationalization (i18n) support.
Manages language resources and locale synchronization through JavaFX properties. Technical Note: Accessing INSTANCE triggers the initialization of JavaFX properties, requiring an active JavaFX Toolkit.
| fr.softsf.sudokufx.common.enums.I18n.I18n | ( | ) |
Initializes bundles and binds the locale property to the system default.
Triggers JavaFX Toolkit check via ReadOnlyObjectWrapper.
| String fr.softsf.sudokufx.common.enums.I18n.getHostEnvironmentLanguageCode | ( | ) |
| String fr.softsf.sudokufx.common.enums.I18n.getLanguage | ( | ) |
| String fr.softsf.sudokufx.common.enums.I18n.getValue | ( | final String | key | ) |
Retrieves a translated string from the active bundle.
| key | Resource bundle key. |
| ReadOnlyObjectProperty< Locale > fr.softsf.sudokufx.common.enums.I18n.localeProperty | ( | ) |
| void fr.softsf.sudokufx.common.enums.I18n.setLanguageBasedOnTheHostEnvironment | ( | ) |
Matches the application language to the host environment.
Defaults to English for any language other than French.
| I18n fr.softsf.sudokufx.common.enums.I18n.setLocaleBundle | ( | final String | i18n | ) |
Updates the current bundle and synchronizes the locale property.
| i18n | Language code. "EN" for English, defaults to French otherwise. |
|
private |
|
private |
|
private |
| fr.softsf.sudokufx.common.enums.I18n.INSTANCE |
|
private |
Observable locale property.
Requires JavaFX Toolkit for instantiation.
|
staticprivate |