Skip to content

Commit 1b75f15

Browse files
committed
Update
1 parent 4610205 commit 1b75f15

2 files changed

Lines changed: 23 additions & 18 deletions

File tree

.github/plugin/ZAPK/overlay_create/index.bash

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,8 @@ echo '
5353
# Thư mục hiện tại
5454
MPAT="${0%/*}"
5555

56-
# Ngôn ngữ mặc định
57-
eval "$(grep '="' "$MPAT/addon.prop" | sed "/google_text=/d")"
58-
[ -f "$MPAT/language.bash" ] && source "$MPAT/language.bash"
56+
# Ngôn ngữ & Google dịch
57+
source trans_add "$MPAT"
5958

60-
# Google dịch
61-
if [ "$(glog "auto_trans_text_${MPAT##*/}")" == 1 ]; then
62-
trans_add "$MPAT"
63-
[ -f "$MPAT/auto.sh" ] && source "$MPAT/auto.sh"
64-
fi
65-
66-
# index
59+
# index add-on
6760
"$@"
Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/data/data/com.tool.tree/files/home/bin/bash
2-
# kakathic
3-
sum_md5='';
2+
# Kakathic
3+
4+
[ -z "$1" ] && exit 1
45

56
if [ -f "$1/english.prop" ]; then
67
file_props="english.prop"
@@ -10,17 +11,28 @@ else
1011
file_props="addon.prop"
1112
fi
1213

13-
[ -f "$1/$file_props" ] && eval "$(grep '="' "$1/$file_props")" || exit 1
14+
[ -f "$1/$file_props" ] || exit 1
15+
16+
# ngôn ngữ mặc định
17+
eval "$(grep '="' "$file_props" | sed "/google_text=/d")"
18+
[ -f "$1/language.bash" ] && source "$1/language.bash"
19+
20+
# Xử lý dịch
1421
sum_md5="$(sha256sum "$1/$file_props" | awk '{print $1}')"
1522
if [ "$sum_md5" != "$(glog "sum_md5_${1##*/}")" ] || [ ! -f "$1/auto.sh" ] || [ "$(grep -cm1 '=""' "$1/auto.sh")" == 1 ]; then
16-
[ -f "$1/auto.sh" ] && rm -fr "$1/auto.sh"
17-
for vc in $(grep '="' "$1/$file_props" | cut -d= -f1); do
18-
echo -e "${vc}=\"$(echo "${!vc}" | trans $LANGUAGE-$COUNTRY | awk '{ $0 = toupper(substr($0,1,1)) substr($0,2); print }')\" # ${!vc}" >>"$1/auto.sh" &
19-
done
20-
wait
23+
[ -f "$1/auto.sh" ] && rm -fr "$1/auto.sh"
24+
for vc in $(grep '="' "$1/$file_props" | cut -d= -f1); do
25+
echo -e "${vc}=\"$(echo "${!vc}" | trans $LANGUAGE-$COUNTRY | awk '{ $0 = toupper(substr($0,1,1)) substr($0,2); print }')\" # ${!vc}" >>"$1/auto.sh" &
26+
done
27+
wait
2128
if [ "$(grep -cm1 '=""' "$1/auto.sh")" == 1 ]; then
2229
sed -i '/=""/d' "$1/auto.sh"
2330
else
2431
slog "sum_md5_${1##*/}" "$sum_md5"
2532
fi
2633
fi
34+
35+
# Google dịch
36+
if [ "$(glog "auto_trans_text_${1##*/}")" == 1 ]; then
37+
[ -f "$1/auto.sh" ] && source "$1/auto.sh"
38+
fi

0 commit comments

Comments
 (0)