sf2.locales
Locales are the languages the game can show. Register one to add a new language to the settings menu. Get sf2 with local sf2 = require("sf2").
sf2.locales.register
Section titled “sf2.locales.register”Add a language option to the game.
Signature: sf2.locales.register(definition)
Parameters
| Parameter | Type | Required |
|---|---|---|
definition |
LocaleDefinition |
Required |
Fields of LocaleDefinition
| Field | Type | Required | Meaning |
|---|---|---|---|
id |
string |
Required | — |
name |
string |
Required | — |
locale |
string |
Required | — |
alias |
string |
Optional | — |
is_asian |
boolean |
Optional | — |
file_icon |
string |
Optional | — |
file_icon_selected |
string |
Optional | — |
loader_image |
string |
Optional | — |
preloader_image |
string |
Optional | — |
fonts |
Fonts |
Optional | — |
Returns: The qualified locale ID.
When: Entrypoint.
local language_id = sf2.locales.register { id = "custom_english", name = "Custom English", locale = "eng",}This registers only the language option; put the strings in localization files (see the reskin guide). If you supply fonts, content, title and button are required, and font and image names must be existing game resources.