Koha-clms/t
Julian Maurice 3cfc2ec7bd Bug 25067: Move PO file manipulation code into gulp tasks
misc/translator/translate was doing three different things:
- extract translatable strings
- create or update PO files
- install translated templates

This patch separates responsibilities by moving the string extraction
code into several 'xgettext-like' scripts and adds gulp tasks to
automate string extraction and PO files update

This has several benefits:

- gulp runs tasks in parallel, so it's a lot faster (updating all PO
  files is at least 10 times faster with my 4-cores CPU)

- there is no need for $KOHA_CONF to be defined
  LangInstaller.pm relied on $KOHA_CONF to get the different paths
  needed. I'm not sure why, since string extraction and PO update should
  work on source files, not installed files

- string extraction code can be more easily tested

This patch also brings a couple of fixes and improvements:

- TT string extraction (strings wrapped in [% t(...) %]) was done with
  Template::Parser and PPI, which was extremely slow, and had some
  problems (see bug 24797).
  This is now done with Locale::XGettext::TT2 (new dependency) which is
  a lot faster, and fixes bug 24797

- Fix header in 4 PO files

For backward compatibility, 'create' and 'update' commands of
misc/translator/translate can still be used and will execute the
corresponding gulp task

Test plan:
1. Run `yarn install` and install Locale::XGettext::TT2
2. Run `gulp po:update`
3. Verify the contents of updated PO files
4. Run `cd misc/translator && ./translate install <lang>`
5. Verify that all (templates, sysprefs, xslt, installer files) is
   correctly translated
6. Run `gulp po:create --lang <lang>` and verify that it created all PO
   files for that language
7. Run `prove t/misc/translator`

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Need to install yarn & gulp, no errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-06 09:46:11 +01:00
..
Acquisition Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Biblio Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Budgets Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Circulation Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
External
…
Koha Bug 24567: Don't strip spaces along with dangling colons 2020-11-04 14:49:11 +01:00
Members Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Number Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
SIP
…
Search Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Serials Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Test Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
db_dependent Bug 14708: (QA follow-up) Add tests 2020-11-06 09:40:26 +01:00
edi_testfiles
…
etc Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
lib Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
misc/translator Bug 25067: Move PO file manipulation code into gulp tasks 2020-11-06 09:46:11 +01:00
00-checkdatabase-version.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
00-deprecated.t
…
00-load.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
00-merge-conflict-markers.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
00-testcritic.t Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
00-valid-xml.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Auth.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Auth_with_shibboleth.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
AuthoritiesMarc_MARC21.t
…
AuthoritiesMarc_UNIMARC.t
…
Barcodes_EAN13.t
…
Barcodes_annual.t
…
Barcodes_hbyymmincr.t
…
Barcodes_incremental.t
…
Biblio.t Bug 26133: Remove GetMarcHosts 2020-08-05 17:36:28 +02:00
Biblio2.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Boolean.t
…
Budgets.t
…
Calendar.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Charset.t
…
Circulation_barcodedecode.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
ClassSortRoutine.t
…
ClassSortRoutine_Dewey.t
…
ClassSortRoutine_Generic.t
…
ClassSortRoutine_LCC.t
…
ClassSource.t
…
Context.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Contract.t
…
Creators.t
…
DateUtils.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Debug.t
…
EdiInvoice.t
…
EdiTransport.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Edifact.t
…
Ediorder.t Bug 23926: Limit GIR segment to 5 pieces of info 2020-03-10 15:18:22 +00:00
Ediordrsp.t
…
Form_MessagingPreferences.t
…
HtmlTags.t
…
ImportBatch.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Installer_PerlModules.t Bug 19735: Move Perl deps definitions into a cpanfile 2020-02-12 16:33:02 +00:00
Installer_pm.t Bug 19735: Move Perl deps definitions into a cpanfile 2020-02-12 16:33:02 +00:00
ItemCirculationAlertPreference.t
…
Koha.t
…
Koha_MetadataRecord.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Koha_SearchEngine_Elasticsearch_Browse.t Bug 24545: Fix newly added files 2020-02-24 13:31:27 +00:00
Koha_Template_Plugin_Cache.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Koha_Template_Plugin_Koha.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Koha_Util_FrameworkPlugin.t
…
Koha_Util_MARC.t
…
Labels.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Labels_split_Regex.t
…
Labels_split_ccn.t
…
Labels_split_ddcn.t
…
Labels_split_lccn.t
…
Languages.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Letters.t
…
Logger.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Makefile.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Matcher.t
…
Members_Messaging.t
…
OpenLibrarySearch.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Output.t Bug 24369: Add CORS support to output_with_http_headers() 2020-03-05 12:59:44 +00:00
Output_JSONStream.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Patron.t
…
Patroncards.t
…
Patroncards_Batch.t
…
Patroncards_Lib.t
…
Patroncards_Patroncard.t
…
Patroncards_Profile.t
…
Patroncards_Template.t
…
Prices.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
RecordProcessor.t Bug 25008: Tests for ->options 2020-04-14 08:31:22 +01:00
Ris.t
…
SMS.t
…
Scheduler.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Scrubber.t
…
Search.t
…
Search_PazPar2.t
…
SimpleMARC.t Bug 26781: Check for subfield defined rather than truth 2020-10-26 00:14:41 +01:00
SocialData.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Stats.t
…
SuggestionEngine.t Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
SuggestionEngine_AuthorityFile.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
TmplToken.t
…
Token.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
XSLT.t
…
dummy.t Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
template_filters.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
timezones.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00