SHA256
1
0
forked from pool/python

Accepting request 129866 from home:dimstar:branches:devel:languages:python:Factory

gettext: also find locale files in /usr/share/bundle-locale. Fixes issues like bnc#617751, where bundle-lang-gnome-<xx> is installed, provides the .mo file, yet the python app does not translate. Installing <app>-lang would solve the issues, but would work against our bundle-lang package strategy... suggestive, this should also  be ported to 12.2

OBS-URL: https://build.opensuse.org/request/show/129866
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python?expand=0&rev=125
This commit is contained in:
Jan Matejek
2012-08-06 16:21:50 +00:00
committed by Git OBS Bridge
parent 6449546d67
commit a5bf6b85c9
5 changed files with 39 additions and 0 deletions

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Aug 3 18:43:32 UTC 2012 - dimstar@opensuse.org
- Add python-bundle-lang.patch: gettext: If bindtextdomain is
instructed to look in the default location of translations, we
check additionally in locale-bundle. Fixes issues like bnc#617751
-------------------------------------------------------------------
Tue Jul 31 12:36:04 UTC 2012 - jmatejek@suse.com

View File

@@ -51,6 +51,8 @@ Patch17: remove-static-libpython.diff
# PATCH-FIX-OPENSUSE python-2.7.3-ssl_ca_path.patch [bnc#761501] -- Support directory-based certificate stores with the ca_certs parameter of SSL functions
Patch18: python-2.7.3-ssl_ca_path.patch
Patch19: python-2.7.3-fix-dbm-64bit-bigendian.patch
# PATCH-FEATURE-OPENSUSE python-bundle-lang.patch bnc#617751 dimstar@opensuse.org -- gettext: when looking in default_localedir also check in locale-bundle.
Patch20: python-bundle-lang.patch
# COMMON-PATCH-END
%define python_version %(echo %{tarversion} | head -c 3)
BuildRequires: automake
@@ -138,6 +140,7 @@ other applications.
%patch17
%patch18
%patch19 -p1
%patch20 -p1
# COMMON-PREP-END
# drop Autoconf version requirement

23
python-bundle-lang.patch Normal file
View File

@@ -0,0 +1,23 @@
Index: Python-2.7.3/Lib/gettext.py
===================================================================
--- Python-2.7.3.orig/Lib/gettext.py
+++ Python-2.7.3/Lib/gettext.py
@@ -56,6 +56,7 @@ __all__ = ['NullTranslations', 'GNUTrans
]
_default_localedir = os.path.join(sys.prefix, 'share', 'locale')
+_default_bundlelocaledir = os.path.join(sys.prefix, 'share', 'locale-bundle')
def test(condition, true, false):
@@ -420,6 +421,10 @@ class GNUTranslations(NullTranslations):
# Locate a .mo file using the gettext strategy
def find(domain, localedir=None, languages=None, all=0):
+ if localedir in [None, _default_localedir]:
+ bundle = find(domain, localedir=_default_bundlelocaledir, languages=languages, all=all)
+ if len(bundle):
+ return bundle
# Get some reasonable defaults for arguments that were not supplied
if localedir is None:
localedir = _default_localedir

View File

@@ -47,6 +47,8 @@ Patch17: remove-static-libpython.diff
# PATCH-FIX-OPENSUSE python-2.7.3-ssl_ca_path.patch [bnc#761501] -- Support directory-based certificate stores with the ca_certs parameter of SSL functions
Patch18: python-2.7.3-ssl_ca_path.patch
Patch19: python-2.7.3-fix-dbm-64bit-bigendian.patch
# PATCH-FEATURE-OPENSUSE python-bundle-lang.patch bnc#617751 dimstar@opensuse.org -- gettext: when looking in default_localedir also check in locale-bundle.
Patch20: python-bundle-lang.patch
# COMMON-PATCH-END
Provides: pyth_doc
Provides: pyth_ps
@@ -95,6 +97,7 @@ Python, and Macintosh Module Reference in PDF format.
%patch17
%patch18
%patch19 -p1
%patch20 -p1
# COMMON-PREP-END
%build

View File

@@ -55,6 +55,8 @@ Patch17: remove-static-libpython.diff
# PATCH-FIX-OPENSUSE python-2.7.3-ssl_ca_path.patch [bnc#761501] -- Support directory-based certificate stores with the ca_certs parameter of SSL functions
Patch18: python-2.7.3-ssl_ca_path.patch
Patch19: python-2.7.3-fix-dbm-64bit-bigendian.patch
# PATCH-FEATURE-OPENSUSE python-bundle-lang.patch bnc#617751 dimstar@opensuse.org -- gettext: when looking in default_localedir also check in locale-bundle.
Patch20: python-bundle-lang.patch
# COMMON-PATCH-END
BuildRequires: automake
BuildRequires: db-devel
@@ -178,6 +180,7 @@ implementation of the standard Unix DBM databases.
%patch17
%patch18
%patch19 -p1
%patch20 -p1
# COMMON-PREP-END
# drop Autoconf version requirement