[Bug 35079] New: Rebuild POT files only if necessary or asked explicitely
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Bug ID: 35079 Summary: Rebuild POT files only if necessary or asked explicitely Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@bugs.koha-community.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 157253 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157253&action=edit Bug 35079: Rebuild POT files only if necessary or asked explicitely By default, gulp tasks po:create and po:update won't rebuild the POT files if they already exist. Both tasks gained a new option --force-extract to rebuild them unconditionally This makes it possible to create/update PO files for multiple languages sequentially without rebuilding the POT file for each language. For instance: gulp po:update --lang fr-FR # do something with the PO files gulp po:update --lang en-GB # ... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #2 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 157257 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157257&action=edit Bug 35079: Replace --force-extract by --generate-pot={always,auto,never} This restores the original behaviour of always building the POT file in order to not break existing workflows Option --force-extract is deleted in favor of a new option --generate-pot that can have 3 values: * always: always build the POT file. This is the default value * auto: build the POT file only if it does not exist * never: never build the POT file -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Rebuild POT files only if |Add option to gulp tasks |necessary or asked |po:update and po:create to |explicitely |control if POT should be | |built -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- time gulp po:update --lang az-AZ --lang prs --lang mon --lang tl-PH --lang te --lang ms-MY --lang ur-Arab --lang rw-RW --lang pbr --lang he-Hebr --lang ku-Arab --lan g de-CH --lang cy-GB --lang my --lang nl-BE --lang is-IS --lang da-DK --lang ia --lang am-Ethi --lang fr-FR --lang sw-KE --lang ne-NE --lang ru-RU --lang iq-CA --lang si --lang fo-FO --lang fa-Arab --lang bn-IN -- lang uk-UA --lang hu-HU --lang tk --lang ar-Arab --lang as-IN --lang nn-NO --lang lo-Laoo --lang ka --lang ml --lang et --lang sq-AL --lang uz --lang iu-CA --lang sk-SK --lang km-KH --lang tr-TR --lang en-NZ --lan g nl-NL --lang tvl --lang ta-LK --lang hi --lang hyw-Armn --lang pt-PT --lang vi-VN --lang ko-Kore-KP --lang lv --lang it-IT --lang ca-ES --lang fr-CA --lang hy-Armn --lang mr --lang pt-BR --lang mi-NZ --lang sl-S I --lang sv-SE --lang dz --lang th-TH --lang pl-PL --lang zh-Hans-CN --lang oc --lang de-DE --lang es-ES --lang cs-CZ --lang gd --lang nb-NO --lang gl --lang ja-Jpan-JP --lang sr-Cyrl --lang id-ID --lang ga --lang ta --lang bg-Cyrl --lang en-GB --lang tet --lang hr-HR --lang el-GR --lang eo --lang ro-RO --lang fi-FI --lang sd-PK --lang eu --lang zh-Hant-TW --lang kn-Knda --lang be-BY real 0m57.700s time ( gulp po:extract && gulp po:update --generate-pot never --lang az-AZ --lang prs --lang mon --lang tl-PH --lang te --lang ms-MY --lang ur-Arab --lang rw-RW --l ang pbr --lang he-Hebr --lang ku-Arab --lang de-CH --lang cy-GB --lang my --lang nl-BE --lang is-IS --lang da-DK --lang ia --lang am-Ethi --lang fr-FR --lang sw-KE --lang ne-NE --lang ru-RU --lang iq-CA --lang si --lang fo-FO --lang fa-Arab --lang bn-IN --lang uk-UA --lang hu-HU --lang tk --lang ar-Arab --lang as-IN --lang nn-NO --lang lo-Laoo --lang ka --lang ml --lang et --lang sq-AL --lang uz --lang iu-CA --lang sk-SK - -lang km-KH --lang tr-TR --lang en-NZ --lang nl-NL --lang tvl --lang ta-LK --lang hi --lang hyw-Armn --lang pt-PT --lang vi-VN --lang ko-Kore-KP --lang lv --lang it-IT --lang ca-ES --lang fr-CA --lang hy-Armn --la ng mr --lang pt-BR --lang mi-NZ --lang sl-SI --lang sv-SE --lang dz --lang th-TH --lang pl-PL --lang zh-Hans-CN --lang oc --lang de-DE --lang es-ES --lang cs-CZ --lang gd --lang nb-NO --lang gl --lang ja-Jpan-JP - -lang sr-Cyrl --lang id-ID --lang ga --lang ta --lang bg-Cyrl --lang en-GB --lang tet --lang hr-HR --lang el-GR --lang eo --lang ro-RO --lang fi-FI --lang sd-PK --lang eu --lang zh-Hant-TW --lang kn-Knda --lang be -BY) real 0m34.250s -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #4 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (there is a bug when using gulp po:update without --lang) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |35024 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35024 [Bug 35024] Do no wrap PO files -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #157253|0 |1 is obsolete| | Attachment #157257|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157304 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157304&action=edit Bug 35079: Rebuild POT files only if necessary or asked explicitely By default, gulp tasks po:create and po:update won't rebuild the POT files if they already exist. Both tasks gained a new option --force-extract to rebuild them unconditionally This makes it possible to create/update PO files for multiple languages sequentially without rebuilding the POT file for each language. For instance: gulp po:update --lang fr-FR # do something with the PO files gulp po:update --lang en-GB # ... Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157305 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157305&action=edit Bug 35079: Replace --force-extract by --generate-pot={always,auto,never} This restores the original behaviour of always building the POT file in order to not break existing workflows Option --force-extract is deleted in favor of a new option --generate-pot that can have 3 values: * always: always build the POT file. This is the default value * auto: build the POT file only if it does not exist * never: never build the POT file Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Note that if you see: Error: Cannot find module 'stream/promises' It means that you need a more recent version of node. I was using v14 on my host (which I don't usually use for that), and it needs at least 15. We have v18 in ktd. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #8 from Julian Maurice <julian.maurice@biblibre.com> --- If compatibility with older node.js versions is wanted, it's possible to use the non-promise version. But v14 and v16 are EOL now, so they shouldn't be used anyway. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35103 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35103 [Bug 35103] Add option to gulp tasks to pass a list of tasks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Logging the following here. There is a bug when you run `gulp po:update` without --lang (or with all langs passed). Error: Command failed: msgmerge --backup=off --no-wrap --quiet -F --update misc/translator/po/en-NZ-messages.po misc/translator/Koha-messages.pot misc/translator/Koha-messages.pot:11:35: syntax error misc/translator/Koha-messages.pot:11: keyword "n" unknown misc/translator/Koha-messages.pot:12: end-of-line within string There is an extra quote at the end of line 11 ("\n" instead of \n"). Doing a po:extract then a po:update seems to fix the problem. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Jonathan Druart from comment #9)
There is an extra quote at the end of line 11 ("\n" instead of \n").
11 "Content-Transfer-Encoding: 8bit"\n" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Passing QA, I need it ASAP. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on Bug 35024 not yet in 23.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #7)
Note that if you see: Error: Cannot find module 'stream/promises'
It means that you need a more recent version of node.
I was using v14 on my host (which I don't usually use for that), and it needs at least 15.
We have v18 in ktd.
I have version 18 nodejs/nodistro,now 18.18.2-1nodesource1 amd64 [installed] But I still get this stream/promises error after build-resources tries to run gulp build && gulp build --view opac Error: Cannot find module 'stream/promises' Require stack: - /usr/share/koha/gulpfile.js - /usr/share/koha/node_modules/gulp-cli/lib/shared/require-or-import.js - /usr/share/koha/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js - /usr/share/koha/node_modules/gulp-cli/index.js - /usr/share/koha/node_modules/gulp/bin/gulp.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:931:15) at Function.Module._load (internal/modules/cjs/loader.js:774:27) at Module.require (internal/modules/cjs/loader.js:1003:19) at require (internal/modules/cjs/helpers.js:107:18) at Object.<anonymous> (/usr/share/koha/gulpfile.js:11:16) at Module._compile (internal/modules/cjs/loader.js:1114:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10) at Module.load (internal/modules/cjs/loader.js:979:32) at Function.Module._load (internal/modules/cjs/loader.js:819:12) at Module.require (internal/modules/cjs/loader.js:1003:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/usr/share/koha/gulpfile.js', '/usr/share/koha/node_modules/gulp-cli/lib/shared/require-or-import.js', '/usr/share/koha/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js', '/usr/share/koha/node_modules/gulp-cli/index.js', '/usr/share/koha/node_modules/gulp/bin/gulp.js' ] } -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #15 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Marcel de Rooy from comment #14)
I have version 18 nodejs/nodistro,now 18.18.2-1nodesource1 amd64 [installed]
Does `node --version` return 18 ? Maybe you have an older version installed in /usr/local are something like that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #16 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Julian Maurice from comment #15)
(In reply to Marcel de Rooy from comment #14)
I have version 18 nodejs/nodistro,now 18.18.2-1nodesource1 amd64 [installed]
Does `node --version` return 18 ? Maybe you have an older version installed in /usr/local are something like that.
Thats correct (somehow): node --version v14.21.3 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #17 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Yeah, nice: /usr/bin/node --version v18.18.2 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #18 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Just adding a few lines for anyone who reads this later. Resolved situation by: Using NODE_MAJOR=18 # npm / nodejs mkdir -p /etc/apt/keyrings; \ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \ apt-get update; \ apt-get -yq install nodejs; \ npm install -g yarn; \ Note that you cannot apt-get install nodejs npm. This gives a conflict. npm is part of the above install of nodejs. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #19 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Marcel de Rooy from comment #18)
Just adding a few lines for anyone who reads this later. Resolved situation by:
Using NODE_MAJOR=18
# npm / nodejs mkdir -p /etc/apt/keyrings; \ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \ apt-get update; \ apt-get -yq install nodejs; \ npm install -g yarn; \
Note that you cannot apt-get install nodejs npm. This gives a conflict. npm is part of the above install of nodejs.
Yes, see also https://gitlab.com/koha-community/koha-testing-docker/-/issues/404 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35332 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35332 [Bug 35332] gulp po:update (may) generates incorrect Koha-messages.pot -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 --- Comment #20 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Jonathan Druart from comment #9)
Logging the following here.
There is a bug when you run `gulp po:update` without --lang (or with all langs passed).
Error: Command failed: msgmerge --backup=off --no-wrap --quiet -F --update misc/translator/po/en-NZ-messages.po misc/translator/Koha-messages.pot
misc/translator/Koha-messages.pot:11:35: syntax error
misc/translator/Koha-messages.pot:11: keyword "n" unknown
misc/translator/Koha-messages.pot:12: end-of-line within string
There is an extra quote at the end of line 11 ("\n" instead of \n").
Doing a po:extract then a po:update seems to fix the problem.
See bug 35332. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.11.00 |23.11.00,23.05.6,22.11.12,2 released in| |2.05.17,21.11.26 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35079 Bug 35079 depends on bug 35024, which changed state. Bug 35024 Summary: Do not wrap PO files https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35024 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org