Skip to content

[FT] Manage script and language in the Language enum #745

Description

@clefourrier

Issue encountered

At the moment, we assume one single script per language (which is incorrect).

Solution/Feature

The Language enum needs to be updated to include the script, and templates need to be edited to select which script to provide among the alternatives. See the FLORES 200 task for an example where some subsets had to be removed for this reason.

Activity

  1. added theissue type on May 19, 2025
  2. chiru0631 commented on May 1, 2026

    @chiru0631

    I'm Chirag Sathish, a developer experienced with Java / Python / Go / Spring Boot / Node.js. I’d like to work on this issue — could you please assign it to me? I’ll open a draft PR within a few days

  3. atharvjairath commented on May 26, 2026

    @atharvjairath

    Hi @clefourrier, would like to pick this up if it's still open.

    Spent some time digging in and the script thing is pretty clearly biting us already, flores subsets come in as srp_Cyrl / srp_Latn, zho_Hans / zho_Hant etc, but in flores200.py we just do Language(lang.split("_")[0]) and drop the script part. zho_Hant is even commented out right now because of it. The enum also has a bunch of duplicate iso codes (pan, ckb, kir, nep, swa, war) which is the same one-script-per-language assumption showing up. And I noticed the SERBIAN_LATIN stub you left commented in translation_literals.py, so I think I get roughly where you wanted this to go.

    Before I start changing things across files, wanted to check the direction you'd prefer:

    • add a separate Script enum (iso 15924: Latn, Cyrl, Hans...), give each language a default + allowed scripts, and key the translation literals on language+script. Keep .value as the 639-3 code so existing Language(code) lookups don't break.
    • or just add explicit members like SERBIAN_LATIN / CHINESE_TRADITIONAL the way that stub suggests, which is a smaller change but gets messy if we do it for everything.

    Leaning towards the first one since it scales better, but happy to go either way, whatever fits how you want the enum to look. Once you confirm I'll open a PR.

  4. Aarush2099 commented on Nov 29, 2026

    @Aarush2099

    I'd like to pick this up.

    I'm adding a LanguageTag helper that keeps the ISO 15924 script next to the existing Language enum, so Language.value stays the ISO-639-3 code. That lets the translation prompts distinguish scripts (for example ZH_HANT vs ZH) and restore the FLORES-200 subsets that had to be dropped. I'll also bump the FLORES-200 task version, since those prompt labels change.

    I saw #1272, which was closed by the author after it went unreviewed. I'll open a new PR with this approach shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions