Univention Bugzilla – Attachment 7271 Details for
Bug 39146
syntax.py replaces locale settings on import
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
set locale for translation of country names without setting the locale for the whole process
country_syntax_dont_set_process_locale.patch (text/plain), 1.03 KB, created by
Daniel Tröder
on 2015-11-10 11:16:54 CET
(
hide
)
Description:
set locale for translation of country names without setting the locale for the whole process
Filename:
MIME Type:
Creator:
Daniel Tröder
Created:
2015-11-10 11:16:54 CET
Size:
1.03 KB
patch
obsolete
>diff --git a/management/univention-directory-manager-modules/modules/univention/admin/syntax.py b/management/univention-directory-manager-modules/modules/univention/admin/syntax.py >index 9408dc2..f20cf54 100644 >--- a/management/univention-directory-manager-modules/modules/univention/admin/syntax.py >+++ b/management/univention-directory-manager-modules/modules/univention/admin/syntax.py >@@ -3043,13 +3043,9 @@ class ObjectFlag( select ): > class Country(select): > empty_value = True > >- try: >- locale.setlocale(locale.LC_ALL, "") >- except locale.Error: >- # unsupported locale setting: a locale was not installed (probably de_DE.UTF-8) >- pass >- translation = univention.admin.localization.translation('iso_3166') >- _iso_3166 = translation.translate >+ iso_3166 = univention.admin.localization.translation('iso_3166') >+ iso_3166.set_language(str(translation.locale)) >+ _iso_3166 = iso_3166.translate > > choices = [('AF', _iso_3166(u'Afghanistan')), ('AX', _iso_3166(u'\xc5land Islands')), > ('AL', _iso_3166(u'Albania')), ('DZ', _iso_3166(u'Algeria')),
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 39146
:
7271
|
7281