Merge pull request #7935 from scmmishra/web-form-translation
feat (web-form): enabled translations for web_forms
This commit is contained in:
commit
9e77bfb876
2 changed files with 6 additions and 1 deletions
|
|
@ -79,7 +79,7 @@ frappe.boot = {
|
|||
};
|
||||
// for backward compatibility of some libs
|
||||
frappe.sys_defaults = frappe.boot.sysdefaults;
|
||||
|
||||
frappe._messages = {{ translated_messages }};
|
||||
$(".file-size").each(function() {
|
||||
$(this).text(frappe.form.formatters.FileSize($(this).text()));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -173,6 +173,11 @@ def get_context(context):
|
|||
context.max_attachment_size = get_max_file_size() / 1024 / 1024
|
||||
|
||||
context.show_in_grid = self.show_in_grid
|
||||
self.load_translations(context)
|
||||
|
||||
def load_translations(self, context):
|
||||
translated_messages = frappe.translate.get_dict('doctype', self.doc_type)
|
||||
context.translated_messages = frappe.as_json(translated_messages)
|
||||
|
||||
def load_document(self, context):
|
||||
'''Load document `doc` and `layout` properties for template'''
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue