Created 'build_from_query_report' method in translate.py to create locale for the reports
This commit is contained in:
parent
fcb8b35cc5
commit
0a3685d2cf
1 changed files with 20 additions and 0 deletions
|
|
@ -99,6 +99,9 @@ def build_message_files():
|
|||
build_for_pages('lib/core')
|
||||
build_for_pages('app')
|
||||
|
||||
build_from_query_report('lib/core')
|
||||
build_from_query_report('app')
|
||||
|
||||
build_from_doctype_code('lib/core')
|
||||
build_from_doctype_code('app')
|
||||
|
||||
|
|
@ -125,6 +128,23 @@ def build_for_pages(path):
|
|||
write_messages_file(basepath, messages_js, "js")
|
||||
if messages_py:
|
||||
write_messages_file(basepath, messages_py, "py")
|
||||
|
||||
def build_from_query_report(path):
|
||||
"""make locale files for reports py and js (all)"""
|
||||
messages = []
|
||||
for (basepath, folders, files) in os.walk(path):
|
||||
if os.path.basename(os.path.dirname(basepath))=="page":
|
||||
messages_js, messages_py = [], []
|
||||
for fname in files:
|
||||
fname = cstr(fname)
|
||||
if fname.endswith('.js'):
|
||||
messages_js += get_message_list(os.path.join(basepath, fname))
|
||||
if fname.endswith('.py'):
|
||||
messages_py += get_message_list(os.path.join(basepath, fname))
|
||||
if messages_js:
|
||||
write_messages_file(basepath, messages_js, "js")
|
||||
if messages_py:
|
||||
write_messages_file(basepath, messages_py, "py")
|
||||
|
||||
def build_from_database():
|
||||
"""make doctype labels, names, options, descriptions"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue