Commit b254edbe authored by Jérome Perrin's avatar Jérome Perrin

web_renderjs_ui: support officejs web sites in "Update Translation Data"

With officejs web sites, the translation gadget is not referenced
directly on the web site, but in the "app" web section. Teach this
script to look on the web section to know which translation data script
to use
parent 8b42f3ed
......@@ -2,6 +2,19 @@
"""Returns the web script used to contain the translation data for this RJS web site.
"""
# OfficeJS is a bit more complex, the translation gadget is defined on the
# `app` web section, which is defined in "configuration_latest_version"
officejs_latest_version = context.getLayoutProperty(
"configuration_latest_version")
if officejs_latest_version:
if officejs_latest_version.endswith('/'):
officejs_latest_version = officejs_latest_version[:-1]
context = context.restrictedTraverse(officejs_latest_version, None)
if context is None:
return None
# now `context` is the app web section and the logic is same as with a normal
# ERP5JS web site.
translation_gadget_url = context.getLayoutProperty(
"configuration_translation_gadget_url")
if not translation_gadget_url:
......
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