trans to spanish

Discuss, plan, and make Translations for FreeOrion
Message
Author
User avatar
Oberlus
Cosmic Dragon
Posts: 2695
Joined: Mon Apr 10, 2017 4:25 pm

Re: trans to spanish

#31 Post by Oberlus » Sun Apr 12, 2020 11:02 am

I'm doing the following:

Code: Select all

./check/st-tool.py sync default/stringtables/en.txt default/stringtables/es.txt > default/stringtables/es.new.txt
mv default/stringtables/es.new.txt default/stringtables/es.txt
meld default/stringtables/en.txt default/stringtables/es.txt
And I'm working in meld, which is quite annoying due to lack of line wrapping, but I like to see the English original values and sometimes it is helpful to be able to copy the English values for translation.

If the st-tool sync command copied the English values along the time of syncing it would be easy to work directly and only with the es.txt file. So, instead of

Code: Select all

#*SHIP_NAME_OTHER
#* <not translated 2015-04-15 19:23:23>
I would be seeing something like

Code: Select all

#*SHIP_NAME_OTHER
#*Eternal September <not translated 2015-04-15 19:23:23>
That's a suggestion.


Now I want to try adrian_broher's editor (WIP) instead of meld, but first I want to "save" the work I've done up to now.

To see where I am, I first do

Code: Select all

freeorion$ ./check/st-tool.py compare default/stringtables/en.txt default/stringtables/es.txt
default/stringtables/es.txt:24: Value of key 'OK' is identical to reference file default/stringtables/en.txt:24
[...]
default/stringtables/es.txt:203: Key 'NEW_ASTEROIDS_SUFFIX' contains translation for pure reference in reference file value default/stringtables/en.txt:203
[...]
default/stringtables/es.txt:387: Value of key 'SD_SCOUT_2' is older than reference file value default/stringtables/en.txt:387
[...]
default/stringtables/es.txt:447: Value of key 'SD_ROBOTIC_OUTPOST' has no translation compared to reference file default/stringtables/en.txt:447
[...]
default/stringtables/es.txt:19348: Value of key 'MONSTER_NAMES' has no translation compared to reference file default/stringtables/en.txt:19352
Summary comparing 'default/stringtables/es.txt' against 'default/stringtables/en.txt':
    Keys translated - 4286/4286 (100.0%)
    Keys not in reference - 0
    Value is reference - 15
    Values layout mismatch - 1
    Values older than reference - 16
    Values untranslated - 2905
    Values same as reference - 38
I suspect I should not be using st-tool compare with the file that is full of synced untranslated entries (because it ain't true there is a 100% keys translated).

So I can see
  1. the values that I have copied identical to the English ones (to be removed): en.txt "OK" -> es.txt "OK"
  2. the values that I have copied that are "pure reference" (to be removed??): en.txt [[PT_ASTEROIDS]] -> es.txt [[PT_ASTEROIDS]]
  3. the entries that I have left unchanged but that could still be the right translation: en.txt "" -> es.txt "Explorador II"
  4. the entries copied in the es.txt file by the st-tool sync command that I have not translated:

    Code: Select all

    #*SD_ROBOTIC_OUTPOST
    #* <not translated 2015-12-07 10:50:43>
Many doubts:

The 1st (and 2nd, right?) cases are to be removed. Can the st-tool remove identical translations and pure references? Which would be the command?

The 4th case have thousands of cases, and it seems obvious they should not go into a PR to merge into master. What is the st-tool command to remove the synced untranslated entries?

The 3rd cases I want to leave them as they are. If I do whatever I'm told to solve the other cases, the old entries won't be lost, right?


Final doubt, I tried st-tool.py check, which was helpful to detect some errors I had (like translating some values but leaving its keys commented). But I don't understand the following error message:

Code: Select all

freeorion$ ./check/st-tool.py check default/stringtables/es.txt 
Traceback (most recent call last):
  File "./check/st-tool.py", line 587, in <module>
    sys.exit(args.action(args))
  File "./check/st-tool.py", line 477, in check_action
    for match in re.finditer(INTERNAL_REFERENCE_PATTERN.format('.*?'), entry.value):
  File "/usr/lib/python3.6/re.py", line 229, in finditer
    return _compile(pattern, flags).finditer(string)
TypeError: expected string or bytes-like object
"Expected string or bytes-like object"
I suspect it means in the es.txt I'm working on. But in which line? It has 19357 lines now.

Please notice this is still the es.txt file with thousands of "#* <not translated ..." entries.


Finally, the help message for the st-tool could be more informative:

Code: Select all

freeorion$ ./check/st-tool.py -h
usage: st-tool.py [-h] {format,sync,rename-key,check,compare} ...

positional arguments:
  {format,sync,rename-key,check,compare}
    format              format a string table and exit
    sync                synchronize two string tables and exit
    rename-key          rename all occurences of a key within a stringtable
                        and exit
    check               check a stringtable for consistency and exit
    compare             compare two string tables and exit

optional arguments:
  -h, --help            show this help message and exit
What does "format" do exactly? What are the parameters for it? Just the string table you want to "format"? Should its output be redirected or it makes changes directly in the input file?
I can try that and figure out by myself, but it's helpful for dummies to know all of that in advance (In fact I did figured it out, but doing "strange" things first like copying the es.txt to a temporal file, fearing that format could do something to it I don't wont, which cause st-tool to throw error messages such as "fatal: no such parth es_tmp.txt in HEAD" plus the traceback, then I kept the tmp file just in case and called st-tool format upon the es.txt file, which outputed the formated file into stdout, and finally I invoked the command as it should be, redirecting the output to a temporal file).
The same applies for all other commands. It might not be obvious to newcomers when you compare two files which one is the reference, or that you need to redirect the output of of the sync command to a new file (I got no trouble with those since Marcel told me the exact commands in this thread, but yo get the point).

User avatar
adrian_broher
Programmer
Posts: 1154
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: trans to spanish

#32 Post by adrian_broher » Sun Apr 12, 2020 11:24 am

Oberlus wrote:
Sun Apr 12, 2020 11:02 am
And I'm working in meld, which is quite annoying due to lack of line wrapping, but I like to see the English original values and sometimes it is helpful to be able to copy the English values for translation.
There is a setting for that:

Image
Oberlus wrote:
Sun Apr 12, 2020 11:02 am
If the st-tool sync command copied the English values along the time of syncing it would be easy to work directly and only with the es.txt file. So, instead of

Code: Select all

#*SHIP_NAME_OTHER
#* <not translated 2015-04-15 19:23:23>
I would be seeing something like

Code: Select all

#*SHIP_NAME_OTHER
#*Eternal September <not translated 2015-04-15 19:23:23>
That's a suggestion.
This is intentional. Translators should work against the reference table. Also it makes it harder to parse the comment line (which one of the pieces to do staleness detection).

You can also use the Arrows at the center separator to copy hunks from one to the other file.
Last edited by adrian_broher on Sun Apr 12, 2020 11:58 am, edited 1 time in total.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
Oberlus
Cosmic Dragon
Posts: 2695
Joined: Mon Apr 10, 2017 4:25 pm

Re: trans to spanish

#33 Post by Oberlus » Sun Apr 12, 2020 11:46 am

adrian_broher wrote:
Sun Apr 12, 2020 11:24 am
There is a setting for that:
The meld I installed from ubuntu repo doesn't have a preferences window. I'll search for a better version.
You can also use the Arrows at the center separator to copy hunks from one to the other file.
Yes, I was using those arrows, quite helpful.

User avatar
adrian_broher
Programmer
Posts: 1154
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: trans to spanish

#34 Post by adrian_broher » Sun Apr 12, 2020 11:54 am

Oberlus wrote:
Sun Apr 12, 2020 11:02 am
To see where I am, I first do

Code: Select all

freeorion$ ./check/st-tool.py compare default/stringtables/en.txt default/stringtables/es.txt
default/stringtables/es.txt:24: Value of key 'OK' is identical to reference file default/stringtables/en.txt:24
[...]
default/stringtables/es.txt:203: Key 'NEW_ASTEROIDS_SUFFIX' contains translation for pure reference in reference file value default/stringtables/en.txt:203
[...]
default/stringtables/es.txt:387: Value of key 'SD_SCOUT_2' is older than reference file value default/stringtables/en.txt:387
[...]
default/stringtables/es.txt:447: Value of key 'SD_ROBOTIC_OUTPOST' has no translation compared to reference file default/stringtables/en.txt:447
[...]
default/stringtables/es.txt:19348: Value of key 'MONSTER_NAMES' has no translation compared to reference file default/stringtables/en.txt:19352
Summary comparing 'default/stringtables/es.txt' against 'default/stringtables/en.txt':
    Keys translated - 4286/4286 (100.0%)
    Keys not in reference - 0
    Value is reference - 15
    Values layout mismatch - 1
    Values older than reference - 16
    Values untranslated - 2905
    Values same as reference - 38
I suspect I should not be using st-tool compare with the file that is full of synced untranslated entries (because it ain't true there is a 100% keys translated).
This is an output naming bug, note the difference between "Keys" and "Values" . The first entry should be more like: "Keys matching found" as the keys both exist in reference and source reference table. There are also warnings for keys only in reference file and keys only in source file (which are not displayed here as there are no such cases in the es file), which is relevant to catch incomplete key renames across string tables.
So I can see
[*] the values that I have copied identical to the English ones (to be removed): en.txt "OK" -> es.txt "OK"
[*] the values that I have copied that are "pure reference" (to be removed??): en.txt [[PT_ASTEROIDS]] -> es.txt [[PT_ASTEROIDS]]
The idea is to not copy over entries, which have the same content within the localization. This applies for identical words language across languages (boost::format only entries, "OK" or species names for example) or pure references (entries only containing a '[[]]' reference, refering to another entry within the string table), which will most of the time be the same across languages.
[*] the entries that I have left unchanged but that could still be the right translation: en.txt "" -> es.txt "Explorador II"
The `compare` command is for statistics gathering, so you have a general idea of the problematic areas within the string file.

The 1st (and 2nd, right?) cases are to be removed. Can the st-tool remove identical translations and pure references? Which would be the command?
This should be covered by `st-tool sync`
The 4th case have thousands of cases, and it seems obvious they should not go into a PR to merge into master. What is the st-tool command to remove the synced untranslated entries?
If you are talking about the commented out entries like:

Code: Select all

# Used as a placeholder for unexpanded content in the combat log window.
#*ELLIPSIS
#* <not translated 2016-06-12 23:06:27>
Those are intended to stay.
The 3rd cases I want to leave them as they are. If I do whatever I'm told to solve the other cases, the old entries won't be lost, right?
Any operation within st-tool is intended to keep the translation value untouched.
Final doubt, I tried st-tool.py check, which was helpful to detect some errors I had (like translating some values but leaving its keys commented). But I don't understand the following error message:

Code: Select all

freeorion$ ./check/st-tool.py check default/stringtables/es.txt 
Traceback (most recent call last):
  File "./check/st-tool.py", line 587, in <module>
    sys.exit(args.action(args))
  File "./check/st-tool.py", line 477, in check_action
    for match in re.finditer(INTERNAL_REFERENCE_PATTERN.format('.*?'), entry.value):
  File "/usr/lib/python3.6/re.py", line 229, in finditer
    return _compile(pattern, flags).finditer(string)
TypeError: expected string or bytes-like object
"Expected string or bytes-like object"
I suspect it means in the es.txt I'm working on. But in which line? It has 19357 lines now.
This a bug within st-tool and unrelated to your translation.
Finally, the help message for the st-tool could be more informative:

Code: Select all

freeorion$ ./check/st-tool.py -h
usage: st-tool.py [-h] {format,sync,rename-key,check,compare} ...

positional arguments:
  {format,sync,rename-key,check,compare}
    format              format a string table and exit
    sync                synchronize two string tables and exit
    rename-key          rename all occurences of a key within a stringtable
                        and exit
    check               check a stringtable for consistency and exit
    compare             compare two string tables and exit

optional arguments:
  -h, --help            show this help message and exit
What does "format" do exactly? What are the parameters for it? Just the string table you want to "format"? Should its output be redirected or it makes changes directly in the input file?
I can try that and figure out by myself, but it's helpful for dummies to know all of that in advance (In fact I did figured it out, but doing "strange" things first like copying the es.txt to a temporal file, fearing that format could do something to it I don't wont, which cause st-tool to throw error messages such as "fatal: no such parth es_tmp.txt in HEAD" plus the traceback, then I kept the tmp file just in case and called st-tool format upon the es.txt file, which outputed the formated file into stdout, and finally I invoked the command as it should be, redirecting the output to a temporal file).
The same applies for all other commands. It might not be obvious to newcomers when you compare two files which one is the reference, or that you need to redirect the output of of the sync command to a new file (I got no trouble with those since Marcel told me the exact commands in this thread, but yo get the point).
I agree, this is insufficent. For your information: You can run `st-tool <verb> --help` to get a more detailed documentation for each verb.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
adrian_broher
Programmer
Posts: 1154
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: trans to spanish

#35 Post by adrian_broher » Sun Apr 12, 2020 11:56 am

Oberlus wrote:
Sun Apr 12, 2020 11:46 am
adrian_broher wrote:
Sun Apr 12, 2020 11:24 am
There is a setting for that:
The meld I installed from ubuntu repo doesn't have a preferences window. I'll search for a better version.
https://askubuntu.com/questions/1093428 ... ces-option
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
adrian_broher
Programmer
Posts: 1154
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: trans to spanish

#36 Post by adrian_broher » Sun Apr 12, 2020 12:00 pm

It would be nice if you could post notes related to st-tool into the Github Issue tracker in the future.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
Oberlus
Cosmic Dragon
Posts: 2695
Joined: Mon Apr 10, 2017 4:25 pm

Re: trans to spanish

#37 Post by Oberlus » Sun Apr 12, 2020 12:34 pm

adrian_broher wrote:
Sun Apr 12, 2020 12:00 pm
It would be nice if you could post notes related to st-tool into the Github Issue tracker in the future.
Noted.
Thanks for all the answers.

User avatar
Oberlus
Cosmic Dragon
Posts: 2695
Joined: Mon Apr 10, 2017 4:25 pm

Re: trans to spanish

#38 Post by Oberlus » Fri Apr 24, 2020 8:05 am

Una duda que quisiera resolver con la ayuda de cualquier hispanohablante del foro:

¿Cómo llamar a los PP (Production Points), RP (Research Points) e IP (Influence Points) en español?

Queremos que cada una de esas siglas sea fácilmente distinguible.
La primera es fácil: PP (Puntos de Producción).
No se me ocurre ninguna palabra alternativa para Influencia, así que los IP habrían de ser PI (Puntos de Influencia).
Y eso nos pisa la I para Investigación, por lo que no me queda más remedio que llamar PC (Puntos de Ciencia) a los RP.

Supongo que eso no es óbice para seguir usando "Investigación" para "Research" en el resto de términos que lo incluyen, como "ventana de investigación".
Aunque tampoco me termina de gustar PC por el significado que solemos dar a esa sigla: personal computer... :?

¿Ideas?

Post Reply