Bug 24662 - Remove global variables MSG_* from datatables.inc
Summary: Remove global variables MSG_* from datatables.inc
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Julian Maurice
QA Contact: Testopia
URL:
Keywords:
Depends on: 24661 24664
Blocks:
  Show dependency treegraph
 
Reported: 2020-02-14 10:00 UTC by Julian Maurice
Modified: 2020-02-14 14:54 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 24662: Remove global variables MSG_* from datatables.inc (13.39 KB, patch)
2020-02-14 10:00 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2020-02-14 10:00:09 UTC
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.
Comment 1 Julian Maurice 2020-02-14 10:00:37 UTC
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
Comment 2 Bernardo Gonzalez Kriegel 2020-02-14 12:58:41 UTC
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.
Comment 3 Bernardo Gonzalez Kriegel 2020-02-14 14:44:27 UTC
See Bug 24664 for missing *-messages-js.po