You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FT] Manage script and language in the Language enum #745
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.
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
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.
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.
Activity
chiru0631 commentedon May 1, 2026
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
atharvjairath commentedon May 26, 2026
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_Hantetc, but inflores200.pywe just doLanguage(lang.split("_")[0])and drop the script part.zho_Hantis 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 theSERBIAN_LATINstub you left commented intranslation_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:
Scriptenum (iso 15924:Latn, Cyrl, Hans...), give each language a default + allowed scripts, and key the translation literals on language+script. Keep.valueas the 639-3 code so existingLanguage(code)lookups don't break.SERBIAN_LATIN / CHINESE_TRADITIONALthe 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.
Aarush2099 commentedon Nov 29, 2026
I'd like to pick this up.
I'm adding a
LanguageTaghelper that keeps the ISO 15924 script next to the existingLanguageenum, soLanguage.valuestays the ISO-639-3 code. That lets the translation prompts distinguish scripts (for exampleZH_HANTvsZH) 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.