Explorar el Código

[fix] frappe._ source message should always be converted to unicode

version-14
Anand Doshi hace 9 años
padre
commit
5040314fb5
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. +6
    -1
      frappe/__init__.py

+ 6
- 1
frappe/__init__.py Ver fichero

@@ -40,13 +40,18 @@ class _dict(dict):

def _(msg, lang=None):
"""Returns translated string in current lang, if exists."""
from frappe.translate import get_full_dict
from frappe.utils import cstr

if not lang:
lang = local.lang

# msg should always be unicode
msg = cstr(msg)

if lang == "en":
return msg

from frappe.translate import get_full_dict
return get_full_dict(local.lang).get(msg) or msg

def get_lang_dict(fortype, name=None):


Cargando…
Cancelar
Guardar