ax.localization¶
Source: gamemode/framework/libraries/sh_localization.lua
Localization system for multi-language support.
Documented functions: 4
Functions¶
ax.localization:AddPhrase(lang, phrase, translation)ax.localization:GetCurrentLanguage()ax.localization:GetPhrase(phrase, ...)ax.localization:Register(name, translation)
ax.localization:AddPhrase(lang, phrase, translation)¶
Adds or updates a single phrase translation for a language.
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
lang |
string |
The language code (e.g., "en", "es", "fr") |
phrase |
string |
The phrase key to add/update |
translation |
string |
The translated string |
Usage
ax.localization:GetCurrentLanguage()¶
Gets the current language code for the client.
Checks the configuration and console variable to determine the active language.
Realm: shared
Returns
string: The current language code (e.g., "en", "es", "fr")
ax.localization:GetPhrase(phrase, ...)¶
Get a localized phrase in the client's language.
Looks up a phrase key and returns the translation for the current language.
Falls back to the phrase key if no translation is found.
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
phrase |
string |
The phrase key to look up |
... |
any |
Optional format arguments for string.format |
Returns
string: The translated phrase or the original phrase key if not found
Usage
ax.localization:Register(name, translation)¶
Register a localization language with translation table.
Adds or merges translation strings for a specific language code.
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
name |
string |
The language code (e.g., "en", "es", "fr") |
translation |
table |
Table of phrase keys to translated strings |
Usage