View Issue Details

IDProjectCategoryView StatusLast Update
0001127Main CAcert Websitetranslationspublic2015-09-29 20:45
Reporterwytze Assigned ToBenBE  
PrioritynormalSeverityminorReproducibilityalways
Status solved?Resolutionfixed 
Product Version2012 Q4 
Target Version2014 Q2Fixed in Version2015 Q3 
Summary0001127: messages,pot file created by www/locale/Makefile contains misleading file references
DescriptionThe Makefile in www/locale contains a recipe for creating a messages.pot file, which is uploaded to the translations.cacert.org server for translation. Messages are extracted from a wildcarded list of files. Due to the presence of a symbolic link 'crl' which points to '.' in the ../www/ directory, this file list contains file names like ../www/crl/....php, i.e. files which cannot be found in the source tar ball of the CAcert web application. This is misleading, and also redundant, since the same files have already been processed through their ../www/....php filename.
Steps To ReproduceGo to www/locale and run 'make messages.pot'
Additional InformationIn order to simplify the solution of this problem, the symbolic link 'crl' mentioned above has been renamed to 'CRL' (all uppercase). Thus a more selective wildcard (containing only directory names starting with a lowercase letter) can be used in the www/locale/Makefile recipe. This leads to the following fix for this problem:

cvs diff -u Makefile
Index: Makefile
===================================================================
RCS file: /var/lib/cvs/cacert/locale/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile 29 Apr 2012 18:32:27 -0000 1.2
+++ Makefile 16 Dec 2012 16:43:51 -0000
@@ -144,7 +144,7 @@
 ../pages/*/*.php \
 ../scripts/*.php \
 ../www/*.php \
-../www/*/*.php \
+../www/[a-z]*/*.php \
 # ../tverify/*.php \
 # ../tverify/*/*.php \

This fix has been tested on the production server and the resulting messages.pot file has been uploaded to the translations server.
TagsNo tags attached.
Reviewed byNEOatNHNG, BenBE
Test Instructions

Relationships

related to 0001113 needs workBenBE Change english textes according to the wiki page https://wiki.cacert.org/Software/TranslationMisspelling 

Activities

wytze

2012-12-16 18:01

developer  

Makefile (3,933 bytes)   
#
# This Makefile will download the translations from our translation server (if
# they don't exist yet) and compile them. Try target help for more information
#

################################################################################
###                                 Download                                 ###
################################################################################

DOWNLOAD_SERVER := translations.cacert.org
PO_URL_TEMPLATE := http://$(DOWNLOAD_SERVER)/export/cacert/%/messages.po

# Only use languages that have 10% or more of translated strings
AUTO_LANGS := \
en \
de \
nl \
pt_BR \
fr \
sv \
it \
es \
hu \
fi \
ja \
bg \
pt \
da \
pl \
zh_CN \
ru \
lv \
cs \
zh_TW \
el \
tr \
ar \

LANGS := \
ar \
bg \
cs \
da \
de \
el \
en \
es \
fa \
fi \
fr \
he \
hr \
hu \
id \
is \
it \
ja \
ka \
ko \
lv \
nb \
nl \
pl \
pt \
pt_BR \
ro \
ru \
sl \
sv \
th \
tr \
uk \
zh_CN \
zh_TW \


PO_FILE_TEMPLATE := %/messages.po
MO_FILE_TEMPLATE := %/LC_MESSAGES/messages.mo


# target: all - Build locales downloading po files
.PHONY: all
all: $(AUTO_LANGS)


# target: help - Display callable targets
.PHONY: help
help:
	@egrep "^# target:" [Mm]akefile


# target: clean - remove the build directories
RM := rm -rf
.PHONY: clean
clean:
	-$(RM) $(LANGS:%=%/)


# target: <lang> - build this particular language
.PHONY: $(LANGS)
$(LANGS): %: $(MO_FILE_TEMPLATE)


$(LANGS:%=$(MO_FILE_TEMPLATE)): $(MO_FILE_TEMPLATE): $(PO_FILE_TEMPLATE)
	mkdir -p $(@D)
#filter obsolete translations
	grep --invert-match '^#~ ' $< | \
		msgfmt --check --output-file $@ -


.PHONY: $(LANGS:%=$(PO_FILE_TEMPLATE))
$(LANGS:%=$(PO_FILE_TEMPLATE)):
	mkdir -p $(@D)
	wget --output-document - '$(@:$(PO_FILE_TEMPLATE)=$(PO_URL_TEMPLATE))' | \
		php -f escape_special_chars.php \
		> $@




################################################################################
###                                 Upload                                   ###
################################################################################

UPLOAD_SERVER := $(DOWNLOAD_SERVER)
SSH_USER := critical
SSH_OPTIONS :=
SCP_OPTIONS := $(SSH_OPTIONS)

FILE_OWNER := www-data

POT_UPLOAD_PATH := /var/www/Pootle/po/cacert/templates/messages.pot
MANAGE_PY := /var/www/Pootle/manage.py

VERSION := Production
DESCRITPION := LibreSSL - CAcert web application (localisation files)
COPYRIGHT_YEAR := 2004-$(shell date +\%Y)
PACKAGE := LibreSSL

GETTEXT_FILE_PATTERN := \
../CommModule/client.pl \
../includes/*.php \
../includes/*/*.php \
../pages/*/*.php \
../scripts/*.php \
../www/*.php \
../www/[a-z]*/*.php \
# ../tverify/*.php \
# ../tverify/*/*.php \

GETTEXT_FILES := $(wildcard $(GETTEXT_FILE_PATTERN))

# target: template - create the gettext template file, if you want to upload it
# target:            onto the translation server you can directly use the
# target:            target "upload"
.PHONY: template
template: messages.pot

# target: template.clean - remove anything that was created during the build of
# target:                  the template file
.PHONY: template.clean
template.clean:
	-$(RM) messages.pot


# target: upload - upload the template to the translation server
.PHONY: upload
upload: messages.pot
	scp $(SCP_OPTIONS) messages.pot $(SSH_USER)@$(UPLOAD_SERVER):$(POT_UPLOAD_PATH)
	ssh $(SSH_OPTIONS) $(SSH_USER)@$(UPLOAD_SERVER) "sudo -u $(FILE_OWNER) pootle-update cacert"

# target: upload.clean - remove anything that was created during the upload
.PHONY: upload.clean
upload.clean: template.clean

messages.pot: $(GETTEXT_FILES)
	xgettext --output - --sort-by-file --copyright-holder "CAcert Inc." \
		--package-name "CAcert" --package-version "$(VERSION)" \
		--msgid-bugs-address "translations-admin@cacert.org" $^ | \
		# replace place holders in the lines before the first msgid\
		sed '1,/^msgid/ { s/SOME DESCRIPTIVE TITLE/$(DESCRITPION)/; s/YEAR/$(COPYRIGHT_YEAR)/; s/PACKAGE/$(PACKAGE)/ }' \
		> $@

Makefile (3,933 bytes)   

BenBE

2015-09-29 20:38

updater   ~0005462

Last edited: 2015-09-29 20:45

After validation of the proposal by Wytze via mail regarding a20140422.2, sorry for the delay, the following thing is declared:

The change introduced by the Critical Administrator Team referenced in this bug tracker issue has caused no side effects or malfunctions. The behaviour is as it has been intended by the change.

Due to configuration changes done by the critical team in the mean time the change has become obsolete, but will be retained as it provides freedoms for the configuration of the server, while not impacting the software.

Thus while the introduction of this change did not quite follow the usual change management, this minor change is hereby accepted.

Benny Baumann
Software Assessment Team

Issue History

Date Modified Username Field Change
2012-12-16 18:01 wytze New Issue
2012-12-16 18:01 wytze File Added: Makefile
2012-12-16 18:53 INOPIAE Relationship added related to 0001113
2013-01-10 14:48 Werner Dworak Status new => needs work
2015-09-29 20:38 BenBE Reviewed by => NEOatNHNG, BenBE
2015-09-29 20:38 BenBE Note Added: 0005462
2015-09-29 20:38 BenBE Assigned To => BenBE
2015-09-29 20:38 BenBE Status needs work => solved?
2015-09-29 20:38 BenBE Resolution open => fixed
2015-09-29 20:38 BenBE Product Version => 2012 Q4
2015-09-29 20:38 BenBE Fixed in Version => 2015 Q3
2015-09-29 20:38 BenBE Target Version => 2014 Q2
2015-09-29 20:45 BenBE Note Edited: 0005462