Skip to content

Language System Basis#6172

Open
Pepe20129 wants to merge 32 commits intoHarbourMasters:developfrom
Pepe20129:lang_data
Open

Language System Basis#6172
Pepe20129 wants to merge 32 commits intoHarbourMasters:developfrom
Pepe20129:lang_data

Conversation

@Pepe20129
Copy link
Contributor

@Pepe20129 Pepe20129 commented Jan 19, 2026

Introduces the basis for a language system to allow the UI to be translated to any language and/or have the text changed by mods.
A lot of things would require more work but, for a proof of concept, this PR makes all randomizer trick names & descriptions translatable (currently not re-loadable at runtime as that would require deeper changes and this is already merge conflict hell every time a trick is touched).
The language change widget is currently not registered into the UI as it should probably be improved (and everything made re-loadable) before being accessible.

The system works by passing it a "translation path" which is resolved in the .json including object indentation. If the resulting json object is a list of strings, instead of a string, they get concatenated (purely for organization/QoL).

Build Artifacts


#define RANDO_ENUM_ITEM(enum) { enum, #enum },

std::unordered_map<RandomizerTrick, std::string> trickNames = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this map wouldn't be needed if json identified tricks by their codename like settings do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to not use the codename in this case, if a trick has its name changed, it probably also needs a change to the name & description, using the rg in the lang key makes it easier to notice.
Also, this is just the introduction of the system, there's not even a way to switch language at runtime (or at all in terms of UI) so it can be rethought later.

@serprex serprex requested a review from Pepper0ni March 9, 2026 19:08
Copy link
Member

@serprex serprex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, would like to get other's thoughts here tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants