Skip to content

[Refactor/Chore] zh-Hant: contacts.json is missing 136 of 284 keys #45928

Open
2435634589-creator/dify
#1

Description

@2435634589-creator

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for refactors or chores; if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Description

web/i18n/locales/zh-Hant/contacts.json is out of sync with the source locale. It contains 148 of the 284 keys in en-US/contacts.json, so 136 keys are missing. The other 66 namespaces under zh-Hant/ are complete — only this one lags.

The missing entries cover the Contacts directory, external contacts, IM identity binding, the platform contact picker, and member removal: action.*, details.*, directory.*, external.*, filter.*, imBinding.*, memberRemoval.*, platformPicker.*, type.*.

Comparison against main today, using flat keys as required by keySeparator: false:

en-US/contacts.json     284 keys
zh-Hant/contacts.json   148 keys
missing                 136
extra                   0

No open issue or pull request covers this file. #44175 touches 42 zh-Hant files but not contacts.json; that change addresses wording and Simplified-script text rather than missing keys.

Motivation

getInitOptions in web/i18n/settings.ts sets fallbackLng: defaultLocale, and defaultLocale is en-US. A Traditional Chinese user therefore sees English text across the entire Contacts area, while every other namespace in that locale is translated. This file is the only visible gap for zh-Hant.

Additional Context

No response

Activity

  1. dosubot commented on Nov 9, 2026

    @dosubot

    Hi @2435634589-creator! I'm Dosu and I'm helping the Dify team.
    There’s an additional blocker: filling the missing keys alone would not make Contacts display in Traditional Chinese. The current resource loader explicitly loads contacts from en-US for every locale except en-US and zh-Hans, so it bypasses zh-Hant/contacts.json entirely. [1]

    The validation script also exempts locales outside those two from missing-key checks for contacts. Consequently, even pnpm i18n:check --file contacts --lang zh-Hant would not catch the reported missing keys. [2] [3]

    If the intended scope is to enable Traditional Chinese Contacts, the fix should include the translations and add zh-Hant to both contactsLocalizedLocales in web/i18n/load-resource.ts and localizedFileLocales.contacts in web/scripts/check-i18n.js. A maintainer should confirm that localization scope before those restrictions are expanded. [1] [2]

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about dify

  2. 2435634589-creator commented on Nov 10, 2026

    @2435634589-creator
    Author

    Good catch — I checked this against main and the description above is incomplete.

    web/i18n/load-resource.ts:11 defines

    const contactsLocalizedLocales = new Set<Locale>(['en-US', 'zh-Hans'])

    and the ternary at :24-27 resolves contacts to defaultLocale for every locale outside that set, so zh-Hant/contacts.json is never read. web/scripts/check-i18n.js:12-14 applies the same allowlist, which is why pnpm i18n:check does not report the 136 missing keys.

    So adding the keys alone would not change what a Traditional Chinese user sees. My report read the file contents and did not trace the load path — that part was wrong.

    Enabling Traditional Chinese for Contacts needs three changes:

    1. add the 136 missing keys to web/i18n/locales/zh-Hant/contacts.json (prepared; key set becomes 284/284, no placeholder mismatch)
    2. add zh-Hant to contactsLocalizedLocales in web/i18n/load-resource.ts
    3. add zh-Hant to localizedFileLocales.contacts in web/scripts/check-i18n.js

    Items 2 and 3 widen the localization scope, so I would rather not decide that on my own. If a maintainer confirms zh-Hant Contacts is in scope, I will send one PR covering all three. If the allowlist is intentional, then the keys alone have no effect and this issue can be closed — that is a reasonable outcome too.

    🤖 AI-assisted; the code references above were checked against main.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions