OpenWrt Forum Archive

Topic: Incomplete Language translation in Luci

The content of this topic has been archived on 7 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello all..
I am implementing multiple language support in my OpenWRT based router.
I added support of both Russian and Chinese language by editing /etc/config/luci.
But, the problem is that only OpenWRT's built-in pages are being translated and not those lua pages and tabs which i have added in the router ..
How can i overcome this problem??

Have a look into LuCI source tree on Github https://github.com/openwrt/luci .
Every "module" and every "application" has it's own po/[LANG] directory with it's standard .po file for the given [LANG] and a template directory.
There is available LUCIPATH/build/i18n-scan.pl script which can scan the lua code for strings and create a standard .pot (PO-template) file.
This template can be used to create the final .po file.
Tools like "poedit" or others can handle and edit this files via GUI. There are a lot for Linux, OSx and Windows.
During build these .po files are "compiled" into the final *.lmo files using "po2lmo" tool.
This final *.lmo files are copied into usr/lib/lua/luci/i18n directory on the OpenWrt box.
That's the magic.

chris5560 wrote:

Have a look into LuCI source tree on Github https://github.com/openwrt/luci .
Every "module" and every "application" has it's own po/[LANG] directory with it's standard .po file for the given [LANG] and a template directory.
There is available LUCIPATH/build/i18n-scan.pl script which can scan the lua code for strings and create a standard .pot (PO-template) file.
This template can be used to create the final .po file.
Tools like "poedit" or others can handle and edit this files via GUI. There are a lot for Linux, OSx and Windows.
During build these .po files are "compiled" into the final *.lmo files using "po2lmo" tool.
This final *.lmo files are copied into usr/lib/lua/luci/i18n directory on the OpenWrt box.
That's the magic.


Thanks chris5560 for this detailed answer.. Now, i ran into another problem..
I want to run lua command on "index.html", i mean before redirecting to "/cgi-bin/luci" .. Is there any way to acheive this??

The discussion might have continued from here.