Ai
4 Star 8 Fork 4

爱折腾智能机器人/commands

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
install_docker_i18n.sh 2.00 KB
一键复制 编辑 原始数据 按行查看 历史
爱折腾智能机器人 提交于 2023-09-08 14:10 +08:00 . docker test delete sudo
#!/bin/bash
################################################################
# Function :install i18n #
# Platform :All Linux Based Platform #
# Version :1.0 #
# Date :2023-03-07 #
# Author :ncnynl #
# Contact :1043931@qq.com #
# Company :Foshan AiZheTeng Information Technology Co.,Ltd. #
# URL: https://ncnynl.com #
################################################################
# How to get support for diff language
# msgfmt -o test.sh.mo test.sh.zh_CN.po
# sudo mv test.sh.mo /usr/share/locale/zh_CN/LC_MESSAGES/
# msgfmt -o test.sh.mo test.sh.en.po
# sudo cp test.sh.mo /usr/share/locale/en/LC_MESSAGES/
# sudo mv test.sh.mo /usr/share/locale/en/LC_MESSAGES/
# export TEXTDOMAINDIR=/usr/share/locale
# export LANG=zh_CN.UTF-8
# export LANG=
# export LC_ALL="it_IT.UTF-8"
# locale
# sudo locale-gen "en.UTF-8"
# sudo locale-gen "zh_CN.UTF-8"
# sudo locale-gen "zh_TW.UTF-8"
# sudo dpkg-reconfigure locales
#for i18n
apt-get install gettext
#language lists
support_lang=(
zh_CN
zh_TW
en
cs
de_DE
es
fr_FR
hu
it
ja
ko
pl
pt
ru
)
#######################################
# Install i18n
# Globals:
# None
# Arguments:
# None
# Return:
# None
# Outputs:
# echo to stdout
#######################################
function install_i18n(){
for lang in ${support_lang[@]}
do
echo $lang
if [ -d "/usr/share/locale/$lang/LC_MESSAGES/" ]; then
if [ -d ~/tools/commands/commands_i18n/$lang ];then
cd ~/tools/commands/commands_i18n/$lang
pwd
if [ -f ./commands.mo ]; then
cp commands.mo /usr/share/locale/$lang/LC_MESSAGES/
echo "add $lang support!"
fi
fi
fi
done
}
install_i18n
echo -e "Install i18n Finished"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
其他
1
https://gitee.com/ncnynl/commands.git
git@gitee.com:ncnynl/commands.git
ncnynl
commands
commands
master

搜索帮助