Now that bug 21156 is pushed, we don't need to have global variables in .inc or .tt files for translation in .js file. We can simply declare our translatable strings where they are used.
Created attachment 98921 [details] [review] Bug 24662: Remove global variables MSG_* from datatables.inc Now that bug 21156 is pushed, we don't need to have global variables in .inc or .tt files for translation in .js file. We can simply declare our translatable strings where they are used. This patch removes all global variables used in DataTables configuration Test plan: 1. cd misc/translator && ./translate update fr-FR 2. Translate strings in misc/tranlator/po/fr-FR-messages-js.po 3. cd misc/translator && ./translate install fr-FR 4. Go to the staff interface, in english, and check that DataTables tables are still working. You should check at least the following pages: - catalogue/detail.pl - circ/circulation.pl - tools/quotes.pl - tools/letter.pl 5. Switch to french and check again DataTables tables, and verify that strings are translated This patch depends on bug 24661
Hi, two comments: a) You need to create fr-FR-messages-js.po first, or update fails. I'll try to write a Bug to create them all b) There are problems with qa-tools FAIL koha-tmpl/intranet-tmpl/prog/js/checkouts.js OK git manipulation FAIL untranslatable_strings Untranslatable string found (Loading... you may continue scanning.) - See coding guideline JS5 FAIL koha-tmpl/intranet-tmpl/prog/js/datatables.js OK git manipulation FAIL untranslatable_strings Untranslatable string found (First) - See coding guideline JS5 Untranslatable string found (Last) - See coding guideline JS5 Untranslatable string found (Next) - See coding guideline JS5 Untranslatable string found (Previous) - See coding guideline JS5 Untranslatable string found (No data available in table) - See coding guideline JS5 Untranslatable string found (Showing _START_ to _END_ of _TOTAL_ entries) - See coding guideline JS5 Untranslatable string found (No entries to show) - See coding guideline JS5 Untranslatable string found ((filtered from _MAX_ total entries)) - See coding guideline JS5 Untranslatable string found (Show _MENU_ entries) - See coding guideline JS5 Untranslatable string found (Loading...) - See coding guideline JS5 Untranslatable string found (Processing...) - See coding guideline JS5 Untranslatable string found (Search:) - See coding guideline JS5 Untranslatable string found (No matching records found) - See coding guideline JS5 Untranslatable string found (Copy to clipboard) - See coding guideline JS5 Untranslatable string found (Press <i>ctrl</i> or <i>⌘</i> + <i>C</i> to copy the table data<br>to your system clipboard.<br><br>To cancel, click this message or press escape.) - See coding guideline JS5 Untranslatable string found (Copied %d rows to clipboard) - See coding guideline JS5 Untranslatable string found (Copied one row to clipboard) - See coding guideline JS5 Untranslatable string found (Clear filter) - See coding guideline JS5 Untranslatable string found (Clear filter) - See coding guideline JS5 Untranslatable string found (All) - See coding guideline JS5 Untranslatable string found (a an the) - See coding guideline JS5 False positives perhaps.
See Bug 24664 for missing *-messages-js.po
QA script fixes awaiting merge, but we wanted to get the rmaints to pull in the translation js bug first.
Created attachment 100147 [details] [review] Bug 24662: Remove global variables MSG_* from datatables.inc Now that bug 21156 is pushed, we don't need to have global variables in .inc or .tt files for translation in .js file. We can simply declare our translatable strings where they are used. This patch removes all global variables used in DataTables configuration Test plan: 1. cd misc/translator && ./translate update fr-FR 2. Translate strings in misc/tranlator/po/fr-FR-messages-js.po 3. cd misc/translator && ./translate install fr-FR 4. Go to the staff interface, in english, and check that DataTables tables are still working. You should check at least the following pages: - catalogue/detail.pl - circ/circulation.pl - tools/quotes.pl - tools/letter.pl 5. Switch to french and check again DataTables tables, and verify that strings are translated This patch depends on bug 24661 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Tested using es-ES or de-DE (build compendium, update, translate, install) cd misc/translator msgcat --use-first -o de.po po/de-DE-*.po ./translate update de-DE msgmerge de.po po/de-DE-messages-js.po -o - | msgattrib --no-obsolete -o po/de-DE-messages-js.po ./translate install de-DE DataTables works, and are translated. There are some messages from qa-tools.
(In reply to Martin Renvoize from comment #4) > QA script fixes awaiting merge, but we wanted to get the rmaints to pull in > the translation js bug first. Ok! It works, so I signed.
Created attachment 100525 [details] [review] Bug 24662: Remove global variables MSG_* from datatables.inc Now that bug 21156 is pushed, we don't need to have global variables in .inc or .tt files for translation in .js file. We can simply declare our translatable strings where they are used. This patch removes all global variables used in DataTables configuration Test plan: 1. cd misc/translator && ./translate update fr-FR 2. Translate strings in misc/tranlator/po/fr-FR-messages-js.po 3. cd misc/translator && ./translate install fr-FR 4. Go to the staff interface, in english, and check that DataTables tables are still working. You should check at least the following pages: - catalogue/detail.pl - circ/circulation.pl - tools/quotes.pl - tools/letter.pl 5. Switch to french and check again DataTables tables, and verify that strings are translated This patch depends on bug 24661 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
A nice clarification of the code here.. PQA
Nice work everyone! Pushed to master for 20.05
QA errors when applying to 19.11.x Are these necessary to correct before pushing to 19.11.x branch? FAIL koha-tmpl/intranet-tmpl/prog/js/checkouts.js OK git manipulation FAIL untranslatable_strings Untranslatable string found (Loading... you may continue scanning.) - See coding guideline JS5 FAIL koha-tmpl/intranet-tmpl/prog/js/datatables.js OK git manipulation FAIL untranslatable_strings Untranslatable string found (First) - See coding guideline JS5 Untranslatable string found (Last) - See coding guideline JS5 Untranslatable string found (Next) - See coding guideline JS5 Untranslatable string found (Previous) - See coding guideline JS5 Untranslatable string found (No data available in table) - See coding guideline JS5 Untranslatable string found (Showing _START_ to _END_ of _TOTAL_ entries) - See coding guideline JS5 Untranslatable string found (No entries to show) - See coding guideline JS5 Untranslatable string found ((filtered from _MAX_ total entries)) - See coding guideline JS5 Untranslatable string found (Show _MENU_ entries) - See coding guideline JS5 Untranslatable string found (Loading...) - See coding guideline JS5 Untranslatable string found (Processing...) - See coding guideline JS5 Untranslatable string found (Search:) - See coding guideline JS5 Untranslatable string found (No matching records found) - See coding guideline JS5 Untranslatable string found (Copy to clipboard) - See coding guideline JS5 Untranslatable string found (Press <i>ctrl</i> or <i>⌘</i> + <i>C</i> to copy the table data<br>to your system clipboard.<br><br>To cancel, click this message or press escape.) - See coding guideline JS5 Untranslatable string found (Copied %d rows to clipboard) - See coding guideline JS5 Untranslatable string found (Copied one row to clipboard) - See coding guideline JS5 Untranslatable string found (Clear filter) - See coding guideline JS5 Untranslatable string found (Clear filter) - See coding guideline JS5 Untranslatable string found (All) - See coding guideline JS5 Untranslatable string found (a an the) - See coding guideline JS5 FAIL koha-tmpl/intranet-tmpl/prog/js/letter.js OK git manipulation FAIL untranslatable_strings Untranslatable string found (Loading...) - See coding guideline JS5 FAIL koha-tmpl/intranet-tmpl/prog/js/table_filters.js OK git manipulation FAIL untranslatable_strings Untranslatable string found (Deactivate filters) - See coding guideline JS5 Untranslatable string found (Activate filters) - See coding guideline JS5