summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorAleksei Slaikovskii <aslaikov@redhat.com>2018-01-23 14:41:25 +0100
committerTibor Dudlák <tdudlak@redhat.com>2018-01-31 16:03:19 +0100
commit6c5a7464b26eaf5af890af3b0433bbb6e7bc5f3e (patch)
treefcfaea734bc91f32dd7a43af6bc45545931fe976 /ipalib
parent1235f5958dd61e6f99191e512953acdf8b577fff (diff)
downloadfreeipa-6c5a7464b26eaf5af890af3b0433bbb6e7bc5f3e.tar.gz
freeipa-6c5a7464b26eaf5af890af3b0433bbb6e7bc5f3e.tar.xz
freeipa-6c5a7464b26eaf5af890af3b0433bbb6e7bc5f3e.zip
Fixing translation problems
ipa rpc server did set the LANG environment variable on each request and it was not thread safe which led to unpredictable mixed languages output. Also, there were mistakes regarding setting the Accept-Language HTTP header. Now on each request we're setting the "languages" property in the context thread local variable and client is setting the Accept-Language HTTP header correctly. Also, as the server is caching the schema and the schema can be generated for several languages it's good to store different schema fingerprint for each language separately. pagure: https://pagure.io/freeipa/issue/7238 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com> Reviewed-By: Tibor Dudlak <tdudlak@redhat.com>
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/rpc.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ipalib/rpc.py b/ipalib/rpc.py
index 539d4cfc9..c6a8989f5 100644
--- a/ipalib/rpc.py
+++ b/ipalib/rpc.py
@@ -536,7 +536,9 @@ class LanguageAwareTransport(MultiProtocolTransport):
self, host)
try:
- lang = locale.setlocale(locale.LC_ALL, '').split('.')[0].lower()
+ lang = locale.setlocale(
+ locale.LC_MESSAGES, ''
+ ).split('.')[0].lower()
except locale.Error:
# fallback to default locale
lang = 'en_us'