赞
踩
OpenWRT 的多语言支持此处只介绍中英文支持,首先OpenWRT的多语言支持其实就是由一个中文/英文相对应的文本列表实现
msgid "(%d minute window, %d second interval)"
msgstr "(%d分钟信息,%d秒刷新)"
msgid "Firmware is downloading..."
msgstr "固件下载中..."
msgid "Download Progress"
msgstr "下载进度"
msgid "Online Upgrade Firmware"
msgstr "在线升级固件"
msgid "Current Version"
msgstr "当前固件版本"
实现步骤
准备如上格式的文本文件命名为base.zh-cn.po,由于OpenWRT中只识别格式为lmo格式的紧凑型文本格式,因此我们必须借助程序po2lmo
(该文件可以在~/op-0-3-8/package/openwrt-dist-luci/files/luci/tools/po2lmo中找到)使用po2lmo base.zh-cn.po /op-0-3-8/files/usr/lib/lua/luci/i18n/base.zh-cn.lmo
代码实现
_("Current Version")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。