Skip to content
Browse files

Initialize the C library's gettext interface/libintl on linux2

systems using Python's locale.bindtextdomain and friends.

Thanks to Jendrik Seipp for reporting this oversight!
  • Loading branch information...
1 parent ddfecbc commit d09997cfef8584f9f0bf227752bab890a66a0a61 @dieterv committed Jul 11, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/elib/intl/__init__.py
View
7 lib/elib/intl/__init__.py
@@ -419,6 +419,13 @@ def _install(domain, localedir, asglobal=False):
if sys.platform == 'win32' or sys.platform == 'nt':
_putenv('LANGUAGE', _getscreenlanguage())
+ # The locale module on Max OS X lacks bindtextdomain so we specifically
+ # test on linux2 here. See commit 4ae8b26fd569382ab66a9e844daa0e01de409ceb
+ if sys.platform == 'linux2':
+ locale.bindtextdomain(domain, localedir)
+ locale.bind_textdomain_codeset(domain, 'UTF-8')
+ locale.textdomain(domain)
+
# initialize Python's gettext interface
gettext.bindtextdomain(domain, localedir)
gettext.bind_textdomain_codeset(domain, 'UTF-8')

0 comments on commit d09997c

Please sign in to comment.
Something went wrong with that request. Please try again.