YeCha has two multilingual layers: UI strings (language packs) and content translations (ye_poly_contents). Language is identified purely by URL prefix — no cookies — so links are shareable and indexable.
On this page
- Enable & URLs · Language packs · Content translations · Term translations · AI translation · Traditional & RTL · Troubleshooting
Enable & URL rules
| Option | Meaning |
|---|---|
plugin.poly.enabled | Enables the plugin and the Multilingual admin module |
site.languages | Enabled languages, e.g. ["zh","en"] |
site.default_lang | Base language for original content |
site.name_en / site.subtitle_en | Site name and tagline in the English UI |
- Chinese:
/,/docs-install.html,/category/guide/ - English:
/en/,/en/docs-install.html,/en/category/guide/ Routerstrips the first segment only when the language is enabled andPoly::on()is true; otherwise/ja/…is a 404.- Build internal links with
ui_lp(); taxonomy links withPoly::termUrl().
Known existing behaviour: plugin pages (/theme,/plugin,/downloads,/enterprise, …) return 404 under/ja/,/ko/and similar prefixes. The official site currently exposes Chinese and/en/only; content pages are unaffected.
Language packs
Packs live in lang/*.php and return key/value arrays read via __('nav.docs'); Lang::short() gives the current code.
When adding a nav item or button:
- Use a language key as
labelinNav::defs(); - Add the same key to
lang/zh_CN.phpandlang/en_US.php; - Uncovered languages fall back to the base language — never hard-code Chinese into views.
Content translations
ye_poly_contents is keyed by group_id (base content id) + lang:
| Field | Meaning |
|---|---|
group_id / lang / status | Owner, language, publish state (only publish is visible) |
title / slug / excerpt / content | Translated fields |
description / keywords | Translated SEO |
manual_override / ai_generated / ai_revision / stale | Manual-edit protection, AI flags, revision, stale marker |
source_lang / last_ai_at | Source language, last AI run |
Front end uses Poly::row($baseId, $lang); a missing or unpublished translation falls back to the base language. Lists use Poly::publishedList($lang, $limit).
Term translations
| Field | Meaning |
|---|---|
names_i18n | JSON, e.g. {"en":"Guides","ja":"ガイド"} |
name_en | Legacy short English name |
slug_i18n | Per-language URL aliases |
count | Precomputed post count, shared across languages |
Use Poly::termName($row, $lang) and Poly::termUrl($type, $row); printing $row['name'] directly leaks Chinese into English pages.
AI translation
The AI translate button in the posts/pages list translates one item into every enabled language. Versions 1.2.2 / 1.2.3 specifically hardened it:
| Mechanism | Purpose |
|---|---|
| One language per request | No more serial translation of all languages in a single HTTP request (which saturated PHP-FPM with long network waits) |
Per-cid file lock (300s TTL) | Prevents double-clicks stacking processes |
| Session queue + meta-refresh auto-chain | N languages become N short chained requests with an iteration safety valve |
set_time_limit(30) + 20s API timeout | Hard wall clock, fast failure |
| Overwrite mode (force) | Re-translates existing languages but protects manual_override rows |
| Language validation + 2 retries | Japanese must contain kana, Korean Hangul, Latin languages letters and not pure Han; failures retry with a stronger prompt, then fail loudly — never stored |
| Chain tolerance | One failed language no longer stops the batch; a final report lists success/skipped/failed |
The system prompt requires fluent native target-language writing with no Chinese retained, reducing source-text echo.
Traditional & RTL
core/ZhTw.phphandles Simplified↔Traditional;twdeep pagination on large terms uses theye_meta_page_boundskeyset fast path (1.2.4) with a safe fallback when the subset is smaller thanlimit.- RTL languages such as Arabic need theme support (
dir="rtl"); the default theme has no RTL layout. - Language codes must match
site.languages, otherwiseRouterwill not recognise the prefix.
Troubleshooting
| Symptom | Check |
|---|---|
/en/xxx.html still Chinese | Translation missing or not publish; base-language fallback is expected — add it in Multilingual |
| Clicking a post returns to Chinese | Link missed the language prefix; use ui_lp() / Poly::termUrl() |
| Category name is Chinese on the English page | names_i18n lacks that language |
| AI result is still Chinese | 1.2.3 validation blocks it and reports an error; fix manually and set manual_override |
| Overwrite erased a manual edit | Should not happen (manual_override=1 is skipped); check the flag |
/ja/theme is 404 | Existing behaviour for plugin pages, see URL rules |
A button shows nav.xxx | Missing language key — add it to lang/*.php |
More: FAQ and user guide → i18n.