Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Migrate languages.py to spec + code generation

Aperta
#186 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
javascript, python

Direzione di ricerca

Inizia da le_utils/constants/languages.py, resources/languagelookup.json e scripts/generate_from_specs.py, quindi esamina tests/test_languages.py e tests/test_getlangs.py. Conferma che la specifica contenga tutte le voci delle lingue e i metadati, che la generazione produca gli output Python e JavaScript, che i test aggiornati passino e che il file JSON legacy venga rimosso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

❌ 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.

Lingua principale
Python
Stelle
7
Fork
37
Merge medio
7g 42m
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di learningequality/le-utils

Tutte le issue di learningequality/le-utils

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.