Add localization override support using custom params #4038
+121
−59
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding support to override localization strings via TweakUnits/TweakDefs.
This is what custom units look like when missing from translations...
This is what custom units look like when using custom param localization...
The use case for this is overriding translated human names and tooltips names via TweakUnits or TweakDefs. In my case I am working on an Evolution mod where eco is removed from the game and many different types of units can evolve(Instead of just commander) and they end up with really ugly names that include the unit namespace.
This proposed change may make the scavenger language code redundant since all the translations can be set via TweakDefs. The same thing may be true for including Evolving commander translations the I8N translations folder. Although there may still be a use case to package translations with the game for mods. I will defer to the mod authors on that.
Here is a sample Tweak Units to test the change...
{ armllt = { customparams = { i18n_en_humanname = "Test Name LLT", i18n_en_tooltip = "Test Tooltip LLT", }, }, }
I've also attached a sample TweakDefs you can use for testing evolving units with custom names.
EvolvesTweakDef2.txt