API
Here's the API documentation for Aezen's localization module—your gateway to unlocking its full potential and integrating it seamlessly into your projects.
Class
Prop | Type | Default |
---|---|---|
path | string | - |
autoReload | boolean | null | false |
autoReloadInterval | number | null | 3000 |
async init()
Initializes the Localization instance by loading language files.
- Throws an
Error
if the path is invalid or language files cannot be processed.
getKey()
Retrieves a localized string for a given language and key, with optional placeholders.
- Throws an
Error
if the language, key, or placeholders are invalid. - Returns the localized
string
.
Prop | Type | Default |
---|---|---|
language | string | - |
key | string | - |
placeholders | object | - |
getRaw()
Retrieves the raw JSON language data for a given language.
- Throws an
Error
if the language is invalid. - Returns an raw data
object
of the language.
Prop | Type | Default |
---|---|---|
language | string | - |
getLanguages()
Retrieves the map of loaded languages.
- Returns a
Map
containing the loaded language data.
Last updated on