Closed rbovard closed 6 years ago
You can add in your file <project>.mk
after the incluse CONST_Makefile
:
$(PACKAGE)/locale/%/LC_MESSAGES/$(PACKAGE)-$(L10N_CLIENT_POSTFIX).po: $(PACKAGE)/static/js/Proj/Lang/%.js
.build/venv/bin/l10nv1tov2 $* $< $@
Just for explain:
$*
is what is represent by %
$<
is the first dependency$@
is the destinationThanks @sbrunner but it doesn't change the situation.
With this modification, after a build I still have the unwanted changes in my <package>-client.po
and I need to redo manually a l10nv1tov2
.
And if I do a change in <package>/static/js/Proj/Lang/fr.js
and a build after that, the change is not repercuted in the <package>-client.po
, I also need to redo manually a l10nv1tov2
to have them.
The unwanted changes in <package>-client.po
contain a lot of #~ msgid
and +#, fuzzy
.
New solution by adding the following rules for the french:
$(PACKAGE)/locale/fr/LC_MESSAGES/$(PACKAGE)-$(L10N_CLIENT_POSTFIX).po: $(PACKAGE)/static/js/Proj/Lang/fr.js
.build/venv/bin/l10nv1tov2 fr $< $@
$(PACKAGE)/locale/nyon-client.pot:
@echo nothing to do for $@
Thanks it seems better, I have no more those unwanted changes after rebuilds.
I don't know if it's related, but I have this warning:
.build/venv/bin/pot-create --keyword _ --config lingua-server.cfg --output nyon/locale/nyon-server.pot nyon/models.py nyon/templates/desktop.html nyon/templates/mobile.html nyon/templates/api/xapihelp.html nyon/templates/api/apihelp.html nyon/templates/api/apihelp_old.html || true
.build/venv/local/lib/python2.7/site-packages/lingua/extract.py:330: UnicodeWarning: Python extractor called with bytes input. Please update your plugin to submit unicode instead.
for message in extractor(real_filename, options):
No translatable strings found, aborting
# removes the always changed date line
[ ! -f nyon/locale/nyon-server.pot ] || sed -i '/^"POT-Creation-Date: /d' nyon/locale/nyon-server.pot
[ ! -f nyon/locale/nyon-server.pot ] || sed -i '/^"PO-Revision-Date: /d' nyon/locale/nyon-server.pot
[ ! -f nyon/locale/nyon-server.pot ] || chmod go+r nyon/locale/nyon-server.pot
If it's ok for you, you can close this issue.
Thanks for the feedback :-)
Mmmh I think there is a side effect because after a make clean
(in v2.2.1), I got this error:
nyon.mk:34: warning: overriding recipe for target 'nyon/locale/nyon-client.pot'
CONST_Makefile:725: warning: ignoring old recipe for target 'nyon/locale/nyon-client.pot'
Nothing to do for nyon/locale/nyon-client.pot
mkdir -p nyon/locale/fr/LC_MESSAGES/
[ -f nyon/locale/fr/LC_MESSAGES/nyon-client.po ] || msginit --no-translator --input=nyon/locale/nyon-client.pot --output-file=nyon/locale/fr/LC_MESSAGES/nyon-client.po -l fr
touch --no-create nyon/locale/fr/LC_MESSAGES/nyon-client.po
msgmerge --backup=none --update --sort-output --no-location nyon/locale/fr/LC_MESSAGES/nyon-client.po nyon/locale/nyon-client.pot
msgmerge: error while opening "nyon/locale/nyon-client.pot" for reading: No such file or directory
CONST_Makefile:743: recipe for target 'nyon/locale/fr/LC_MESSAGES/nyon-client.po' failed
make: *** [nyon/locale/fr/LC_MESSAGES/nyon-client.po] Error 1
@sbrunner Could you please reopen it?
@ochriste ?
sorry, I reopened this by error
In fact it should be reopened since the fix of @sbrunner doesn't work after a build after a clean all.
I was wondering why you closed it.
oh, because it was already closed, so I just put it back to the state it was. but we can reopen it if the issue is still not solved, sorry about that.
@rbovard I'm not able to reproduce it...
diff --git a/nyon.mk b/nyon.mk
index 8976e50..25e68cf 100644
--- a/nyon.mk
+++ b/nyon.mk
@@ -9,7 +9,7 @@ VISIBLE_WEB_HOST ?= map.nyon.ch
APACHE_VHOST ?= nyon-geoportail
LANGUAGES = fr
PRINT_VERSION = 2
-TILECLOUD_CHAIN_LOCAL ?= TRUE
+TILECLOUD_CHAIN_LOCAL ?= FALSE
CGXP_INTERFACES = desktop edit routing
NGEO_INTERFACES = mobile
@@ -26,3 +26,9 @@ DEPLOY_BRANCH_BASE_URL ?= $(VISIBLE_PROTOCOL)://$(VISIBLE_HOST) DEPLOY_BRANCH_MAKEFILE ?= nyon.mk
include CONST_Makefile + +$(PACKAGE)/locale/fr/LC_MESSAGES/$(PACKAGE)-$(L10N_CLIENT_POSTFIX).po: $(PACKAGE)/static/js/Proj/Lang/fr.js
+$(PACKAGE)/locale/nyon-client.pot:
@sbrunner On branch 2.2?
git clone git@github.com:camptocamp/nyon_c2cgeoportal.git
cd nyon_c2cgeoportal
git checkout -b v22 origin/v22
(get secure.mk)
make -f instance_dev_$USER.mk build
git status
On branch v22
Your branch is up-to-date with 'origin/v22'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: nyon/locale/fr/LC_MESSAGES/nyon-client.po
The diff is the same type as I sent you by email (a lot of fuzzy and #~)...
I dontn't see any trace of the workaround then it can work... (or where is it?)
Be aware of this side effect when fixing this issue.
Effectively, I forgot to use it...
It's the case now, after a cleanall and a build, I still have those unwanted changes...
No more present on 2.3, closing
After every build, the file
<package>-client.po
is updated even if no transalations were edited.If I do a
l10nv1tov2
The file is now correct (no changes)
It reminds me https://github.com/camptocamp/c2cgeoportal/issues/2377