BraindanceProtocol
BraindanceProtocol copied to clipboard
Need help with translation
~~Include i18n.lua library for multi-language support, since CET 1.9 now allow user to change font to show utf8 characters.~~
- ~~Need to have languages in separate files. (e.g.
en.lua
,cn.lua
,de.lua
...)~~ - ~~A language list file for the GUI to add more languages without needing to edit the
init.lua
(similar toprotocols.lua
)~~ - ~~Save user language setting into a
config.json
file~~
~i18n has been implemented in the i18-support branch.~
i18n has been merged into the main branch. Please PR your translations. Here is a guide on how to add a new language and update existing language files.
I did my part, added danish translation. Merged it into your branch: https://github.com/WolvenKit/BraindanceProtocol/pull/56
I did my part, added danish translation. Merged it into your branch: #56
Thank you.
https://github.com/WolvenKit/BraindanceProtocol/pull/60#issuecomment-769188772
I added a button in the language menu for updating the existing language files.
You need to add { "debug": true }
in config.json
for it to show up.
This is how it works:
- It will scan
init.lua
for strings insidei18n("some_string")
, and strings fromprotocols.lua
. - Then it will read and compare with the old language files.
- If the translation of this string exists in the old language files, it will copy it over.
- If the translation doesn't exist in the old language files, but exists in
en.lua
, it will copy it over fromen.lua
and comment it. - Else it will leave it blank and comment. (e.g.
-- window_title = ""
) - Save into a new file with "_update" as the suffix. (e.g. en_update.lua)
So, after merging my new-features-v2 branch, the menu is empty. Probably because of missing strings I suppose.
Adding the debug = true
in config.json
doesn't seem to work for me at least.
The menu won't load, if I add debug = true
in config.json
. It loads fine with the default value {"lang":"en"}
, but the menu is just empty.
So, after merging my new-features-v2 branch, the menu is empty. Probably because of missing strings I suppose.
I don't think protocols.lua
got merged properly. #63
The menu won't load, if I add
debug = true
inconfig.json
. It loads fine with the default value{"lang":"en"}
, but the menu is just empty.
Actually, it should be "debug" : true
, I confused the json format with lua table.
{"lang":"en", "debug":true}
Ah, damn. That's my bad, I totally overlooked the item_, _name, _tip and _btn.
I'll not be able to fix it for now, since I'm going to bed. Will fix it whenever tomorrow hopefully.
Ah, damn. That's my bad, I totally overlooked the item_, _name, _tip and _btn.
I'll not be able to fix it for now, since I'm going to bed. Will fix it whenever tomorrow hopefully.
Don't worry. I fixed it https://github.com/WolvenKit/BraindanceProtocol/pull/67
Haha god damnit, I just fixed all that haha. ~~It should be easily mergeable~~ Nevermind, I'll just remove my PR lol. It's essentially the same.
oop, sorry. Didn't know you were already working on that. I wrote a script for this before, so I thought I'll do it and save you some trouble. xD