public inbox for [email protected]  
help / color / mirror / Atom feed
From: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM4975] Cannot switch UI language
Date: Thu, 5 Dec 2019 13:16:09 +0530
Message-ID: <CAM9w-_k44KZovz9jG8hhCkSVewMKicFEhdJzfxERLTyTDw7Hyw@mail.gmail.com> (raw)

Hi Hackers,

Attached is the patch to fix the issue where user language was not changing.
This is a regression of the theme customization patch - #4348

-- 
Thanks and Regards,
Aditya Toshniwal
Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"


Attachments:

  [application/octet-stream] RM4975.patch (2.0K, 3-RM4975.patch)
  download | inline diff:
diff --git a/web/pgadmin/__init__.py b/web/pgadmin/__init__.py
index 8a38c0ad0..293054f28 100644
--- a/web/pgadmin/__init__.py
+++ b/web/pgadmin/__init__.py
@@ -285,7 +285,7 @@ def create_app(app_name=None):
                 if user is not None:
                     user_id = user.id
             user_language = Preferences.raw_value(
-                'miscellaneous', 'user_language', None, user_id
+                'misc', 'user_language', 'user_language', user_id
             )
             if user_language is not None:
                 language = user_language
@@ -411,7 +411,7 @@ def create_app(app_name=None):
             language = data['language']
 
             # Set the user language preference
-            misc_preference = Preferences.module('miscellaneous')
+            misc_preference = Preferences.module('misc')
             user_languages = misc_preference.preference(
                 'user_language'
             )
diff --git a/web/pgadmin/browser/__init__.py b/web/pgadmin/browser/__init__.py
index 93ab763f7..63753c64e 100644
--- a/web/pgadmin/browser/__init__.py
+++ b/web/pgadmin/browser/__init__.py
@@ -584,7 +584,7 @@ def index():
 
     # Set the language cookie after login, so next time the user will have that
     # same option at the login time.
-    misc_preference = Preferences.module('miscellaneous')
+    misc_preference = Preferences.module('misc')
     user_languages = misc_preference.preference(
         'user_language'
     )
diff --git a/web/pgadmin/preferences/__init__.py b/web/pgadmin/preferences/__init__.py
index 447321713..34c01879b 100644
--- a/web/pgadmin/preferences/__init__.py
+++ b/web/pgadmin/preferences/__init__.py
@@ -190,7 +190,7 @@ def save(pid):
     # This will execute every time as could not find the better way to know
     # that which preference is getting updated.
 
-    misc_preference = Preferences.module('miscellaneous')
+    misc_preference = Preferences.module('misc')
     user_languages = misc_preference.preference(
         'user_language'
     )


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin][RM4975] Cannot switch UI language
  In-Reply-To: <CAM9w-_k44KZovz9jG8hhCkSVewMKicFEhdJzfxERLTyTDw7Hyw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox