RepositoryPythonIRIran
bbmokhtari

bbmokhtari/django-translations

Django model translation for perfectionists with deadlines.

148sao
23fork
3issue
2lượt xem

🌍 django-translations: Dịch model Django mà không cần model phụ

Lưu trữ bản dịch ngay trên model gốc — nhanh, gọn, không ràng buộc schema phức tạp.

django-translations là thư viện Python hỗ trợ dịch trường (field) ngôn ngữ của các model Django một cách trực tiếp. Thay vì tạo model phụ để lưu bản dịch, thư viện này cho phép lưu trữ nhiều phiên bản ngôn ngữ khác nhau trên cùng một bản ghi model.

✨ Điểm nổi bật

  • Lưu trữ inline: Bản dịch được lưu trữ ngay trên model gốc dưới dạng JSON hoặc dictionary, không cần model phụ.
  • Tích hợp Django ORM: Sử dụng trực tiếp trên model Django thông qua custom field, hỗ trợ truy vấn và lọc theo ngôn ngữ.
  • Hỗ trợ đa ngôn ngữ: Dễ dàng thêm/xóa ngôn ngữ mà không thay đổi cấu trúc cơ sở dữ liệu.
  • Tương thích migration: Tự động hóa quá trình migration để đồng bộ hóa trường dịch.
  • Giảm độ phức tạp schema: Không cần join bảng hoặc quản lý quan hệ foreign key phức tạp.
  • Hiệu suất cao: Truy cập bản dịch nhanh thông qua trường đã được tối ưu hóa.

💡 Vì sao đáng chú ý

django-translations phù hợp với các dự án Django cần hỗ trợ đa ngôn ngữ nhưng muốn giữ đơn giản hóa cấu trúc cơ sở dữ liệu. Thư viện này giúp giảm thiểu số lượng model và mối quan hệ phức tạp, đồng thời duy trì hiệu suất cao nhờ lưu trữ trực tiếp trên model gốc.


#Django #Python #Internationalization #ModelTranslation #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryPython
WeblateOrg/weblate

Web based localization tool with tight version control integration.

6.2k
Nov 17, 2026
RepositoryTypeScript
formatjs/formatjs

The monorepo home to all of the FormatJS related libraries, most notably react-intl.

14.8k
Nov 21, 2026
RepositoryTypeScript
generaltranslation/gt

Full-stack localization for every framework

1.1k
Nov 20, 2026
Modeltranslation
google-t5/t5-small

Model Card for T5 Small !model image(https://camo.githubusercontent.com/623b4dea0b653f2ad3f36c71ebfe749a677ac0a1/68747470733a2f2f6d69726f2e6d656469756d2e636f6d2f6d61782f343030362f312a44304a31674e51663876727255704b657944387750412e706e67) Table of Con...

♥0
17.0M
Jun 30, 2023
RepositoryJavaScript
i18next/react-i18next

Internationalization for react done right. Using the i18next i18n ecosystem.

10.1k
Nov 19, 2026
RepositoryJavaScript
i18next/i18next

i18next: learn once - translate everywhere

8.7k
Nov 17, 2026
Modeltranslation
google-t5/t5-base

Model Card for T5 Base !model image(https://camo.githubusercontent.com/623b4dea0b653f2ad3f36c71ebfe749a677ac0a1/68747470733a2f2f6d69726f2e6d656469756d2e636f6d2f6d61782f343030362f312a44304a31674e51663876727255704b657944387750412e706e67) Table of Cont...

♥0
2.7M
Feb 14, 2024
Modeltranslation
tencent/Hy-MT2-1.8B

English | 中文 !HuggingFace(https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Tencent%20Hy-ffc107?color=ffc107&logoColor=white)(https://huggingface.co/collections/tencent/hy-mt2)    !ModelScope(https://img.shields.io/badge...

♥0
21.2k
May 26, 2026
Modeltranslation
tencent/HY-MT1.5-1.8B

🤗 Hugging Face  |   🕹️ Demo     🤖 ModelScope  |   🖥️ Official Website  |   Github Model Introduction Hunyuan Translation Model Version 1.5 includ...

♥0
4.7k
Jan 1, 2026