Gargoyle localization
Moderator: Moderators
Gargoyle localization
How to localize Gargoyle in Russian? I want to do it.
Re: Gargoyle localization
Get access to routers file structure ex. winscp then those folders; etc, www. Take a look at http://eko.one.plProgman wrote:How to localize Gargoyle in Russian? I want to do it.
Those guys have translated it to polish. I just translate it back to english because their version supports 3G WAN w. nice GUI setup.
Re: Gargoyle localization
Hello!
I want to ask, how to localize gargoyle without editing .sh stuffs in installed version? Maybe there is a plugin interface or something to install localized lnguage? (I want to translate it to hungarian. )
Or after clone git to local, edit that .sh files https://github.com/ericpaulbishop/gargo ... /files/www and than make firmware? (1043ND for me)
thanks!
I want to ask, how to localize gargoyle without editing .sh stuffs in installed version? Maybe there is a plugin interface or something to install localized lnguage? (I want to translate it to hungarian. )
Or after clone git to local, edit that .sh files https://github.com/ericpaulbishop/gargo ... /files/www and than make firmware? (1043ND for me)
thanks!
-
- Moderator
- Posts: 250
- Joined: Thu Jan 17, 2013 11:43 pm
Re: Gargoyle localization
I think there was a single file that could be translated - but that seems to have disappeared. The only way to do it now is the manual file.sh-by-file.sh method.
TP-Link WDR3600 v1.1 running 1.5.10+ L10n-English (Built 20130922 - OpenWrt r38093)
TP-Link WDR4300 running 1.5.10+ i18n-English (Built 20131010 - OpenWrt r38286)
https://github.com/BashfulBladder/gargoyle-plugins/wiki
TP-Link WDR4300 running 1.5.10+ i18n-English (Built 20131010 - OpenWrt r38286)
https://github.com/BashfulBladder/gargoyle-plugins/wiki
Re: Gargoyle localization
Mine? http://ecco.selfip.net/gargoyle-pl/attitude_adjustment/
.sh files, .js files and menu in /etc/config. Some other like files from ddns, openvpn etc.
.sh files, .js files and menu in /etc/config. Some other like files from ddns, openvpn etc.
Re: Gargoyle localization
Thanks, so this contains all phrases what need to translate. How to use them?Cezary wrote:Mine?
Re: Gargoyle localization
Sure i can contribute too.But first gargoyle web interface needs a support for multi language.
-
- Moderator
- Posts: 250
- Joined: Thu Jan 17, 2013 11:43 pm
Re: Gargoyle localization
Coming soon: Gargoyle with i18n support (with any luck). Because a picture is worth a thousand i18n words:
https://raw.github.com/wiki/BashfulBlad ... s/i18n.avi
Pay attention to the names of the buttons on the bottom of the Time page.
If anybody has any better ideas of the server-side haserl structure (to make it shorter, because there are LOTS of strings), chime in.
If you are a native speaker of one of those languages - I apologize for the butchered translations.
And ignore the theme (and the way ffmpeg oversaturated the green).
https://raw.github.com/wiki/BashfulBlad ... s/i18n.avi
Pay attention to the names of the buttons on the bottom of the Time page.
Code: Select all
<input type='button' value=<? /sbin/i18n "UI.SaveChanges" ?> id="save_button" class="bottom_button" onclick='saveChanges()' />
<input type='button' value=<? /sbin/i18n "UI.Reset" ?> id="reset_button" class="bottom_button" onclick='resetData()'/>
If you are a native speaker of one of those languages - I apologize for the butchered translations.
And ignore the theme (and the way ffmpeg oversaturated the green).
TP-Link WDR3600 v1.1 running 1.5.10+ L10n-English (Built 20130922 - OpenWrt r38093)
TP-Link WDR4300 running 1.5.10+ i18n-English (Built 20131010 - OpenWrt r38286)
https://github.com/BashfulBladder/gargoyle-plugins/wiki
TP-Link WDR4300 running 1.5.10+ i18n-English (Built 20131010 - OpenWrt r38286)
https://github.com/BashfulBladder/gargoyle-plugins/wiki
-
- Moderator
- Posts: 250
- Joined: Thu Jan 17, 2013 11:43 pm
Re: Gargoyle localization
There is a huge performance penalty with haserl <% script %> injections. Save this to a file called intl, chmod +x it and put it in $PATH on the router - /sbin/intl
--------------------------------
-------------------------
duplicate the time.sh to time2.sh and add this 20 times in innerhtml:
<? intl "time.TimeZone" ?>
20 of that simple script visibly slows down page loading. Throw in awk searching a file 20 times (and it isn't cached - each script call is a fork & a subshell opens for each time) and page loading is at least a second longer with the genuine i18n shell script:
-------------------
----------------
So I can think of 3 solutions:
mod harserl to support caching of the translation files
mod haserl to do direct lookups
use javascript to hold variables & window.onload to fill in variables
I think #2 is the best course.
• Define a new syntax <~ UI.SaveButton ~>
• integrate uci lookups for fallback_lang & language - or env variables, or pass them by argument like haserl $(uci get gargoyle.global.language)
--------------------------------
Code: Select all
#!/bin/sh
local ikey="$1"
lang=$(uci get gargoyle.global.language)
local key=$(echo "$ikey" | awk -F '.' '{print $2}')
echo "$key"
duplicate the time.sh to time2.sh and add this 20 times in innerhtml:
<? intl "time.TimeZone" ?>
20 of that simple script visibly slows down page loading. Throw in awk searching a file 20 times (and it isn't cached - each script call is a fork & a subshell opens for each time) and page loading is at least a second longer with the genuine i18n shell script:
-------------------
Code: Select all
local ikey="$1"
local lfile=$(echo "$ikey" | awk -F '.' '{print $1}')
local web_root=$(uci get gargoyle.global.web_root)
local lang=$(uci get gargoyle.global.language)
local fallback_lang=$(uci -q get gargoyle.global.fallback_lang)
local target_file="$web_root/i18n/$lang/$lfile.txt"
local translation
[ -e "$target_file" ] && translation=$(awk -v key="$ikey" -F '=' '$0 ~ key { print $2 }' "$target_file")
[ -z "$translation" ] && {
target_file="$web_root/i18n/$fallback_lang/$lfile.txt"
[ -e "$target_file" ] && translation=$(awk -v key="$ikey" -F '=' '$0 ~ key { print $2 }' "$target_file")
}
[ -z "$translation" ] && translation=$(echo "$ikey" | awk -F '.' '{print $2}')
echo "$translation"
So I can think of 3 solutions:
mod harserl to support caching of the translation files
mod haserl to do direct lookups
use javascript to hold variables & window.onload to fill in variables
I think #2 is the best course.
• Define a new syntax <~ UI.SaveButton ~>
• integrate uci lookups for fallback_lang & language - or env variables, or pass them by argument like haserl $(uci get gargoyle.global.language)
TP-Link WDR3600 v1.1 running 1.5.10+ L10n-English (Built 20130922 - OpenWrt r38093)
TP-Link WDR4300 running 1.5.10+ i18n-English (Built 20131010 - OpenWrt r38286)
https://github.com/BashfulBladder/gargoyle-plugins/wiki
TP-Link WDR4300 running 1.5.10+ i18n-English (Built 20131010 - OpenWrt r38286)
https://github.com/BashfulBladder/gargoyle-plugins/wiki
Re: Gargoyle localization
Thank you!BashfulBladder wrote:Coming soon: Gargoyle with i18n support (with any luck).