Commit ac93b0ce authored by Sven Franck's avatar Sven Franck Committed by Xiaowu Zhang

erp5_web_renderjs_ui: make translation gadget generic

- add uritemplate
- add getTranslationDict method to retrieve a language dictionary from ERP5
- add fetchLanguage to handle browser working with "en-EN" vs gadget/ERP5 only using "en"
- add ready handler to retrieve languages from web_site_module and translation method from custom
initialization gadget (temp fix) to remove hardcoded configuration parameters
- add error handler to catch missing translation method and not translate/expose language options to
ensure compat with existing rJS web sites
- add ready handler to initialize plugin and re-render header once translations are available
- add method to expose available languages, so they can be fetched from the panel gadget
- fix translation methods to only work with strings being passed in and out
parent f00c03e1
......@@ -115,6 +115,7 @@
<script src="RSVP.js"></script>\n
<script src="renderjs.js"></script>\n
<script src="i18next.js"></script>\n
<script src="uritemplate.js"></script>\n
\n
<!-- custom script -->\n
<script src="gadget_translate.js"></script>\n
......@@ -258,7 +259,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>939.45272.15892.529</string> </value>
<value> <string>939.45272.47644.64085</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -276,7 +277,7 @@
</tuple>
<state>
<tuple>
<float>1418892983.83</float>
<float>1419953317.85</float>
<string>GMT</string>
</tuple>
</state>
......
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