GNOME Bugzilla – Bug 667207
Verify that a translation will not break a build
Last modified: 2018-05-22 12:11:50 UTC
I pushed a documentation translation[1] on Cheese which had a non closing tag and it was reported as it breaks the build[2]. I already fixed it[3] :) It would be handy if just like Damned-Lies already passes a "msgfmt -cv" on translations to also pass another check. The Makefiles actually are compiling the po files to mo objects and then building the xml files, so something like: pocompile ca.po itstool -m ca.po ../C/*.page Is it feasible to run something along those lines on uploaded files? [1] http://git.gnome.org/browse/cheese/commit/?id=f277e88f4c7bc14b170832af3009d19cd4ad3665 [2] https://bugzilla.gnome.org/show_bug.cgi?id=667172 [3] http://git.gnome.org/browse/cheese/commit/?id=58e2a80db7efb0245c571e9a949ad6d7579c0d7e
Sorry to bother, the actual commands should be: pocompile -i ca.po -o ca.mo itstool -m ca.mo ../C/*.{page,xml} # I noticed that it handles perfectly both XML and Mallard docs
What is the difference between pocompile and msgfmt (which is already called by Damned lies)?
What about using gtxml (from pyg3t) to check the syntax? http://sourceforge.net/projects/pyg3t/
pyg3t lives now at http://launchpad.net/pyg3t and it would be super useful to integrate it :) Currently the build can fail for a documentation like this: GEN de/ Warning: Could not merge translation for msgid: Alternatively, use the keyboard to open the <gui>Activities Overview</gui> by pressing the <key xref="keyboard-key-super">Super</key> key. Warning: Could not merge translation for msgid: Alternatively, use the keyboard to open the <gui>Activities Overview</gui> by pressing the <key xref="keyboard-key-super">Super</key> key. Running gtxml on the po file gives: $ gtxml gnome-help/de/de.po At line 583: mismatched tag --------------------------- # http://en.wikipedia.org/wiki/Super_key_(keyboard_button) #: C/getting-started.page:39(div/p) C/launch-apps.page:42(div/p) msgid "" "Alternatively, use the keyboard to open the <gui>Activities Overview</gui> by" " pressing the <key xref=\"keyboard-key-super\">Super</key> key." msgstr "" "Verwenden Sie die Tastatur, um die <gui>Aktivitäten-Übersicht</gui> durch " "Drücken der <key xref=\"keyboard-key-super\">Super</key>-Taste </span> zu " "öffnen." Showing this output on the per language overview pages (like http://l10n.gnome.org/languages/hu/gnome-3-8/{ui|doc}/) just like the pot generation problems would be very useful for QA.
Gtxml is Python code, so it should not be very difficult to integrate it on DL. Should it be a blocker check (i.e. PO file upload no allowed if it doesn't pass this check) or just a warning message?
I think it would be a good idea to catch such problems early and handle them ruthlessly, even if they "only" make the string appear ugly (on UI) or untranslated (in docs).
The ideal situation would be to have this kind of checks in the translation tool (Gtranslator, for example). In the case of Gtranslator, Ignacio was woking on it (and there is a branch in git with the plugin's code, but it's incomplete). Having it implemented in GTR would help translators to identify and fix this kind of errors, like others are detected. Maybe this would be a good reason to target our efforts in finding a new maintainer for GTR and finally deprecate the use of Lokalize to translate GNOME. It this is not possible, having it in DL as a blocker check would help to avoid errors in documentation.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/damned-lies/issues/28.