ericpaulbishop/gargoyle — pull request #202 by BashfulBladder (2013-09-04 22:29:50+00:00)
Title: haserl-i18n: more b12n (bastardization)

When invoked with 'i18n', trigger translation lookup of a haserl token style variable.

Also, adds destroy_string_map.

Examples:
i18n SaveChanges
i18n time.EU
i18n openvpn.CClnt

I don't know why this never occurred to me before.

This patch allows using haserl as a shell-based translation utility. Currently /usr/bin/i18n serves that purpose via gargoyle-i18n/files/usr/lib/gargoyle/i18nServices.sh. Both mechanisms account for about 1000 bytes, so the only benefit is of speed.

When this haserl is started via 'i18n' (symlink to /usr/bin/i18n), the translation facility is triggered while not impacting other haserl operations. Changes are due to different whitespace & where to dump found values.

Note:
• the symlink is not created yet because the pages that use shell-based translations are not updated
• updating the translation entails adding a period:
i18n openvpn uc_CA_f
to
i18n openvpn.uc_CA_f
• localize.py will need to be updated to accommodate the change

------------
Currently, the existing shell translation facility is used here:

* plugin-gargoyle-openvpn/files/www/utility/openvpn_upload_client.sh
* my 12h/24h hour style patch that I'm not 100% thrilled with here:
https://github.com/BashfulBladder/gargoyle/commit/93ba926ba51323df6cd8236ca29ae3ecd499ec00
I think the glitch in loading the page stems from the script halting while it loads & executes the shell script. Even if the function is in the parent haserl page.sh document, the calling of the function in the template halts page loading as the function runs. Its no slower than plugins.sh, but not as fast as the original time.sh page