[i18n] bzr python installation should look for mo files in system python location

Bug #940704 reported by IWATA Hidetaka
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Martin Packman
2.5
Fix Released
High
Martin Packman

Bug Description

I tried `python setup.py install` on the source directory of 2.5.0
So, mo files were installed to $PYTHONHOME\share\locale, but i18n was not activated.

i18n was activated after copying locale into $PYTHONHOME\site-packages\bzrlib manually.

VERSION INFO:
Bazaar (bzr) 2.5.0
  Python interpreter: C:\DEVELOP\py_envs\bzr2.5-py26\Scripts\python.exe 2.6.6
  Python standard library: C:\DEVELOP\py_envs\bzr2.5-py26\lib
  Platform: Windows-7-6.1.7601-SP1
  bzrlib: C:\DEVELOP\py_envs\bzr2.5-py26\lib\site-packages\bzrlib

Tags: win32 i18n

Related branches

Revision history for this message
Alexander Belchenko (bialix) wrote :

We shoul teach bzr to look into $PYTHONHOME\share\locale.
It hasn't been done for qbzr/explorer because they're rarely installed into site-packages.

I did support for $PYTHONHOME\share\locale in my old bzr-config project. We can borrow some ideas from there.

tags: added: i18n
Jelmer Vernooij (jelmer)
Changed in bzr:
status: New → Confirmed
importance: Undecided → High
milestone: none → 2.5.1
tags: added: win32
Revision history for this message
Alexander Belchenko (bialix) wrote :

Stdlib's gettext.py tries to find mo files in

_default_localedir = os.path.join(sys.prefix, 'share', 'locale')

I think we need to implement complex search logic to find mo files in different locations:

1) along bzr script or bzr.exe (to handle either running from sources or standalone bzr.exe)
2) in os.path.join(sys.prefix, 'share', 'locale') (to handle python installation)
3) distro-specific location

We can detect whether we run from bzr.exe or system python interpreter. We also should be able to differentiate between running from source or from python installation (by checking path to bzrlib). I think we should be able to correctly handle all 3 cases above.

Revision history for this message
Alexander Belchenko (bialix) wrote :

BTW, guys, I've just spotted that for bzr.exe setup.py script put the mo files into share/locale as well. I think this is mistake, and for bzr.exe we don't have to have 2 levels and will be fine with just locale. Probably it's a bit late for bzr 2.5.0

Revision history for this message
Alexander Belchenko (bialix) wrote :

The "good" thing that bzr 2.5b6 does not include any mo files yet. I've filed https://bugs.launchpad.net/bzr-windows-installers/+bug/941835

summary: - [i18n] Installation problem ?
+ [i18n] bzr python installation should look for mo files in system python
+ location
Revision history for this message
Gordon Tyler (doxxx) wrote :

Could you give me a description of how to reproduce the problem so I can check if it the Mac OS X install is suffering from the same bug?

Martin Packman (gz)
Changed in bzr:
milestone: 2.5.1 → none
Revision history for this message
Martin Packman (gz) wrote :

I think the change now landed in lp:bzr/2.5 should be sufficient, can someone confirm that?

Changed in bzr:
assignee: nobody → Martin Packman (gz)
milestone: none → 2.6b2
status: Confirmed → In Progress
Martin Packman (gz)
Changed in bzr:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.