Basics
Guides
API Reference
Basics
Guides
API Reference
[20:7] extends: EngineService
Wraps FXGL's LocalizationService, which translates string keys to the currently selected Language. Aussom users populate the service by calling addLanguageData with a Language and a key-value map (or a ResourceBundle), then switch languages via setSelectedLanguage. Translated strings are read with getLocalizedString. For UI bindings, localizedStringProperty returns a JavaFX StringBinding that updates automatically when the selected language changes.
LocalizationService (Ajo = null)
Creates a LocalizationService wrapper. With no argument constructs a new empty FXGL LocalizationService; with an AussomJavaObject wraps an existing one (used by fxgl.getLocalizationService).
Ajo is an optional AussomJavaObject around a LocalizationService.adopt (object Ajo)
Wraps an existing LocalizationService AussomJavaObject.
Ajo is an AussomJavaObject around a LocalizationService.A new wrapper.setSelectedLanguage (object Lang)
Sets the active language. Listeners on selectedLanguageProperty and any registered localizedStringProperty bindings fire.
Lang is a Language wrapper.this objectgetSelectedLanguage ()
Returns the currently selected Language.
A Language wrapper.addLanguageData (object Lang, Data)
Populates the service with translations for the given Language from a (string key, string value) map.
Lang is a Language wrapper.Data is a map of translation keys to translated strings.this objectgetLocalizedString (string Key)
Returns the translation for the given key in the currently selected language. Returns "MISSING_KEY!" if the key has no translation, or "Language is NONE" if no language is selected.
Key is the translation key.A string with the translation.getLocalizedStringIn (string Key, object Lang)
Returns the translation for the given key in the given language.
Key is the translation key.Lang is a Language wrapper.A string with the translation.selectedLanguageProperty ()
Returns the JavaFX ObjectProperty exposing the selected language; subscribe with a JavaFX ChangeListener to react to language switches.
An AussomJavaObject around an ObjectProperty.localizedStringProperty (string Key)
Returns a JavaFX StringBinding that yields the translation for the given key in the current language and updates automatically when the language changes.
Key is the translation key.An AussomJavaObject around a StringBinding.addLanguageDataBundle (object Lang, object BundleObj)
Loads translations from a Java ResourceBundle, the standard locale-resource format produced by .properties files.
Lang is a Language wrapper.BundleObj is an AussomJavaObject around a java.util.ResourceBundle.this objectaddLanguageDataLazy (object Lang, callback Cb)
Loads translations lazily: the supplier callback is invoked only when the language is first selected, returning a map of translation keys to strings.
Lang is a Language wrapper.Cb is a callback () -> map.this object
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.