Merge lp:~jelmer/bzr-builddeb/translations into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: 644
Merged at revision: 657
Proposed branch: lp:~jelmer/bzr-builddeb/translations
Merge into: lp:bzr-builddeb
Diff against target: 41 lines (+26/-0)
2 files modified
Makefile (+18/-0)
__init__.py (+8/-0)
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/translations
Reviewer Review Type Date Requested Status
Vincent Ladeuil Approve
Review via email: mp+82043@code.launchpad.net

Description of the change

Add support for translations based on Riddell's work in bzr 2.5.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

Sounds fine, is there more stuff that needs to be setup on launchpad itself ?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'Makefile'
2--- Makefile 1970-01-01 00:00:00 +0000
3+++ Makefile 2011-11-12 05:07:24 +0000
4@@ -0,0 +1,18 @@
5+all: update-pot
6+
7+.PHONY: update-pot po/bzr-builddeb.pot
8+update-pot: po/bzr-builddeb.pot
9+
10+TRANSLATABLE_PYFILES:=$(shell find . -name '*.py' \
11+ | grep -v 'tests/' \
12+ )
13+
14+po/bzr-builddeb.pot: $(PYFILES) $(DOCFILES)
15+ BZR_PLUGINS_AT=builddeb@$(shell pwd) bzr export-pot \
16+ --plugin=builddeb > po/bzr-builddeb.pot
17+ echo $(TRANSLATABLE_PYFILES) | xargs \
18+ xgettext --package-name "bzr-builddeb" \
19+ --msgid-bugs-address "<bazaar@lists.canonical.com>" \
20+ --copyright-holder "Canonical Ltd. <bazaar@lists.canonical.com>" \
21+ --from-code ISO-8859-1 --sort-by-file --join --add-comments=i18n: \
22+ -d bzr-builddeb -p po -o bzr-builddeb.pot
23
24=== modified file '__init__.py'
25--- __init__.py 2011-10-11 21:22:24 +0000
26+++ __init__.py 2011-11-12 05:07:24 +0000
27@@ -34,6 +34,14 @@
28 )
29
30
31+try:
32+ from bzrlib.i18n import load_plugin_translations
33+except ImportError: # No translations for bzr < 2.5
34+ gettext = lambda x: x
35+else:
36+ translation = load_plugin_translations("bzr-builddeb")
37+ gettext = translation.ugettext
38+
39 commands = {
40 "builddeb_do": ["bd-do"],
41 "builddeb": ["bd"],

Subscribers

People subscribed via source and target branches