Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/auto_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

def get_path(lang):
base_dir = os.path.abspath('../assets/translations')
lang_file = f'strings_{lang}.i18n.json'
file_lang = lang.replace('-', '_')
if file_lang == 'zh':
file_lang = 'zh_CN'
lang_file = f'{file_lang}.i18n.json'
path = os.path.join(base_dir, lang_file)
if path.startswith(base_dir):
return path
Expand Down Expand Up @@ -44,7 +47,8 @@ def recursive_translate(src, dst, translator):
src_pofile = read_translate(src)
dst_pofile = read_translate(dst)

translator = GoogleTranslator(source=src, target=dst if dst != 'zh' else "zh-CN")
target_lang = dst.replace('_', '-') if dst != 'zh' else "zh-CN"
translator = GoogleTranslator(source=src, target=target_lang)
recursive_translate(src_pofile, dst_pofile, translator)

with open(os.path.abspath(get_path(dst)), 'w') as df:
Expand Down
26 changes: 14 additions & 12 deletions .github/sync_translate.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
# key="FRu3eopQWgsvWmnycBXxv2eWpbUwGOu2"
# wget -O ../assets/translations/strings_en.i18n.json "https://localise.biz/api/export/locale/en-US.json?index=id&format=i18next4&key=$key"
# wget -O ../assets/translations/strings_fa.i18n.json "https://localise.biz/api/export/locale/fa.json?index=id&format=i18next4&key=$key"
# wget -O ../assets/translations/strings_zh.i18n.json "https://localise.biz/api/export/locale/zh.json?index=id&format=i18next4&key=$key"
# # # wget -O ../assets/translations/strings_pt.i18n.json "https://localise.biz/api/export/locale/pt.json?index=id&format=i18next4&key=$key"
# wget -O ../assets/translations/strings_ru.i18n.json "https://localise.biz/api/export/locale/ru.json?index=id&format=i18next4&key=$key"

# wget -O ../assets/translations/en.i18n.json "https://localise.biz/api/export/locale/en-US.json?index=id&format=i18next4&key=$key"
# wget -O ../assets/translations/fa.i18n.json "https://localise.biz/api/export/locale/fa.json?index=id&format=i18next4&key=$key"
# wget -O ../assets/translations/zh_CN.i18n.json "https://localise.biz/api/export/locale/zh-CN.json?index=id&format=i18next4&key=$key"
# # # wget -O ../assets/translations/pt_BR.i18n.json "https://localise.biz/api/export/locale/pt-BR.json?index=id&format=i18next4&key=$key"
# wget -O ../assets/translations/ru.i18n.json "https://localise.biz/api/export/locale/ru.json?index=id&format=i18next4&key=$key"


pip install polib deep-translator python-i18n

# python3 auto_translator.py fa en
python3 auto_translator.py en fa
python3 auto_translator.py en zh-CN
python3 auto_translator.py en zh_CN
# python3 auto_translator.py en pt
python3 auto_translator.py en ru
python3 auto_translator.py en tr
python3 auto_translator.py en es



function update_localise(){
lang=$1
pat="../assets/translations/strings_${lang}.i18n.json"
# if [[ $lang == 'en' ]];then
# pat="../assets/translations/strings.i18n.json"
# fi
file_lang=$(printf '%s' "$lang" | tr '-' '_')
if [ "$file_lang" = "zh" ]; then
file_lang="zh_CN"
fi
pat="../assets/translations/${file_lang}.i18n.json"
# if [ "$file_lang" = 'en' ];then
# pat="../assets/translations/en.i18n.json"
# fi
# curl -X POST "https://localise.biz/api/import/json?locale=$lang&key=$LOCALIZ_KEY" \
curl "https://localise.biz/api/import/json?format=i18next4&delete-absent=false&ignore-existing=false&locale=$lang&flag-new=Provisional&key=$LOCALIZ_KEY" \
-H 'Accept: application/json' \
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "libcore"]
path = libcore
url = https://github.com/hiddify/hiddify-next-core
url = https://github.com/hiddify/hiddify-core
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{}
{"type":"session","length":212}
{"init":true,"sid":"e6842608-b8df-44ec-a81b-a7c9c5cdf57f","status":"crashed","errors":1,"started":"2025-10-08T14:36:42.074108Z","duration":326.135185,"attrs":{"release":"hiddify@2.5.7+20507","environment":"dev"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��event_id�$e0fe8bce-e67a-4147-87b8-b3cd62c540ee�timestamp�2025-10-08T14:42:08.207495Z�platform�native�level�fatal�release�hiddify@2.5.7+20507�dist�general�environment�dev�sdk��name�sentry.native.flutter�version�0.10.0�packages���name�github:getsentry/sentry-native�version�0.10.0�integrations��crashpad�tags��extra��contexts��os��name�Windows�kernel_version�10.0.26100.6725�version�10.0.26200�build�6725�trace��trace_id� c601c21b860f4d913642bfc1454f64fa�span_id�ebf40f38676e4fa3�sample_rand�?�QN��o�
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��event_id�$e0fe8bce-e67a-4147-87b8-b3cd62c540ee�timestamp�2025-10-08T14:42:08.207495Z�platform�native�level�fatal�release�hiddify@2.5.7+20507�dist�general�environment�dev�sdk��name�sentry.native.flutter�version�0.10.0�packages���name�github:getsentry/sentry-native�version�0.10.0�integrations��crashpad�tags��extra��contexts��os��name�Windows�kernel_version�10.0.26100.6725�version�10.0.26200�build�6725�trace��trace_id� c601c21b860f4d913642bfc1454f64fa�span_id�ebf40f38676e4fa3�sample_rand�?�QN��o�
1 change: 1 addition & 0 deletions .sentry-native/last_crash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-10-08T14:42:08.208148Z
Binary file added .sentry-native/metadata
Binary file not shown.
Binary file not shown.
Binary file added .sentry-native/settings.dat
Binary file not shown.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"editor.wordBasedSuggestions": "off"
},

"html.format.wrapLineLength": 250,
"html.format.wrapLineLength": 250,
"codium.codeCompletion.enable": false,

}
Loading