Check trick for translation....
Moderator: Forum Moderators
Check trick for translation....
Hi there!
Today someone submitted some updates for italian translation regarding mainly bad variables translation ( i.e. "$number" in source and "$num" in translation, or any sort of mistake like that). This remind me and "old trick" to check this kind of errors:
Open an xterm (Yes, my home computer has no windows... if not, you can install mingw and use that shell...)
cd wesnoth/po/wesnoth-utbs
fgrep $ it.po
At the bottom of the output you can find something like
Now check the output: you can notice that $unit.name and $amount are correctly translated, but the last 4 lines state that $heat_damage was translated as $temp_damage....
P.S: Since in this example the strings are not used in translation ( the initial "#~" ) the translation is not affected, but I think that the trick is effective and worth to be shared.
Today someone submitted some updates for italian translation regarding mainly bad variables translation ( i.e. "$number" in source and "$num" in translation, or any sort of mistake like that). This remind me and "old trick" to check this kind of errors:
Open an xterm (Yes, my home computer has no windows... if not, you can install mingw and use that shell...)
cd wesnoth/po/wesnoth-utbs
fgrep $ it.po
At the bottom of the output you can find something like
Code: Select all
#. [message]: speaker=$victim_id
#. [message]: speaker=$victim_id
msgid "No, $unit.name can’t die now!"
msgstr "No, $unit.name non deve morire adesso!"
msgid "+$amount XP"
msgstr "+$amount PE"
#~ "will just take $heat_damage damage per turn when flying over lava, though "
#~ "$heat_damage damage at the start of each turn. This heat damage can "
#~ "$temp_damage punti di danno per turno quando si librano sulla lava, ma "
#~ "caverna riceveranno $temp_damage punti di danno all’inizio di ogni turno. "
P.S: Since in this example the strings are not used in translation ( the initial "#~" ) the translation is not affected, but I think that the trick is effective and worth to be shared.
- Elvish_Hunter
- Posts: 1575
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: Check trick for translation....
Good job, Antro!
I just want to add that this trick can be improved by combining it with the
find
and xargs
commands. For example, if you cd your terminal into the wesnoth/po directory, find can look for every "it.po" file and xargs can pass those file names to fgrep (which by itself is equivalent to grep -F). Like this:
Code: Select all
wesnoth/po$ find -name it.po | xargs grep -Fn '$'
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
Re: Check trick for translation....
There's a tool that will do the string comparisons for you too . There's discussion of it in #4436.
https://github.com/stevecotton/i18nspector/tree/wesnoth_markup_language - I just pushed an update to the README (scroll down on that webpage to see a quickstart guide).
https://github.com/stevecotton/i18nspector/tree/wesnoth_markup_language - I just pushed an update to the README (scroll down on that webpage to see a quickstart guide).