Merge lp:~jr/bzr/i18n-install-once into lp:bzr

Proposed by Jonathan Riddell
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merged at revision: 6114
Proposed branch: lp:~jr/bzr/i18n-install-once
Merge into: lp:bzr
Diff against target: 37 lines (+5/-1)
3 files modified
bzrlib/commands.py (+1/-1)
bzrlib/i18n.py (+2/-0)
doc/en/release-notes/bzr-2.5.txt (+2/-0)
To merge this branch: bzr merge lp:~jr/bzr/i18n-install-once
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) Approve
Review via email: mp+73508@code.launchpad.net

Commit message

Do not run i18n initialisation twice.

Description of the change

Check that i18n has been initialized rather than doing it twice.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
Jonathan Riddell (jr) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/commands.py'
2--- bzrlib/commands.py 2011-07-15 14:27:20 +0000
3+++ bzrlib/commands.py 2011-08-31 11:10:18 +0000
4@@ -465,7 +465,7 @@
5 usage help (e.g. Purpose, Usage, Options) with a
6 message explaining how to obtain full help.
7 """
8- if self.l10n and not i18n.installed():
9+ if self.l10n:
10 i18n.install() # Install i18n only for get_help_text for now.
11 doc = self.help()
12 if doc:
13
14=== modified file 'bzrlib/i18n.py'
15--- bzrlib/i18n.py 2011-08-25 10:33:14 +0000
16+++ bzrlib/i18n.py 2011-08-31 11:10:18 +0000
17@@ -72,6 +72,8 @@
18
19 def install(lang=None):
20 global _translations
21+ if installed():
22+ return
23 if lang is None:
24 lang = _get_current_locale()
25 if lang is not None:
26
27=== modified file 'doc/en/release-notes/bzr-2.5.txt'
28--- doc/en/release-notes/bzr-2.5.txt 2011-08-27 19:08:54 +0000
29+++ doc/en/release-notes/bzr-2.5.txt 2011-08-31 11:10:18 +0000
30@@ -111,6 +111,8 @@
31
32 * Install translation .mo files. (Jonathan Riddell)
33
34+* Do not run i18n initialisation twice. (Jonathan Riddell)
35+
36 Bug Fixes
37 *********
38