[Bug 6464] New: Add inconsistence check for '%s' count in tmpl_process3.pl
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6464 Bug #: 6464 Summary: Add inconsistence check for '%s' count in tmpl_process3.pl Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P5 Component: I18N/L10N AssignedTo: frederic@tamil.fr ReportedBy: semarie-koha@latrappe.fr QAContact: koha-bugs@lists.koha-community.org Created attachment 4366 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4366 inconsistence check for tmpl_process3.pl Missing '%s' in translated string could easily result to "Template process failed" (when [% END %] is missing for example). And in result, the end-user is blocked with an error. It would be advantageous to have a small check for inconsistence check between the number of '%s' in msgid and the number of '%s' in msgstr, at the install time. Note: on the 3.4.1, I have 217 string mismatched in staff.po... This check could be easily be added just after PO loading, in tmpl_process3.pl. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6464 Frère Sébastien Marie <semarie-koha@latrappe.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #4366|0 |1 is patch| | Attachment #4366|a |check.patch filename| | Attachment #4366|application/octet-stream |text/plain mime type| | -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6464 --- Comment #1 from Frédéric Demians <frederic@tamil.fr> 2011-06-05 19:35:55 UTC ---
This check could be easily be added just after PO loading, in tmpl_process3.pl.
I agree. Could your submit that as a git patch I can sign off. Thanks. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6464 Frère Sébastien Marie <semarie-koha@latrappe.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #4366|0 |1 is obsolete| | --- Comment #2 from Frère Sébastien Marie <semarie-koha@latrappe.fr> 2011-06-06 11:01:22 UTC --- Created attachment 4373 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4373 git patch: check consistency of PO messages -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6464 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #4373|0 |1 is obsolete| | --- Comment #3 from Frédéric Demians <frederic@tamil.fr> 2011-06-06 12:46:00 UTC --- Created attachment 4376 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4376 Proposed patch -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6464 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 |PATCH-Sent Patch Status|--- |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6464 --- Comment #4 from Frédéric Demians <frederic@tamil.fr> 2011-06-06 12:48:16 UTC --- I have modified your patch. Display a warning for strings that don't have the same count of %s placeholders that the English original strings. Don't warn for not translated string and 'fuzzy' string because those strings are not installed, and this is the translator responsibility to examine them. Please test this patch and sign it off. Thanks. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6464 Frère Sébastien Marie <semarie-koha@latrappe.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #4376|0 |1 is obsolete| | --- Comment #5 from Frère Sébastien Marie <semarie-koha@latrappe.fr> 2011-06-06 13:21:02 UTC --- Created attachment 4378 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4378 Signed-off patch It works great (and better warnings for user). Thanks. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6464 Frère Sébastien Marie <semarie-koha@latrappe.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch Status|Needs Signoff |Signed Off -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6464 Fernando L. Canizo <conan@lugmen.org.ar> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |conan@lugmen.org.ar --- Comment #6 from Fernando L. Canizo <conan@lugmen.org.ar> 2011-06-06 22:12:39 UTC --- I applied the patch to an updated 3.4.x based branch, modified a working .po file to have inconsistent number of '%s' and run 'translate install es-ES', no warning was issued, script ended ok claiming: "The install seems to be successful." Was it not the proper way to test it? -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6464 --- Comment #7 from Frère Sébastien Marie <semarie-koha@latrappe.fr> 2011-06-07 04:55:40 UTC --- When inconsistences are found, only warnings are issued, not a blocking error. So only messages are showed, and at the beginning of process: --- BEGIN extract of "translate install fr-FR" --- Install templates Install templates 'opac From: /srv/koha/koha-git-tree/koha-tmpl/opac-tmpl/prog/en/ To : /srv/koha/koha-git-tree/koha-tmpl/opac-tmpl/prog/fr-FR With: /srv/koha/koha-git-tree/misc/translator/po/fr-FR-i-opac-t-prog-v-3002000.po Charset in/out: UTF-8 at /srv/koha/koha-git-tree/misc/translator/tmpl_process3.pl line 268. tmpl_process3.pl: Warning: unconsistent %s count: (2/1): line: 7913 msgid: "Enter your User ID%s and password%s, and click the submit button (or press the enter key)." msgstr: "Entrez votre identifiant adhérent%s et mot de passe, puis cliquez sur le bouton \"Soumettre\" (ou appuyez sur la tou che <Entrée>)" tmpl_process3.pl: Warning: unconsistent %s count: (12/10): line: 12190 msgid: "The %s most checked-out %s %s %s titles%s %s at %s %s %s in the past %s months %s of all time%s " msgstr: "Les %s plus empruntés %s %s %s documents à %s %s %s dans les %s derniers mois %s depuis le commencement%s " tmpl_process3.pl: Warning: unconsistent %s count: (1/0): line: 10094 msgid: "Note: you can only delete your own tags. %sNote: your tag contained markup code that was removed. " msgstr: "Note : votre tag contenait du texte qui a été supprimé. " Copying /srv/koha/koha-git-tree/koha-tmpl/opac-tmpl/prog/en/css/sanop.css... Copying /srv/koha/koha-git-tree/koha-tmpl/opac-tmpl/prog/en/css/print.css... Copying /srv/koha/koha-git-tree/koha-tmpl/opac-tmpl/prog/en/css/colors.css... [...] The install seems to be successful. --- END --- Could you verify if warning are present between: "Charset in/out: ..." and "Copying ..." (or "Creating ...") ? In order to grab all output in a file (message and warnings), you could redirect stdout and stderr in a file, using:
./translate install es-ES 2>&1 | tee ~/bug6464-output.txt
-- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6464 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz Patch Status|Signed Off |Patch Pushed --- Comment #8 from Chris Cormack <chris@bigballofwax.co.nz> 2011-06-09 07:54:10 UTC --- Pushed please test -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6464 Frère Sébastien Marie <semarie-koha@latrappe.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #9 from Frère Sébastien Marie <semarie-koha@latrappe.fr> 2011-07-03 05:18:52 UTC --- Thanks -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org