Commit 6a04dd78 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: extract translatable file list

parent c82a9940
......@@ -45,6 +45,9 @@ content += ";\n}(window));"
translation_data_file=context.web_page_module.searchFolder(portal_type='Web Script',reference=translation_data_file)[0]
translation_data_file.edit(text_content = content)
# Edit web section modification date
context.edit()
if batch_mode:
return 'done'
return context.Base_redirect('view', keep_items=dict(portal_status_message=Base_translateString("Translation Data Create")))
import re
service_worker_reference = context.getLayoutProperty("configuration_service_worker_url", default="gadget_erp5_serviceworker.js")
service_worker = context.getPortalObject().portal_catalog.getResultValue(
portal_type='Web Script',
reference=service_worker_reference)
if service_worker is None:
text_content = ''
else:
text_content = service_worker.getTextContent()
filename_pattern = re.compile("'(?P<filename>[a-zA-Z0-9-_\.\?=]*)'")
filename_list = []
start = False
for line in text_content.split('\n'):
if start is False and 'REQUIRED_FILES' in line:
start = True
continue
if not line:
continue
if start:
if ']' in line:
break
matched = filename_pattern.search(line)
if matched is not None:
filename = matched.groupdict().get('filename')
if filename:
filename_list.append(filename)
filename_list = context.WebSection_getPrecacheManifest()
file_list = []
translation_data_file = []
......
......@@ -145,7 +145,7 @@ url_list = [
'gadget_editor.js',
'gadget_button_maximize.html',
'gadget_button_maximize.js',
'handlebars.js',
'domsugar.js',
'jiodev.js',
'renderjs.js',
'rsvp.js',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment