[PR #26534] refactor(docs): Reorganize documentation with standard language codes #31466

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

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

State: closed
Merged: Yes


Summary

Restructure project documentation to follow industry best practices for internationalized documentation organization.

Changes

Directory Structure

  • Move README translations: README/README_*.mddocs/{lang}/README.md
  • Move CONTRIBUTING translations: CONTRIBUTING/CONTRIBUTING_*.mddocs/{lang}/CONTRIBUTING.md

Language Code Standardization

Adopt BCP 47 standard language codes for consistency:

  • CN → zh-CN (Simplified Chinese)
  • TW → zh-TW (Traditional Chinese)
  • JA → ja-JP (Japanese)
  • KR → ko-KR (Korean)
  • And 10 more languages...

Link Fixes

  • Updated all relative paths (images: ../../images/, LICENSE: ../../LICENSE)
  • Fixed CONTRIBUTING internal links
  • Fixed language switcher links (now use ../lang/README.md format)
  • Added missing de-DE (German) links to all READMEs
  • Added missing zh-TW (Traditional Chinese) links to all READMEs
  • Unified zh-CN link text to "简体中文文件" for consistency

Benefits

  1. Clarity: docs/ directory clearly separates project documentation from code
  2. Standards: BCP 47 language codes work seamlessly with i18n tools
  3. Scalability: Easy to add new languages and documentation types
  4. Namespace: No conflict with application-level web/i18n/
  5. Navigation: Complete cross-language link coverage for better UX
  6. Git History: All file history preserved through git rename detection

Testing

  • All language links verified (13 languages + English)
  • All relative paths tested (images, LICENSE, cross-references)
  • CONTRIBUTING links work for all 10 translated versions
  • Git history preserved for all moved files

Before/After

Before:

dify/
├── README.md
├── CONTRIBUTING.md
├── README/
│   ├── README_CN.md
│   ├── README_JA.md
│   └── ...
└── CONTRIBUTING/
    ├── CONTRIBUTING_CN.md
    └── ...

After:

dify/
├── README.md
├── CONTRIBUTING.md
└── docs/
    ├── zh-CN/
    │   ├── README.md
    │   └── CONTRIBUTING.md
    ├── ja-JP/
    │   ├── README.md
    │   └── CONTRIBUTING.md
    └── ... (14 languages)

Fixes #26530

Follow-up Fixes

  • Restored localized README image and docker paths after the docs/ move so assets resolve correctly.
  • Pointed locales without translated contribution guides back to the English CONTRIBUTING page.
  • Removed duplicated security/license sections that appeared at the end of several translations.
**Original Pull Request:** https://github.com/langgenius/dify/pull/26534 **State:** closed **Merged:** Yes --- ## Summary Restructure project documentation to follow industry best practices for internationalized documentation organization. ## Changes ### Directory Structure - Move README translations: `README/README_*.md` → `docs/{lang}/README.md` - Move CONTRIBUTING translations: `CONTRIBUTING/CONTRIBUTING_*.md` → `docs/{lang}/CONTRIBUTING.md` ### Language Code Standardization Adopt BCP 47 standard language codes for consistency: - CN → zh-CN (Simplified Chinese) - TW → zh-TW (Traditional Chinese) - JA → ja-JP (Japanese) - KR → ko-KR (Korean) - And 10 more languages... ### Link Fixes - ✅ Updated all relative paths (images: `../../images/`, LICENSE: `../../LICENSE`) - ✅ Fixed CONTRIBUTING internal links - ✅ Fixed language switcher links (now use `../lang/README.md` format) - ✅ Added missing de-DE (German) links to all READMEs - ✅ Added missing zh-TW (Traditional Chinese) links to all READMEs - ✅ Unified zh-CN link text to "简体中文文件" for consistency ## Benefits 1. **Clarity**: `docs/` directory clearly separates project documentation from code 2. **Standards**: BCP 47 language codes work seamlessly with i18n tools 3. **Scalability**: Easy to add new languages and documentation types 4. **Namespace**: No conflict with application-level `web/i18n/` 5. **Navigation**: Complete cross-language link coverage for better UX 6. **Git History**: All file history preserved through git rename detection ## Testing - [x] All language links verified (13 languages + English) - [x] All relative paths tested (images, LICENSE, cross-references) - [x] CONTRIBUTING links work for all 10 translated versions - [x] Git history preserved for all moved files ## Before/After **Before:** ``` dify/ ├── README.md ├── CONTRIBUTING.md ├── README/ │ ├── README_CN.md │ ├── README_JA.md │ └── ... └── CONTRIBUTING/ ├── CONTRIBUTING_CN.md └── ... ``` **After:** ``` dify/ ├── README.md ├── CONTRIBUTING.md └── docs/ ├── zh-CN/ │ ├── README.md │ └── CONTRIBUTING.md ├── ja-JP/ │ ├── README.md │ └── CONTRIBUTING.md └── ... (14 languages) ``` Fixes #26530 ### Follow-up Fixes - Restored localized README image and docker paths after the docs/ move so assets resolve correctly. - Pointed locales without translated contribution guides back to the English CONTRIBUTING page. - Removed duplicated security/license sections that appeared at the end of several translations.
yindo added the pull-request label 2026-02-21 20:49:31 -05:00
yindo closed this issue 2026-02-21 20:49:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#31466