GnuCash
Contact   Instructions
Bug 797126 - It is annoying to run cmake to get an updated mo file
Summary: It is annoying to run cmake to get an updated mo file
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Build system (show other bugs)
Version: unspecified
Hardware: PC Linux
: Normal normal
Target Milestone: ---
Assignee: core
QA Contact: core
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-06 01:22 EST by Frank H. Ellenberger
Modified: 2021-01-28 23:27 EST (History)
6 users (show)

See Also:


Attachments

Description Frank H. Ellenberger 2019-03-06 01:22:21 EST
IIRC, in autotools we had a rule, so that after the change of a .po file, the associated .mo file was regenerated by msgfmt. A multiple of the time, which is saved by the use of ninja, is consumed by the current requirement to rerun cmake at least for translators.

As I still have not read all the details of cmake, here are a few pointers to solve the issue:
https://cmake.org/cmake/help/latest/module/FindGettext.html#module:FindGettext

https://github.com/jarro2783/CMake-Gettext/
Comment 1 Geert Janssens 2019-05-27 08:19:01 EDT
Looking at the cmake configuration it seems we still have similar build rules.

The build rule now is (depending on whether you configure for make or ninja):
make po-gmo
or
ninja po-gmo
ninja is sometimes installed as ninja-build so depending on your platform this could also be
ninja-build po-gmo

This will update all mo files for which the po file had changed. The updated po files will be avaialable in
<build-dir>/po

However if you also want them to be installed in a way that you can run gnucash from the build directory using updated po files, there's a second target:
make po-gmo-build
(or replace make with ninja/ninja-build as needed)

Is this what you are looking for ?
Comment 2 Geert Janssens 2019-05-27 08:48:19 EDT
Turns out there was a dependency issue with these commands after all.

I have pushed a fix. Can you try if this now does what you want ?
Comment 3 John Ralls 2021-01-28 20:12:54 EST
Frank, are you happy with Geert's change? It's been over a year and a half.
Comment 4 Frank H. Ellenberger 2021-01-28 23:27:48 EST
Oops, totally I had forgotten, but right as I worked on Bug 798104, I had not to run cmake.

The confusing part: The normal ninja call didn't report, that it had rebuild da.mo.
But in 'ninja install' was:
Installing: /usr/local/share/locale/da/LC_MESSAGES/gnucash.mo

Soo, yes, I have less work.

Note You need to log in before you can comment on or make changes to this bug.