Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Migrate languages.py to spec + code generation

Đang mở
#186 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
20/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, python

Hướng nghiên cứu

Bắt đầu với le_utils/constants/languages.py, resources/languagelookup.json và scripts/generate_from_specs.py, sau đó xem xét tests/test_languages.py và tests/test_getlangs.py. Xác nhận rằng đặc tả chứa tất cả các mục ngôn ngữ và siêu dữ liệu, quá trình tạo sinh các đầu ra Python và JavaScript, các bài kiểm thử đã cập nhật đều đạt và tệp JSON legacy được xóa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

languages should be generated from a spec in the format #182 introduces, and scripts/add_language.py should add new languages to that spec. Its public Python API should not change.

Complexity: High
Target branch: main

Context
  • languagelookup.json holds 286 languages; the 17 RTL ones carry "rtl": true, which becomes Language.text_direction.
  • Language has five fields and three properties (code, id, first_native_name).
  • getlang_by_name and getlang_by_native_name also match aliases built from the ;-, ,- and ()-separated parts of each name.
  • make add-language runs scripts/add_language.py, which writes to languagelookup.json.
  • languagelookup.json is linked from ricecooker's docs, kolibri-library, sample-channels, cookiecutter-chef, and spec/schema-embed_*_request.json in this repo.
The Change
  • js/Languages.js should export the language records and the text direction constants.
Acceptance Criteria
  • le_utils/constants/languages.py and js/Languages.js are generated from spec/constants-languages.json, and make build on a clean checkout leaves no diff.
  • The pinned-API test from #182 passes unchanged for languages, and getlang_by_name and getlang_by_native_name return the same language as before for every name and alias.
  • make add-language adds a language to spec/constants-languages.json.
  • le_utils/resources/languagelookup.json is a symlink to spec/constants-languages.json.

AI usage

I made the decisions recorded on #181 and #182; Claude Code applied them to this module against the current code and drafted the issue.

Ngôn ngữ chính
Python
Star
7
Fork
37
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
7

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của learningequality/le-utils

Tất cả issue của learningequality/le-utils

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.