Topic: Untranslatable strings
GunChleoc![]() Topic Opener |
Posted at:
2013-10-11, 20:21 UTC+2.0
I ran
Edited:
2013-10-11, 20:21 UTC+2.0
Busy indexing nil values ![]() ![]() |
SirVer |
Posted at:
2013-10-12, 18:30 UTC+2.0
I will gladly add this in, it should be a very quick change too. Can you post some examples of how you would want to use it? Just like:
I am not very familiar with how gettext works, that's why I am asking how the interface must look. And you need to run utils/buidcat.py first. It will update the .pot files, then the game should run. 'make lang' will update the .po files. ![]() ![]() |
GunChleoc![]() Topic Opener |
Posted at:
2013-10-12, 19:31 UTC+2.0
We should make it look just like the C ones for consistency. For example:
Example result for the .po file:
The number of translation entries depends on the plural definitions for the target language. I also found a gettext-lua library on Github and this conversation about it.
ETA: I ran
Edited:
2013-10-12, 20:18 UTC+2.0
Busy indexing nil values ![]() ![]() |
SirVer |
Posted at:
2013-10-12, 21:32 UTC+2.0
The Lua extension we would not need, we already wrapped some of the gettext stuff for Widelands and getting an external library in is probably more work. But that this guy has made an extractor for lua is awesome - it is even merged into the main gettext release, but I could not figure out if there has been an official release since then. On my system, xgettext just coredumps when I run it on any texts.lua file. Do you know anything about this? If we can get extractions from Lua files, the rest should be very easy to add. If the official extractor is working for us, we can replace our custom extractor that is written in python (and would need extension to extract strings from ngettext and similar methods). After running buildcat.py, buidlocale.py should make working locales for you - that is essentially what make lang calls. ![]() ![]() |
GunChleoc![]() Topic Opener |
Posted at:
2013-10-12, 22:18 UTC+2.0
No, I am a complete rookie in this, I just stumbled across this while searching for the ngettext syntax for Lua. I have tried fiddling with gettext extraction once and failed gloriously lol
Already tried and failed. Tha locales build according to Terminal output, but the boost call still crashes Widelands Busy indexing nil values ![]() ![]() |
SirVer |
Posted at:
2013-10-12, 23:30 UTC+2.0
Mmh, I looked at the format string and I think the placholder is wrong. It must be either '%s' or '%1%' , if you want the first argument to be formatted as a string, it must be '%1$s'. This I found here: http://www.boost.org/doc/libs/1_54_0/libs/format/doc/format.html#syntax Does this work? ![]() ![]() |
GunChleoc![]() Topic Opener |
Posted at:
2013-10-13, 14:35 UTC+2.0
It does. You're my hero! Busy indexing nil values ![]() ![]() |
SirVer |
Posted at:
2013-10-13, 15:48 UTC+2.0
nono, you are ours :). Thanks for spending time doing this! ![]() ![]() |
GunChleoc![]() Topic Opener |
Posted at:
2013-10-13, 17:03 UTC+2.0
I have managed to fix 5 strings 2 of them still need testing though, so I haven't commited the changes yet. Any hints how I can get these on my screen?
Busy indexing nil values ![]() ![]() |
SirVer |
Posted at:
2013-10-13, 18:52 UTC+2.0
The first is part of the success string when you hover over a donkey/horse/oxfarm. The second appears when you enter the meta-server, i.e. when you click on internet game and connect to the server. ![]() ![]() |