Files
schihei 2a601058f4 feat(capture): translate long selections in parts
The capture gate and the chunk size were the same number, so a selection above one chunk was rejected before the pipeline could split it; the Settings sliders moved both thresholds together. Add maximumPartsPerSelection (1-8, default 1, so existing behaviour is unchanged). The capture limit is now part size x parts and travels on TranslationSessionRequest, so the watcher, CapturePolicy and TranslationSession agree for that capture. TranslationStreaming gained an optional per-part callback; the session emits chunkStarted and the panel shows 'Part 2 of 4' while streaming and '2 parts' when finished. textTooLong now points at Settings and offers an Open Settings button. Lower the dense-script part-size maximum to 4000 because 5000 dense characters plus a 4096-token output can overflow the 8192-token context. Tests cover capture limits, watcher limits, pipeline part callbacks, session events and limits, panel progress, settings clamping and migration. Docs updated: ADR-011, TRANSLATION_OUTPUT, SELECTION_AND_CLIPBOARD, ARCHITECTURE, LANGUAGES and README. Verified: make verify green; live 4355-character German text showed Part 1 of 2, Part 2 of 2 and '2 parts'; with one part the panel showed the too-long message and Open Settings.
2026-11-27 20:21:30 +01:00

148 lines
6.5 KiB
Markdown

# Supported languages
Hy-MT3 supports **102 languages**. The exact English name matters: it is inserted into the prompt. Never use a localised name, an ISO display name, or a language code in the prompt.
`docs/HYMT3_MODEL.md` is the source for the prompt templates. This file is the source for the catalogue.
## 1. Languages supported since Hy-MT2 (33)
| Code | Model name (prompt) | Chinese name | Notes |
|---|---|---|---|
| `zh` | Chinese | 中文 | Simplified Chinese; display as "Chinese (Simplified)" |
| `en` | English | 英语 | |
| `fr` | French | 法语 | |
| `pt` | Portuguese | 葡萄牙语 | `pt-BR`/`pt-PT` also map here |
| `es` | Spanish | 西班牙语 | |
| `ja` | Japanese | 日语 | |
| `tr` | Turkish | 土耳其语 | |
| `ru` | Russian | 俄语 | |
| `ar` | Arabic | 阿拉伯语 | RTL |
| `ko` | Korean | 韩语 | |
| `th` | Thai | 泰语 | |
| `it` | Italian | 意大利语 | |
| `de` | German | 德语 | |
| `vi` | Vietnamese | 越南语 | |
| `ms` | Malay | 马来语 | |
| `id` | Indonesian | 印尼语 | legacy `in` maps here |
| `tl` | Filipino | 菲律宾语 | |
| `hi` | Hindi | 印地语 | |
| `zh-Hant` | Traditional Chinese | 繁体中文 | the model card writes `zh-TR`; prompt name is "Traditional Chinese" |
| `pl` | Polish | 波兰语 | |
| `cs` | Czech | 捷克语 | |
| `nl` | Dutch | 荷兰语 | |
| `km` | Khmer | 高棉语 | |
| `my` | Burmese | 缅甸语 | |
| `fa` | Persian | 波斯语 | RTL |
| `gu` | Gujarati | 古吉拉特语 | |
| `ur` | Urdu | 乌尔都语 | RTL |
| `te` | Telugu | 泰卢固语 | |
| `mr` | Marathi | 马拉地语 | |
| `he` | Hebrew | 希伯来语 | RTL; legacy `iw` maps here |
| `bn` | Bengali | 孟加拉语 | |
| `ta` | Tamil | 泰米尔语 | |
| `uk` | Ukrainian | 乌克兰语 | |
## 2. Chinese minority languages and dialects (5)
| Code | Model name (prompt) | Chinese name | Notes |
|---|---|---|---|
| `bo` | Tibetan | 藏语 | |
| `mn` | Traditional Mongolian | 传统蒙古语 | Mongolian script |
| `yue` | Cantonese | 粤语 | |
| `kk` | Arabic Kazakh | 阿拉伯字母哈萨克语 | Arabic script, RTL |
| `ug` | Uyghur | 维吾尔语 | RTL |
## 3. Newly supported in Hy-MT3 (64)
| Code | Model name (prompt) | Chinese name |
|---|---|---|
| `el` | Greek | 希腊语 |
| `cy` | Welsh | 威尔士语 |
| `si` | Sinhala | 僧伽罗语 |
| `ro` | Romanian | 罗马尼亚语 |
| `ca` | Catalan | 加泰罗尼亚语 |
| `pa` | Punjabi | 旁遮普语 |
| `hu` | Hungarian | 匈牙利语 |
| `gl` | Galician | 加利西亚语 |
| `sd` | Sindhi | 信德语 |
| `bg` | Bulgarian | 保加利亚语 |
| `eu` | Basque | 巴斯克语 |
| `as` | Assamese | 阿萨姆语 |
| `sr` | Serbian | 塞尔维亚语 |
| `af` | Afrikaans | 南非荷兰语 |
| `or` | Odia | 奥里亚语 |
| `hr` | Croatian | 克罗地亚语 |
| `lb` | Luxembourgish | 卢森堡语 |
| `kn` | Kannada | 卡纳达语 |
| `sk` | Slovak | 斯洛伐克语 |
| `mt` | Maltese | 马耳他语 |
| `ml` | Malayalam | 马拉雅拉姆语 |
| `sl` | Slovenian | 斯洛文尼亚语 |
| `eo` | Esperanto | 世界语 |
| `sa` | Sanskrit | 梵语 |
| `sq` | Albanian | 阿尔巴尼亚语 |
| `yi` | Yiddish | 意第绪语 |
| `lo` | Lao | 老挝语 |
| `mk` | Macedonian | 马其顿语 |
| `hy` | Armenian | 亚美尼亚语 |
| `jv` | Javanese | 爪哇语 |
| `be` | Belarusian | 白俄罗斯语 |
| `ka` | Georgian | 格鲁吉亚语 |
| `su` | Sundanese | 巽他语 |
| `lt` | Lithuanian | 立陶宛语 |
| `az` | Azerbaijani | 阿塞拜疆语 |
| `ceb` | Cebuano | 宿务语 |
| `lv` | Latvian | 拉脱维亚语 |
| `uz` | Uzbek | 乌兹别克语 |
| `war` | Waray | 瓦瑞语 |
| `et` | Estonian | 爱沙尼亚语 |
| `ky` | Kyrgyz | 吉尔吉斯语 |
| `sw` | Swahili | 斯瓦希里语 |
| `fi` | Finnish | 芬兰语 |
| `tk` | Turkmen | 土库曼语 |
| `am` | Amharic | 阿姆哈拉语 |
| `sv` | Swedish | 瑞典语 |
| `tg` | Tajik | 塔吉克语 |
| `so` | Somali | 索马里语 |
| `da` | Danish | 丹麦语 |
| `tt` | Tatar | 鞑靼语 |
| `mg` | Malagasy | 马达加斯加语 |
| `nb` | Norwegian | 挪威语 |
| `ba` | Bashkir | 巴什基尔语 |
| `ht` | Haitian Creole | 海地克里奥尔语 |
| `nn` | Norwegian Nynorsk | 新挪威语 |
| `ku` | Kurdish | 库尔德语 |
| `kk-Cyrl` | Cyrillic Kazakh | 西里尔哈萨克语 |
| `is` | Icelandic | 冰岛语 |
| `ckb` | Central Kurdish | 中库尔德语 |
| `mn-Cyrl` | Cyrillic Mongolian | 西里尔蒙古语 |
| `ga` | Irish | 爱尔兰语 |
| `ps` | Pashto | 普什图语 |
| `gd` | Scottish Gaelic | 苏格兰盖尔语 |
| `ne` | Nepali | 尼泊尔语 |
## 4. Mapping rules
1. **Prompt name = model card name.** `TargetLanguage.modelName` is one of the names above. It is never localised.
2. **Display name = localised.** `TargetLanguage.displayName` may be "Deutsch", "German", "Allemand", etc. It never enters the prompt.
3. **Variants collapse to the card's name.**
- `zh`, `zh-Hans`, `zh-CN`, `zh-SG` → `Chinese`.
- `zh-Hant`, `zh-TW`, `zh-HK`, `zh-TR` → `Traditional Chinese`.
- `pt`, `pt-BR`, `pt-PT` → `Portuguese`.
- `no`, `nb`, `nn` → `Norwegian` or `Norwegian Nynorsk` as appropriate; `no` defaults to `nb` (Norwegian).
- `kk` → `Arabic Kazakh`; `kk-Cyrl`, `kk-KZ` → `Cyrillic Kazakh`.
- `mn` → `Traditional Mongolian`; `mn-Cyrl` → `Cyrillic Mongolian`.
- `ku` → `Kurdish`; `ckb` → `Central Kurdish`.
- `tl`, `fil` → `Filipino`.
- `iw` → `he` (Hebrew); `in` → `id` (Indonesian).
4. **Unknown codes are not silently mapped.** The UI shows only the 102 supported languages; an incoming detection result outside the list is displayed as "Unknown" and translation still proceeds (the prompt only needs the target).
5. **Source detection is advisory.** `NLLanguageRecognizer` supports fewer languages than Hy-MT3. A low-confidence or unsupported detection never blocks translation.
6. **RTL languages:** `ar`, `he`, `fa`, `ur`, `ps`, `sd`, `ug`, `ckb`, `yi`, and `kk` (Arabic Kazakh). The panel must render them right-to-left; the source and translation directions can differ.
7. **Dense-script part size:** CJK, Thai, Lao, Khmer, Burmese, Tibetan, Arabic-script and other dense scripts use the 2000-character part size; Latin/Cyrillic/Greek use 4000. The chunker uses Unicode script ranges, not the language code.
## 5. UI ordering
- Recent targets first (last three), then a searchable list grouped by "Common", "Europe", "Asia", "Middle East and Africa", "Other".
- Common defaults: English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Chinese, Japanese, Korean, Arabic, Turkish, Russian, Ukrainian.
- The system language is the first-run target if it is in the catalogue; otherwise English.