Skip to content

Introduce i18n support and add English/Chinese language files; replace hardcoded UI strings#1233

Merged
juewuy merged 1 commit intodevfrom
codex/implement-localization-in-menus-directory-inwhs3
Mar 11, 2026
Merged

Introduce i18n support and add English/Chinese language files; replace hardcoded UI strings#1233
juewuy merged 1 commit intodevfrom
codex/implement-localization-in-menus-directory-inwhs3

Conversation

@juewuy
Copy link
Copy Markdown
Owner

@juewuy juewuy commented Mar 11, 2026

Motivation

  • Centralize user-facing strings and add localization to support English and Chinese for better maintainability and multilingual use.
  • Replace scattered hardcoded prompts/messages with language keys so future translations and consistency improvements are easier.

Description

  • Added new language files under scripts/lang/chs and scripts/lang/en for modules including bot_tg, check_port, ddns, providers, set_crashdir, subconverter, task_cmd, and uninstall to provide localized string variables.
  • Updated menus and service scripts (for example scripts/menus/bot_tg.sh, bot_tg_bind.sh, bot_tg_service.sh, check_port.sh, ddns.sh, providers*.sh, set_crashdir.sh, subconverter.sh, task_cmd.sh, and uninstall.sh) to load_lang and replace hardcoded text with the corresponding language variables.
  • Ensured i18n.sh is sourced where required and replaced cron/job naming and logger messages with localized variables (for example the TG bot cron name and log messages).
  • Preserved original control flow and behavior while converting UI text to use localization keys and updated button/menu payloads in the Telegram bot menus to use the new variables.

Testing

  • No automated tests were executed as part of this change.

Codex Task

@juewuy juewuy merged commit e84bca3 into dev Mar 11, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81d6b36c51

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +54 to +55
sed -i "/$UNINSTALL_CRON_INIT/d" /etc/storage/started_script.sh 2>/dev/null
sed -i "/$UNINSTALL_CRON_INIT/d" /jffs/.asusrouter 2>/dev/null
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep uninstall startup marker non-localized

Using $UNINSTALL_CRON_INIT as the deletion pattern means uninstall depends on the active UI language, but the startup hook inserted during install is still written with a fixed Chinese marker in scripts/init.sh (#ShellCrash初始化脚本). In English mode this sed expression won’t match, so the boot script entries in /etc/storage/started_script.sh and /jffs/.asusrouter are left behind and ShellCrash can still be invoked after uninstall on those platforms.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant