[PR #30368] fix(i18n): load server namespaces by kebab-case #32791

Closed
opened 2026-02-21 20:52:05 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/30368

State: closed
Merged: Yes


Summary

  • Load server i18n JSON files by kebab-case filenames while keeping camelCase namespaces internally.

Context

After PR #30336, getTranslation camelCases namespaces before calling loadNamespaces. The server backend then builds import paths like ../i18n/${language}/${namespace}.json, which becomes datasetSettings.json for dataset-settings. That file doesn't exist, so server translations for dashed namespaces fail.

Repro

  1. Ensure the locale cookie is set (e.g., zh-Hans).
  2. Open /datasets/<id>/settings (uses dataset-settings).
  3. Server tries to load datasetSettings.json and misses; translations fall back to keys.

Fix

  • Convert the backend namespace to kebab-case before building the import path.
**Original Pull Request:** https://github.com/langgenius/dify/pull/30368 **State:** closed **Merged:** Yes --- ## Summary - Load server i18n JSON files by kebab-case filenames while keeping camelCase namespaces internally. ## Context After PR #30336, `getTranslation` camelCases namespaces before calling `loadNamespaces`. The server backend then builds import paths like `../i18n/${language}/${namespace}.json`, which becomes `datasetSettings.json` for `dataset-settings`. That file doesn't exist, so server translations for dashed namespaces fail. ## Repro 1. Ensure the locale cookie is set (e.g., `zh-Hans`). 2. Open `/datasets/<id>/settings` (uses `dataset-settings`). 3. Server tries to load `datasetSettings.json` and misses; translations fall back to keys. ## Fix - Convert the backend `namespace` to kebab-case before building the import path.
yindo added the pull-request label 2026-02-21 20:52:05 -05:00
yindo closed this issue 2026-02-21 20:52:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32791