mirror of
https://github.com/xopenwrt/X-OpenWrt-New.git
synced 2026-09-18 08:20:11 +00:00
改进和优化(by teasiu)
This commit is contained in:
@@ -10,6 +10,7 @@ Diy_Core() {
|
||||
INCLUDE_AutoUpdate=true
|
||||
INCLUDE_AutoBuild_Tools=true
|
||||
INCLUDE_DRM_I915=true
|
||||
INCLUDE_Translation_Converter=true
|
||||
}
|
||||
|
||||
Firmware-Diy() {
|
||||
|
||||
@@ -107,6 +107,14 @@ Firmware-Diy_Base() {
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "${INCLUDE_Translation_Converter}" == "true" ]];then
|
||||
echo "Start to convert zh-cn translation files to zh_Hans ..."
|
||||
Replace_File Scripts/Convert_Translation.sh package
|
||||
cd ./package
|
||||
bash ./Convert_Translation.sh
|
||||
cd ..
|
||||
fi
|
||||
|
||||
echo "${Openwrt_Version}" > ${AB_Firmware_Info}
|
||||
echo "${Owner_Repo}" >> ${AB_Firmware_Info}
|
||||
echo "${TARGET_PROFILE}" >> ${AB_Firmware_Info}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/bin/bash
|
||||
# [CTCGFW]Project-OpenWrt
|
||||
# Use it under GPLv3, please.
|
||||
# --------------------------------------------------------
|
||||
# Convert translation files zh-cn to zh_Hans
|
||||
# The script is still in testing, welcome to report bugs.
|
||||
|
||||
po_file="$({ find |grep -E "[a-z0-9]+\.zh\-cn.+po"; } 2>"/dev/null")"
|
||||
for a in ${po_file}
|
||||
do
|
||||
[ -n "$(grep "Language: zh_CN" "$a")" ] && sed -i "s/Language: zh_CN/Language: zh_Hans/g" "$a"
|
||||
po_new_file="$(echo -e "$a"|sed "s/zh-cn/zh_Hans/g")"
|
||||
mv "$a" "${po_new_file}" 2>"/dev/null"
|
||||
done
|
||||
|
||||
po_file2="$({ find |grep "/zh-cn/" |grep "\.po"; } 2>"/dev/null")"
|
||||
for b in ${po_file2}
|
||||
do
|
||||
[ -n "$(grep "Language: zh_CN" "$b")" ] && sed -i "s/Language: zh_CN/Language: zh_Hans/g" "$b"
|
||||
po_new_file2="$(echo -e "$b"|sed "s/zh-cn/zh_Hans/g")"
|
||||
mv "$b" "${po_new_file2}" 2>"/dev/null"
|
||||
done
|
||||
|
||||
lmo_file="$({ find |grep -E "[a-z0-9]+\.zh_Hans.+lmo"; } 2>"/dev/null")"
|
||||
for c in ${lmo_file}
|
||||
do
|
||||
lmo_new_file="$(echo -e "$c"|sed "s/zh_Hans/zh-cn/g")"
|
||||
mv "$c" "${lmo_new_file}" 2>"/dev/null"
|
||||
done
|
||||
|
||||
lmo_file2="$({ find |grep "/zh_Hans/" |grep "\.lmo"; } 2>"/dev/null")"
|
||||
for d in ${lmo_file2}
|
||||
do
|
||||
lmo_new_file2="$(echo -e "$d"|sed "s/zh_Hans/zh-cn/g")"
|
||||
mv "$d" "${lmo_new_file2}" 2>"/dev/null"
|
||||
done
|
||||
|
||||
po_dir="$({ find |grep "/zh-cn" |sed "/\.po/d" |sed "/\.lmo/d"; } 2>"/dev/null")"
|
||||
for e in ${po_dir}
|
||||
do
|
||||
po_new_dir="$(echo -e "$e"|sed "s/zh-cn/zh_Hans/g")"
|
||||
mv "$e" "${po_new_dir}" 2>"/dev/null"
|
||||
done
|
||||
|
||||
makefile_file="$({ find|grep Makefile |sed "/Makefile./d"; } 2>"/dev/null")"
|
||||
for f in ${makefile_file}
|
||||
do
|
||||
[ -n "$(grep "zh-cn" "$f")" ] && sed -i "s/zh-cn/zh_Hans/g" "$f"
|
||||
[ -n "$(grep "zh_Hans.lmo" "$f")" ] && sed -i "s/zh_Hans.lmo/zh-cn.lmo/g" "$f"
|
||||
done
|
||||
exit 0
|
||||
Reference in New Issue
Block a user