[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#655516: Please, use a simple po4a configuration file



Source: debian-edu-config
Version: 1.447
Severity: minor
Tags: patch l10n

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

Thanks to Petter Reinholdtsen who just committed a fix in r75276,
translators will now benefit of the previous msgid when they translate
the web page. Please note that po4a offer a nice way to handle
translations, and PO and POT files update, with a single (and simple)
configuration file, that don't even need to hard-code language names (so
adding a new translation is as easy as dropping a new PO file).

The attached patch provide the po4a configuration file and some
simplifications to the Makefile (I'm far from a Makefile wizard, so
there is probably room for improvement), but as you can see, the only
needed call to translate and update files is “po4a <config file>”.

There is anyway one slight difference in the PO files: Author and
Content-Type are now translatable, but, other translatable (in a PO file
point of view) strings, like language names in their native language,
are already available for translation. I'll try to fix that by splitting
the index.html.en source file and provide a more intrusive patch to fix
that unless someone objects.

Regards

David

- -- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJPDgWhAAoJELgqIXr9/gnyBX4QAIyODlWMsmsvBIc917lvsMHa
COCaDKUNN3X38uAjjVCSTlgVVAi34S5KSw48cPFCCH8iWA5Hcv1poaf/m4Bb6t2S
PUlYTAlylxpCJYM7PXMxpbv4VjAkwVjHQdfJDPf4hH8CGIJEXQu/kx22scFbIbq7
iG6N1v+DzzLox7aHTTJT5CTn0tOOI5iEFYm4vgUvJtdrll2V9syAOgooXrfdW+hD
djdH60x//1J4xBrF9LBNvuDTGRewp+xhNvGD/sBBoSybmuvRThGW1ah174iPKYOE
HnfiQx/ah/cVKl6JhE31utcQECeUVBGuy4ZyIHV0cjYFnMOtS/12OwokMZq9rpBD
LUJRZFG0Q1aCa7+N1cEDpLzKi1xD/ZhhOOIiQ0UGUPeGcPUrZuLI2MVrSUhkQkrD
5kXJZGAp6e0CfEgdYgQ8OeYua2EorU0LvZB3AZAhoK4g0i9L0EIpvvAyc52of444
byeJAL2KFQm960fdEnlb0nVQxFXycvEPgG8l1uxoACT92ZOE9pQCcKC/8CcZBM8A
WlWUdWmLAO+Nxvup061BcAUPhKBh/WyIQ3VYvE6exBa1OpvnNxtub5rSzFvT60uW
jEyqXHFcoI74+oFyEn4GU+FTXAJAMgl7Nl+AoVwHunzcz5fUMGMuaVST4dsGsf1C
j5Y+lk3KYjaGKMHu7ckV
=IT0f
-----END PGP SIGNATURE-----
Index: debian-edu-config/www/po4a.cfg
===================================================================
--- debian-edu-config/www/po4a.cfg	(révision 0)
+++ debian-edu-config/www/po4a.cfg	(révision 0)
@@ -0,0 +1,4 @@
+[po_directory] .
+
+[type: xhtml] index.html.en $lang:index.html.$lang \
+ opt:"-M UTF-8 -k 70 -o attributes='<html><head><meta>content'"
Index: debian-edu-config/www/Makefile
===================================================================
--- debian-edu-config/www/Makefile	(révision 75282)
+++ debian-edu-config/www/Makefile	(copie de travail)
@@ -18,56 +18,13 @@
   index.html.ru \
   index.html.zh 
 
-RATELIMIT = 70 # percent complete to accept.  default is 80%
+all: $(WEBPAGES)
 
-all: index.pot $(WEBPAGES)
+$(WEBPAGES): %.po
 
-%.po: index.pot
-	msgmerge --previous $@ index.pot > $@.new && mv $@.new $@
+%.po: index.html.en
+	po4a po4a.cfg
 
-index.html.de: index.html.en de.po
-	po4a-translate -f xhtml -M UTF-8 -k $(RATELIMIT) -m index.html.en -p de.po -l $@.new -o attributes='<html><head><meta>content'
-	mv $@.new $@
-
-index.html.ca: index.html.en ca.po
-	po4a-translate -f xhtml -M UTF-8 -k $(RATELIMIT) -m index.html.en -p ca.po -l $@.new -o attributes='<html><head><meta>content'
-	mv $@.new $@
-
-index.html.es: index.html.en es.po
-	po4a-translate -f xhtml -M UTF-8 -k $(RATELIMIT) -m index.html.en -p es.po -l $@.new -o attributes='<html><head><meta>content'
-	mv $@.new $@
-
-index.html.fr: index.html.en fr.po
-	po4a-translate -f xhtml -M UTF-8 -k $(RATELIMIT) -m index.html.en -p fr.po -l $@.new -o attributes='<html><head><meta>content'
-	mv $@.new $@
-
-index.html.it: index.html.en it.po
-	po4a-translate -f xhtml -M UTF-8 -k $(RATELIMIT) -m index.html.en -p it.po -l $@.new -o attributes='<html><head><meta>content'
-	mv $@.new $@
-
-index.html.nl: index.html.en nl.po
-	po4a-translate -f xhtml -M UTF-8 -k $(RATELIMIT) -m index.html.en -p nl.po -l $@.new -o attributes='<html><head><meta>content'
-	mv $@.new $@
-
-index.html.nb: index.html.en nb.po
-	po4a-translate -f xhtml -M UTF-8 -k $(RATELIMIT) -m index.html.en -p nb.po -l $@.new -o attributes='<html><head><meta>content'
-	mv $@.new $@
-
-index.html.pt: index.html.en pt.po
-	po4a-translate -f xhtml -M UTF-8 -k $(RATELIMIT) -m index.html.en -p pt.po -l $@.new -o attributes='<html><head><meta>content'
-	mv $@.new $@
-
-index.html.ru: index.html.en ru.po
-	po4a-translate -f xhtml -M UTF-8 -k $(RATELIMIT) -m index.html.en -p ru.po -l $@.new -o attributes='<html><head><meta>content'
-	mv $@.new $@
-
-index.html.zh: index.html.en zh.po
-	po4a-translate -f xhtml -M UTF-8 -k $(RATELIMIT) -m index.html.en -p zh.po -l $@.new -o attributes='<html><head><meta>content'
-	mv $@.new $@
-
-index.pot: index.html.en
-	po4a-gettextize -M UTF-8 -f xhtml -m index.html.en -p $@
-
 stats:
 	@echo "www translations"
 	@for f in *.po; do printf "  $$f: " ; msgfmt --statistics -o /dev/null $$f; done

Reply to: