openwrt web中文语言支持,并设置默认中文 | 您所在的位置:网站首页 › openwrt怎样安装web管理界面 › openwrt web中文语言支持,并设置默认中文 |
OPENWRT WEB中文语言支持,并设置默认中文
在menuconfig中先选择支持luci-i18n-zh_ch 然后修改配置文件: 修改配置文件,配置默认中文 vim feeds/luci/modules/luci-base/root/etc/config/luci 修改 option lang 'auto' 为 option lang 'zh_cn'或者直接执行sed语句 sed -i 's/option lang auto/option lang zh_cn/g' feeds/luci/modules/luci-base/root/etc/config/luci上面说的是修改方案,这个接下来再说一下后面的细节 代码中,语言包的存在是.po后缀的文件,里面包含了 msgid "Mode" msgstr "模式"我这边修改支持了一个luci-base的中文包,修改的文件是这个: luci/modules/luci-base/po/zh_cn/base.po 那么接下来编译,编译ipk软件包最终打包的文件是 book@book:~/openwrt/build_dir/target-arm_cortex-a7_musl_eabi/luci-base/ipkg-all/luci-i18n-base-zh-cn$ tree -L 6 . . ├── CONTROL │ ├── control │ ├── postinst │ ├── postinst-pkg │ └── prerm ├── etc │ └── uci-defaults │ └── luci-i18n-base-zh-cn └── usr └── lib └── lua └── luci └── i18n └── base.zh-cn.lmo 8 directories, 6 files在设备上识别的是lmo文件,因为openwrt只能识别紧凑型的lmo文件,所以中间是经过转换的,转换的方式是 po2lmo xxx.po xxx.lmo 其中po2lmo的文件位置是在: ~/openwrt/build_dir/target-arm_cortex-a7_musl_eabi/luci-base/po2lmo 后续测试的时候可以直接手动生成并替换测试,不需要再编译版本进行测试。 刚刚测试了上述说的手动验证的方法: #编译 book@book:~/luci/modules/luci-base/po/zh_cn$ ~/openwrt/build_dir/target-arm_cortex-a7_musl_eabi/luci-base/po2lmo base.po base.zh-cn.lmo #上传测试 book@book:~/luci/modules/luci-base/po/zh_Hans$ scp base.zh-cn.lmo [email protected]:/usr/lib/lua/luci/i18n/base.zh-cn.lmo |
CopyRight 2018-2019 实验室设备网 版权所有 |