ErinaSugino / Starbound-SBR-Mod

Adult only modification "Sexbound Reborn" for the game Starbound.
GNU General Public License v3.0
26 stars 6 forks source link

How to add a new language to SBR? #21

Closed hoofcushion closed 1 year ago

hoofcushion commented 1 year ago

image I noticed that the "starbound.config" file has a "supportedLanguages" section that currently includes English and Russian languages. I would like to add a new language to SBR. But I'm not sure how is "supportedLanguages" work.

ErinaSugino commented 1 year ago

The supportedLanguages setting contains language objects, which in turn contain the necessary data (most importantly the languageCode) of said language.

Adding a language works by patching into the config file, adding an object "<language>": { "title": "<languageName>", "name": "<language>", "languageCode": "<languageCode>" }

Upon setting the defaultLanguage to your new language, SBR will then replace the language code in the file path from where configs are loaded.

Example given, when changing the language to russian, notifications are not loaded from /dialog/sexbound/en/... anymore, but instead from /dialog/sexbound/ru/...

ErinaSugino commented 1 year ago

Here is a detailed guide on how to create a translation mod: https://github.com/ErinaSugino/Starbound-SBR-Mod/wiki/Modding:-Translations

hoofcushion commented 1 year ago

Well, that helps