Typecho翻译代码中字符串的方法
find ./ -type f -name '*.php' -print | sort >file_list
xgettext --files-from=file_list --from-code=utf-8 -L PHP --no-wrap --strict -d translate -k_t
其中-k_t
指定的是翻译文本的格式,例如_t("需要翻译的文本")
中会抽取需要翻译的文本
这个字符串到翻译文件中
将translate.po
文件下载下来,使用Poedit
工具进行翻译
然后将编译后的mo
文件上传到服务器的目录<Typecho_BASE_DIR>/usr/langs
下,然后到系统设置中切换语言。
感谢扫码支持

