From dcf83b864550dd12b524995abacbc1456ac26e68 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Tue, 26 May 2020 23:03:59 +0530 Subject: [PATCH] fix: Update translation_map with user translation - Even while returning from cache --- frappe/translate.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/frappe/translate.py b/frappe/translate.py index 91562382e6..2fc2d3f328 100644 --- a/frappe/translate.py +++ b/frappe/translate.py @@ -119,23 +119,18 @@ def get_dict(fortype, name=None): messages += frappe.db.sql("select 'Role:', name from tabRole") messages += frappe.db.sql("select 'Module:', name from `tabModule Def`") - message_dict = make_dict_from_messages(messages) message_dict.update(get_dict_from_hooks(fortype, name)) - # remove untranslated message_dict = {k:v for k, v in iteritems(message_dict) if k!=v} - translation_assets[asset_key] = message_dict - cache.hset("translation_assets", frappe.local.lang, translation_assets, shared=True) - if fortype=="boot": - message_dict.update(get_user_translations(frappe.local.lang)) + translation_map = translation_assets[asset_key] + if fortype == "boot": + translation_map.update(get_user_translations(frappe.local.lang)) - return message_dict - - return translation_assets[asset_key] + return translation_map def get_dict_from_hooks(fortype, name):