tweakeroo icon indicating copy to clipboard operation
tweakeroo copied to clipboard

The setting only works for single player does not render according to the language file

Open erertertet opened this issue 1 year ago • 5 comments

As dealing with the translation according to the template in en_US.json in 1.20.x branch, I set the language file of zh_cn.json as:

{ "disableBatSpawning": "测试", "config.comment.disablebatspawning": "测试文本", }

but in the running demo it have shown something like:

image

The same also happened to some other setting that only apply to single player entries

erertertet avatar Apr 11 '24 01:04 erertertet

The single player message is applied a different way, and a bit more hard coded.

Found it: "tweakeroo.label.config_comment.single_player_only"

sakura-ryoko avatar Apr 11 '24 05:04 sakura-ryoko

I meant the "disablebatSpawning" string, that is not replaced by the string specified in language file

erertertet avatar Apr 11 '24 14:04 erertertet

Looks like you may actually want to use this format instead, or rather additionally, for the config names: image

This stuff is somewhat of a mess in the old code, as some stuff uses getPrettyName() and some stuff uses getConfigGuiDisplayName(). image image

So basically I think you want to provide the translation both for disableBatSpawning and also config.name.disablebatspawning. And the latter will be made as that gold/orange text automatically for those "single player only" configs in Tweakeroo. image

maruohon avatar Apr 11 '24 17:04 maruohon

It kind of worked out if I just use all the config name translation by just do

{"config.name.aaabbbccc": "<translation>"}

instead of

{"aaaBbbbCcc": "<translation>"}

image

should I use both of them or just use one of them as the translation.json?

erertertet avatar Apr 11 '24 18:04 erertertet

I think you need the short form for any of the toggle messages to be translated at least.

maruohon avatar Apr 11 '24 18:04 maruohon