[chirp_devel] [PATCH 0 of 2 ] Parameter errors in translations
Hi all! working on #1835 I supposed there can be more errors in translations so I make a script to check parameters in all translated strings. It does only very basic check but discovered a number of errors in different language translations. I make a separate patch with fix for italian and obvious errors in other language but more errors are still there as I only know italian, english and french.
Please try the script and correct them if you can ;)
73 de IZ3GME Marco
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1408469262 -7200 # mar ago 19 19:27:42 2014 +0200 # Node ID ad3cda48cfe58b536ea548a72d3f949e7b571f92 # Parent d5a4ed31fa2afd5820516b8d02ed28565c960bdc [locale] add a script to check parameters in translated strings
Translated strings must use the very same parameter that are in original strings This script check parameters used ineach translation of each po file It need polib
created fixing #1835
diff --git a/locale/check_parameters.py b/locale/check_parameters.py new file mode 100755 --- /dev/null +++ b/locale/check_parameters.py @@ -0,0 +1,30 @@ +#!/usr/bin/python + +import polib +from string import Formatter +import glob + +filelist = glob.glob("*.po") +pos = {filename: polib.pofile(filename) for filename in filelist} + +formatter = Formatter() + +for name, po in pos.iteritems(): + print "Testing", name + for entry in po: + if len(entry.msgstr) > 0: + try: + ids = [field_name + for literal_text, field_name, format_spec, conversion + in formatter.parse(entry.msgid)] + tids = [field_name + for literal_text, field_name, format_spec, conversion + in formatter.parse(entry.msgstr)] + except Exception as e: + print "Got exception!", e, "for entry", entry.msgid + else: + if tids != None: + missing = [name for name in tids + if name is not None and name not in ids] + if len(missing) > 0: + print "Missing parameters", missing, "in translation of", entry.msgid
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1408469264 -7200 # mar ago 19 19:27:44 2014 +0200 # Node ID 87aa7879758d8e722e375589c06188ffcc088d5a # Parent ad3cda48cfe58b536ea548a72d3f949e7b571f92 [locale] Correct some parameter errors in translations
seen fixing #1835
diff --git a/locale/de.po b/locale/de.po --- a/locale/de.po +++ b/locale/de.po @@ -385,7 +385,7 @@
#: ../chirpui/inputdialog.py:136 msgid "The file {name} already exists. Do you want to overwrite it?" -msgstr "Datei {Name} existiert bereit, wollen Sie diese überschreiben?" +msgstr "Datei {name} existiert bereit, wollen Sie diese überschreiben?"
#: ../chirpui/mainapp.py:219 ../chirpui/mainapp.py:442 msgid "Untitled" @@ -992,8 +992,8 @@ msgstr "Lade Kanal {chan}"
#: ../chirpui/memedit.py:983 -msgid "Internal Error: Invalid limit {number" -msgstr "Interner Fehler: Ungültige Grenzwert {Nummer}" +msgid "Internal Error: Invalid limit {number}" +msgstr "Interner Fehler: Ungültige Grenzwert {number}"
#: ../chirpui/memedit.py:993 msgid "Memory range:" @@ -1070,7 +1070,7 @@
#: ../chirpui/shiftdialog.py:80 msgid "Looking for a free spot ({number})" -msgstr "Suche nach einer freien Stelle ({Nummer})" +msgstr "Suche nach einer freien Stelle ({number})"
#: ../chirpui/shiftdialog.py:93 msgid "No space to insert a row" diff --git a/locale/it.po b/locale/it.po --- a/locale/it.po +++ b/locale/it.po @@ -8,7 +8,7 @@ "Project-Id-Version: CHIRP\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2012-02-16 12:06-0800\n" -"PO-Revision-Date: 2014-08-14 08:51+0100\n" +"PO-Revision-Date: 2014-08-19 19:04+0100\n" "Last-Translator: Marco Filippi iz3gme.marco@gmail.com\n" "Language-Team: English\n" "Language: en_US\n" @@ -638,7 +638,7 @@
#: ../chirpui/editorset.py:260 msgid "There was an error during import: {error}" -msgstr "Si � verificato un errore importando {fname}: {error}" +msgstr "Si � verificato un errore durante l'importazione: {error}"
#: ../chirpui/editorset.py:270 msgid "Unsupported file type" @@ -646,7 +646,7 @@
#: ../chirpui/editorset.py:286 ../chirpui/editorset.py:301 msgid "There was an error during export: {error}" -msgstr "Si � verificato un errore all'apertura di {fname}: {error}" +msgstr "Si � verificato un errore durante l'esportazione: {error}"
#: ../chirpui/editorset.py:313 msgid "Priming memory" @@ -884,7 +884,7 @@ msgstr "Lettura canale {chan}"
#: ../chirpui/memedit.py:952 -msgid "Internal Error: Invalid limit {number" +msgid "Internal Error: Invalid limit {number}" msgstr "Errore Interno: Limite non valido {number}"
#: ../chirpui/memedit.py:962 diff --git a/locale/pl.po b/locale/pl.po --- a/locale/pl.po +++ b/locale/pl.po @@ -51,7 +51,7 @@ #: ../chirpui/bankedit.py:185 #, fuzzy msgid "Updating bank index for memory {num}" -msgstr "Pobieranie surowej pamięci {number}" +msgstr "Pobieranie surowej pamięci {num}"
#: ../chirpui/bankedit.py:194 msgid "Updating bank information for memory {num}" @@ -60,17 +60,17 @@ #: ../chirpui/bankedit.py:200 ../chirpui/bankedit.py:229 #, fuzzy msgid "Getting memory {num}" -msgstr "Pobieranie pamięci {number}" +msgstr "Pobieranie pamięci {num}"
#: ../chirpui/bankedit.py:214 #, fuzzy msgid "Setting index for memory {num}" -msgstr "Pobieranie pamięci {number}" +msgstr "Pobieranie pamięci {num}"
#: ../chirpui/bankedit.py:223 #, fuzzy msgid "Getting bank for memory {num}" -msgstr "Pobieranie surowej pamięci {number}" +msgstr "Pobieranie surowej pamięci {num}"
#: ../chirpui/bankedit.py:238 ../chirpui/memedit.py:63 #: ../chirpui/memedit.py:172 ../chirpui/memedit.py:246 @@ -103,7 +103,7 @@ #: ../chirpui/bankedit.py:302 #, fuzzy msgid "Getting bank information for memory {num}" -msgstr "Pobieranie surowej pamięci {number}" +msgstr "Pobieranie surowej pamięci {num}"
#: ../chirpui/bankedit.py:323 #, fuzzy @@ -918,7 +918,7 @@ msgstr "Pobieranie kanału {chan}"
#: ../chirpui/memedit.py:952 -msgid "Internal Error: Invalid limit {number" +msgid "Internal Error: Invalid limit {number}" msgstr "Błąd wewnętrzny: Niewłaściwy limit {number}"
#: ../chirpui/memedit.py:962 diff --git a/locale/pt_BR.po b/locale/pt_BR.po --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -756,7 +756,7 @@
#: ../chirpui/memedit.py:578 msgid "Raw memory {number}" -msgstr "Mem�ria raw (number}" +msgstr "Mem�ria raw {number}"
#: ../chirpui/memedit.py:582 ../chirpui/memedit.py:610 #: ../chirpui/memedit.py:615 diff --git a/locale/ru.po b/locale/ru.po --- a/locale/ru.po +++ b/locale/ru.po @@ -708,7 +708,7 @@
#: ../chirpui/memedit.py:175 msgid "Erasing memory {loc}" -msgstr "Стирание памяти {lос}" +msgstr "Стирание памяти {loc}"
#: ../chirpui/memedit.py:236 msgid "Unable to make changes to this model" @@ -850,7 +850,7 @@ msgstr "Получение канала {chan}"
#: ../chirpui/memedit.py:952 -msgid "Internal Error: Invalid limit {number" +msgid "Internal Error: Invalid limit {number}" msgstr "Ошибка: недопустимый предел {number}"
#: ../chirpui/memedit.py:962
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1408469264 -7200 # mar ago 19 19:27:44 2014 +0200 # Node ID 87aa7879758d8e722e375589c06188ffcc088d5a # Parent ad3cda48cfe58b536ea548a72d3f949e7b571f92 [locale] Correct some parameter errors in translations
Hi Marco,
I'm having trouble applying this, for probably obvious reasons. Can you send me a bundle? I think that might help.
Thanks!
--Dan
Hi Dan, here is the bundle
73 de IZ3GME Marco
On 27/08/2014 00:07, Dan Smith wrote:
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1408469264 -7200 # mar ago 19 19:27:44 2014 +0200 # Node ID 87aa7879758d8e722e375589c06188ffcc088d5a # Parent ad3cda48cfe58b536ea548a72d3f949e7b571f92 [locale] Correct some parameter errors in translations
Hi Marco,
I'm having trouble applying this, for probably obvious reasons. Can you send me a bundle? I think that might help.
Thanks!
--Dan
chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
participants (3)
-
Dan Smith
-
IZ3GME Marco
-
Marco Filippi IZ3GME