[Bug 35342] New: Use a Makefile to manage PO files
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 Bug ID: 35342 Summary: Use a Makefile to manage PO files Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: I18N/L10N Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: frederic@tamil.fr, jonathan.druart+koha@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 158981 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158981&action=edit Bug 35342: Use a Makefile to manage PO files There were some problems recently involving gulp and PO files, which are still unresolved at the time of writing. Debugging this is hard and time-consuming (failures are hard to reproduce) Why make/a Makefile ? * Creating/updating PO files is essentially passing a list of input files to a command that will produce a new/updated output file, and that's exactly what make does * It builds only what's needed by default (if source files haven't changed, no need to rebuild the .pot, and so .po files don't need to be updated either) * It handles parallelism well To use the Makefile, you need to be at the root directory of Koha, and then you can run: make -f misc/translator/Makefile help To have a list of available targets make -f misc/translator/Makefile all To update all PO files make -f misc/translator/Makefile pot To rebuild all POT files make -f misc/translator/Makefile en-GB To update all en-GB PO files make -f misc/translator/Makefile misc/translator/Koha-installer.pot To update that particular file By default, it won't build a target (output file) if its prerequisites (input files) are older than the target. It can be forced with -B/--always-make By default, all targets are built sequentially. To enable parallelism, use -j/--jobs Multiple targets can be specified on the command line, so it's possible to do: make -f misc/translator/Makefile -j -B en-GB fr-FR gulpfile.js is updated to uses this Makefile This patch also includes a fix in Koha/Database/Columns.pm (a translated empty string caused gettext to emit a warning and to place the header in the middle of the .po/.pot file) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff --- Comment #2 from Julian Maurice <julian.maurice@biblibre.com> --- In one of the many attempts to find a solution to bug 35332 I tried to use a Makefile instead, and haven't been able to reproduce the problem with it, so.. I guess this is a possible fix ? Certainly not for 23.11, but I think it's a robust solution for future releases I compared with podiff2 (https://github.com/eshagh79/podiff2) the produced POT files to what master does and it found no differences (it only compares msgid I think, not comments) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158981|0 |1 is obsolete| | --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 158992 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158992&action=edit Bug 35342: Use a Makefile to manage PO files There were some problems recently involving gulp and PO files, which are still unresolved at the time of writing. Debugging this is hard and time-consuming (failures are hard to reproduce) Why make/a Makefile ? * Creating/updating PO files is essentially passing a list of input files to a command that will produce a new/updated output file, and that's exactly what make does * It builds only what's needed by default (if source files haven't changed, no need to rebuild the .pot, and so .po files don't need to be updated either) * It handles parallelism well To use the Makefile, you need to be at the root directory of Koha, and then you can run: make -f misc/translator/Makefile help To have a list of available targets make -f misc/translator/Makefile all To update all PO files make -f misc/translator/Makefile pot To rebuild all POT files make -f misc/translator/Makefile en-GB To update all en-GB PO files make -f misc/translator/Makefile misc/translator/Koha-installer.pot To update that particular file By default, it won't build a target (output file) if its prerequisites (input files) are older than the target. It can be forced with -B/--always-make By default, all targets are built sequentially. To enable parallelism, use -j/--jobs Multiple targets can be specified on the command line, so it's possible to do: make -f misc/translator/Makefile -j -B en-GB fr-FR gulpfile.js is updated to uses this Makefile This patch also includes a fix in Koha/Database/Columns.pm (a translated empty string caused gettext to emit a warning and to place the header in the middle of the .po/.pot file) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 --- Comment #4 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Could you consider providing a perl script instead? :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=35332 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 --- Comment #5 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Jonathan Druart from comment #4)
Could you consider providing a perl script instead? :) Why ? I remember we talked about the readability issue on IRC but that can be fixed. Is there something else ? A Makefile seems like the best tool for this job
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de --- Comment #6 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Could I suggest, that we keep the idea of a Makefile (which I like) but use a more user friendly variant? Check out just at https://github.com/casey/just. It's portable and the documentation is very good. It's basically the same thing w/o much of the arcane syntax. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 --- Comment #7 from Julian Maurice <julian.maurice@biblibre.com> --- 'just' looks more like a gulp alternative than a make alternative. It is fairly new (1.0 was released in 2022) and is not packaged in Debian stable. Who knows if it will still be around in 5 years ? And it looks like it would rebuild everything even if no files changed. I am curious about what an equivalent justfile would look like, but my preference still goes to make for now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 --- Comment #8 from Paul Derscheid <paul.derscheid@lmscloud.de> --- You are right to be sceptical, however just is currently available in sid (unstable) and trixie (testing) repos. For reference: https://packages.debian.org/search?keywords=just. I'll try to translate the Makefile into a justfile for a comparison. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- It's still a new dependency, so please think thoroughly if the benefit is high enough. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 --- Comment #10 from Paul Derscheid <paul.derscheid@lmscloud.de> --- This is all valid. Let's wait for just to be available in debian stable before thinking of integrating it. For now I'd like to eradicate gulp completely and thankfully this was the heavy part. Therefore let's go w/ the Makefile. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #11 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Sorry, doesn't apply anymore. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35342 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |RESOLVED Resolution|--- |WONTFIX --- Comment #12 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Julian Maurice from comment #1)
There were some problems recently involving gulp and PO files, which are still unresolved at the time of writing.
This does not seem true anymore. Marking as WONTFIX. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org