feat: added lang_dict to frappe.boot

This commit is contained in:
Shivam Mishra 2019-07-18 18:16:07 +05:30
parent fac9df46ec
commit 3d0455f1f7
2 changed files with 3 additions and 1 deletions

View file

@ -79,7 +79,7 @@ frappe.boot = {
};
// for backward compatibility of some libs
frappe.sys_defaults = frappe.boot.sysdefaults;
frappe.boot.lang_dict = {{ lang_dict }};
$(".file-size").each(function() {
$(this).text(frappe.form.formatters.FileSize($(this).text()));
});

View file

@ -10,6 +10,7 @@ from frappe.website.utils import get_comment_list
from frappe.custom.doctype.customize_form.customize_form import docfield_properties
from frappe.core.doctype.file.file import get_max_file_size
from frappe.core.doctype.file.file import remove_file_by_url
from frappe.translate import get_lang_dict
from frappe.modules.utils import export_module_json, get_doc_module
from six.moves.urllib.parse import urlencode
from frappe.integrations.utils import get_payment_gateway_controller
@ -173,6 +174,7 @@ def get_context(context):
context.max_attachment_size = get_max_file_size() / 1024 / 1024
context.show_in_grid = self.show_in_grid
context.lang_dict = frappe.as_json(get_lang_dict())
def load_document(self, context):
'''Load document `doc` and `layout` properties for template'''