Skip to content

Add handling of localization tokens to parsers#46

Merged
jaghaimo merged 8 commits intojaghaimo:masterfrom
Dasch0:master
Dec 15, 2025
Merged

Add handling of localization tokens to parsers#46
jaghaimo merged 8 commits intojaghaimo:masterfrom
Dasch0:master

Conversation

@Dasch0
Copy link
Contributor

@Dasch0 Dasch0 commented Dec 14, 2025

Neb now has localization support, and as a result exported fleet files contain localization tokens where they previously contained regular string constants.

This is mostly a problem for fleet file sharing via the discord bot, where the missile descriptions are all tokenized and appear like:
image

This PR pulls the english localization data from the resources.assets file in the latest version of nebulous, and adds a localizer regex function to attempt to replace all tokens with their english text values when calling parse_any

Currently testing this PR out in a few servers using my fork of hazel

and finally attached profiler runs generating ~40 new fleet images - seems that the localizer isn't taking too long to run compared to the rest of the parsing.
cProfile Results localize.html
cProfile Results parse_any.html

@jaghaimo jaghaimo merged commit 36692ef into jaghaimo:master Dec 15, 2025
1 check passed
@jaghaimo
Copy link
Owner

Thanks, @Dasch0. I will update Hazel today.

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.

2 participants