Hi, I was wondering if the TRANSLATORS file is automatically update from data in the .po files. My e-mail address has changed (and is reflected in es.po), but in TRANSLATORS it's still the old one.
So, if it's doneby hand I would like to request that my entry: Lucas Vieites Fariña<lucas@...2...>, 2003-2008. be changed to: Lucas Vieites Fariña <lucas@...162...>, 2003-2008.
Thank you in advance,
Lucas Vieites scrisse:
Hi, I was wondering if the TRANSLATORS file is automatically update from data in the .po files.
Not yet. It would be really cool if someone come up with a simple script to do so (I think a few lines of sed/awk/perl/whatever would do the job).
My e-mail address has changed (and is reflected in es.po), but in TRANSLATORS it's still the old one.
So, if it's doneby hand I would like to request that my entry: Lucas Vieites Fariña<lucas@...2...>, 2003-2008. be changed to: Lucas Vieites Fariña <lucas@...162...>, 2003-2008.
Done.
Thank you in advance,
Cheers, Luca
I think there's room for optimisation, but this line does the job extracting only the last translators:
grep Last-Translator *.po | awk 'BEGIN { FS = ":" } ; {print $3}' | sed 's/\n"//g' | sed '/^ $/d' | sed 's/^ //g' | uniq | sort > TRANSLATORS
Cheers,
Lucas
2008/3/10, Luca Bruno <gnug.torte@...20...>:
Lucas Vieites scrisse:
Hi, I was wondering if the TRANSLATORS file is automatically update from data in the .po files.
Not yet. It would be really cool if someone come up with a simple script to do so (I think a few lines of sed/awk/perl/whatever would do the job).
My e-mail address has changed (and is reflected in es.po), but in TRANSLATORS it's still the old one.
So, if it's doneby hand I would like to request that my entry: Lucas Vieites Fariña<lucas@...2...>, 2003-2008. be changed to: Lucas Vieites Fariña <lucas@...162...>, 2003-2008.
Done.
Thank you in advance,
Cheers, Luca
-- .''`. ** Debian GNU/Linux ** | Luca Bruno : :' : The Universal O.S. | lucab (AT) debian.org `. `'` | GPG Key ID: 3BFB9FB3 `- http://www.debian.org | Debian GNU/Linux Developer
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Inkscape-translator mailing list Inkscape-translator@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-translator
This will get translator lines from all .po files from current directory and its subdirectories. It will merge duplicate translator names to one and add all years found for that name from all files. Outputs created list of TRANSLATORS to stdout, processed .po files to stderr (that line may be removed). Not optimized for speed.
#!/usr/bin/python
import os, sys, re
credits = {} year = re.compile("[0-9]{4}")
def add_creditline(s): s = s[2:] index = s.find(",")
years = s[index:] # set of years l = set([years[m.start()+2:m.start()+6] for m in re.finditer(re.escape(", "), years)])
if credits.has_key(s[:index]): # if name already exists, add years to set credits[s[:index]] = credits[s[:index]].union(l) else: # else append new name credits[s[:index]] = l
def main(): creditline = re.compile(r"^# .*, [0-9]{4}.$")
# traverse looking for .po files from current directory for root, dirs, files in os.walk(".", topdown=False): for name in files: if name[-3:] == ".po": # debug: write .po file name to stderr sys.stderr.write(os.path.join(root, name)+'\n')
# read credit lines from .po f = open(os.path.join(root, name), "r") s = f.readline() while s != 'msgid ""\n' and s != '': s = f.readline() if creditline.match(s): add_creditline(s) f.close()
# sort by translator name and print credit_names = credits.keys() credit_names.sort()
for i in credit_names: print i + ", " + ", ".join(credits[i])) + "."
if __name__ == "__main__": main()
Regards, ~~helix84
On Mon, Mar 10, 2008 at 3:58 PM, Lucas Vieites <lucas@...162...> wrote:
I think there's room for optimisation, but this line does the job extracting only the last translators:
grep Last-Translator *.po | awk 'BEGIN { FS = ":" } ; {print $3}' | sed 's/\n"//g' | sed '/^ $/d' | sed 's/^ //g' | uniq | sort > TRANSLATORS
Cheers,
Lucas
2008/3/10, Luca Bruno <gnug.torte@...20...>:
Lucas Vieites scrisse:
Hi, I was wondering if the TRANSLATORS file is automatically update from data in the .po files.
Not yet. It would be really cool if someone come up with a simple script to do so (I think a few lines of sed/awk/perl/whatever would do the job).
My e-mail address has changed (and is reflected in es.po), but in TRANSLATORS it's still the old one.
So, if it's doneby hand I would like to request that my entry: Lucas Vieites Fariña<lucas@...2...>, 2003-2008. be changed to: Lucas Vieites Fariña <lucas@...162...>, 2003-2008.
Done.
Thank you in advance,
Cheers, Luca
-- .''`. ** Debian GNU/Linux ** | Luca Bruno : :' : The Universal O.S. | lucab (AT) debian.org `. `'` | GPG Key ID: 3BFB9FB3 `- http://www.debian.org | Debian GNU/Linux Developer
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Inkscape-translator mailing list Inkscape-translator@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-translator
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Inkscape-translator mailing list Inkscape-translator@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-translator
On 10/03/2008, helix84 <helix84@...150...> wrote:
This will get translator lines from all .po files from current directory and its subdirectories. It will merge duplicate translator names to one and add all years found for that name from all files. Outputs created list of TRANSLATORS to stdout, processed .po files to stderr (that line may be removed). Not optimized for speed.
I just wonder. The translator-credits in the .po file are a bit different from the TRANSLATORS list right now. I think the .po files give room for some more information (see the pl.po) while TRANSLATORS is simply a list of names. I liked the idea of translator-credit to be prepended in the about dialogue.
I am not sure either if there are many discrepancies between the two lists, but I suspect there may be some.
PS. The ChangeLog file seems abandoned as well, but I don't see the point of maintaining it now with SVN. Or could we get the CVN changelog for the po directory populate this file?
Regards,
I just wonder. The translator-credits in the .po file are a bit different from the TRANSLATORS list right now. I think the .po files give room for some more information (see the pl.po) while TRANSLATORS is simply a list of names. I liked the idea of translator-credit to be prepended in the about dialogue.
I don't understand what you think is wrong. As far as my script is concerned, the format of TRANSLATORS is kept. It's a list of names with emails and years extracted from the initial comments, which is the usual place to put credits (your pl.po has them, too). As far as translator-credit is concerned, I'm not touching it, so it can have a different format.
Regards, ~~helix84
On Mon, 10 Mar 2008 23:18:12 +0100, helix84 wrote:
I don't understand what you think is wrong. As far as my script is concerned, the format of TRANSLATORS is kept. It's a list of names with emails and years extracted from the initial comments, which is the usual place to put credits (your pl.po has them, too). As far as translator-credit is concerned, I'm not touching it, so it can have a different format.
Can you tweak script to remove 'bad names' as 'auto' is, and sort years in A-Z order?
Can you tweak script to remove 'bad names' as 'auto' is, and sort years in A-Z order?
It now deletes the default string "FIRST AUTHOR <EMAIL@...181...>, YEAR". Other strings may be blacklisted, too, but the proper solution is to remove them from .po files or to tweak the credit line format regex. E.g. currently it catches this line: "Notoj: 1) mi dankas Sebastian Cyprych pro liaj sugestoj [Antonio, 2008." Similarly, there might be lines which are ignored because they're not in the expected format.
Regards, ~~helix84
#!/usr/bin/python # # extract TRANSLATORS from .po files # # Ivan Masar <helix84@...150...>, 2008. # # This script extracts translator lines from .po files # It merges duplicate translator names to one and adds all years # found for that name from all files. Not optimized for speed. # # Input: none, reads .po files recursively from current directory # Output: created list of TRANSLATORS to stdout # processed .po files to stderr (that line may be removed)
import os, sys, re
credits = {} year = re.compile("[0-9]{4}")
def add_creditline(s): s = s[2:] index = s.find(",")
years = s[index:] # set of years l = set([years[m.start()+2:m.start()+6] for m in re.finditer(re.escape(", "), years)])
if credits.has_key(s[:index]): # if name already exists, add years to set credits[s[:index]] = credits[s[:index]].union(l) else: # else append new name credits[s[:index]] = l
def main(): creditline = re.compile(r"^# .*, [0-9]{4}.$")
# traverse looking for .po files from current directory for root, dirs, files in os.walk(".", topdown=False): for name in files: if name[-3:] == ".po": # debug: write .po file name to stderr sys.stderr.write(os.path.join(root, name)+'\n')
# read credit lines from .po f = open(os.path.join(root, name), "r") s = f.readline() while s != 'msgid ""\n' and s != '': s = f.readline() if creditline.match(s): add_creditline(s) f.close()
# remove unwanted entries del credits["FIRST AUTHOR <EMAIL@...181...>"]
# sort by translator name and print credit_names = credits.keys() credit_names = [(x.upper(), x) for x in credit_names] credit_names.sort()
for upper, key in credit_names: credits[key] = list(credits[key]) credits[key].sort() print key + ", " + ", ".join(credits[key]) + "."
if __name__ == "__main__": main()
One more thing, the second version distinguishes upper and lower case but it doesn't consider locale. I don't know the proper way to handle this in Python, so I recommend calling my script this way and let the system handle sorting (it would be called from some Makefile anyway):
$ set LC_ALL=C; ./translators.py | sort
That makes the uppercase and sorting code redundant, so the last part can be simplified:
# remove unwanted entries del credits["FIRST AUTHOR <EMAIL@...181...>"]
for key in credits: credits[key] = list(credits[key]) credits[key].sort() print key + ", " + ", ".join(credits[key]) + "."
Let me know what you think and whether we should use this for Inkscape TRANSLATORS.
Regards, ~~helix84
Hi all,
Looking at Inkscape homepage, there appears Basque (eu) translation with 101% of messages translated.
But right now I downloaded /inkscape-0.45+0.46pre3/ version and it has 1 fuzzy and 2 untranslated messages, (so total messages are 3463+1+2= 3466)?
I don't know where is the error, because other languages have 3466 messages too. So, mayge is webpage's script error?
Best regards,
Dooteo
Hi,
2008/3/11, dooteo <dooteo@...173...>:
Hi all,
Looking at Inkscape homepage, there appears Basque (eu) translation with 101% of messages translated.
That's so tipically Basque! 100 % is not enough for you :)!
Don't get angry, is just a joke. Congratulations from the Catalan team for your translation of Inkscape.
Agur!
participants (7)
-
Aleksandar Urošević
-
dooteo
-
helix84
-
Luca Bruno
-
Lucas Vieites
-
Marcin Floryan
-
Xavier Conde Rueda