App: French as the ninth interface language (#3970)

fr.json, fix-fr.json, tune-fr.json and tools-fr.json (3,654 strings, vous, plain short words), the Francais entry in the language picker, every locale test and gap check now covers fr, a french-catalog test (spacing before ? ! : ;, apostrophes, short labels, no leftover English), scripts/fr_sync.py to list and merge strings added later, and scripts/language-shots.mjs for screenshots of the app in one language.
This commit is contained in:
Niko1221 committed 2026-10-26 20:57:57 +01:00
1 parent 9db497056b
commit 52a558abbe
32 files changed
+3999 -41

No files matched your search

+12
View File
@@ -10,3 +10,15 @@ npm run preview:ui
The built UI is included. To rebuild after source edits, run `npm run build`. `preview:ui` uses isolated simulated data; `npm run dev` connects the normal host.
The previous project README is retained in [docs/README-historical.md](docs/README-historical.md). It contains older implementation status and is historical reference.
## Languages
The app speaks English, Chinese, Japanese, German, French, Spanish, Russian, Portuguese and Korean. The English text is the key: `src/locales/en.json`
(with `fix-en.json`, `tune-en.json` and `tools-en.json`) holds every string, and each language has the same four files (`fr.json`, `fix-fr.json`, ...).
- **A new string.** Write it with `tr("...")`, then add it to the English catalog (`node scripts/append-localization.mjs`, or the next `fx` number in
`scripts/make-fix-locales.py`). The language tests fail until every language has it.
- **French.** `python scripts/fr_sync.py missing todo.tsv` lists the English strings that have no French yet, one per line (`id`, a tab, the text).
Translate the second column ("vous", short plain words, one next step; a lone `=` keeps the English), then `python scripts/fr_sync.py apply todo.tsv` merges it
(it also sets the French spacing before `: ; ? !` and the typographic apostrophe) and `python scripts/fr_sync.py check` confirms nothing is missing.
- **Screenshots in a language.** `npm run build`, then `node scripts/language-shots.mjs fr <folder> models settings setup` (hermetic preview host, scratch profile, headless Chrome).
+156
View File
@@ -0,0 +1,156 @@
"""French (fr) catalog tooling for the desktop app (#3970).
The French texts live in src/locales/fr.json, fix-fr.json, tune-fr.json and tools-fr.json, next to the other languages.
They are edited by hand (they are the translations, not generated), so a string added to an English catalog later has no
French yet. This script lists and merges those. From apps/host:
python scripts/fr_sync.py missing [out.tsv] write every English string that has no French yet
python scripts/fr_sync.py apply done.tsv merge translations, rewrite the four fr files in English key order
python scripts/fr_sync.py check exit 1 if a French string is missing, empty or breaks a placeholder / tag
The TSV has one string per line: <id><TAB><text>. In the text, a newline is written \\n and a backslash \\\\.
In the "done" file a lone = means "keep the English text as it is" (class names, product names, file names).
The id prefix picks the file: s0001 -> fr.json, fx01 -> fix-fr.json, tune01 -> tune-fr.json, tl01 -> tools-fr.json.
Use "vous", plain short words, a next step, and a no-break space (U+00A0) before : ; ? ! and inside guillemets.
"""
import json
import re
import sys
from pathlib import Path
LOCALES = Path(__file__).resolve().parent.parent / "src" / "locales"
PAIRS = [("en.json", "fr.json"), ("fix-en.json", "fix-fr.json"), ("tune-en.json", "tune-fr.json"), ("tools-en.json", "tools-fr.json")]
SLOT = re.compile(r"\{\d+\}")
TAG = re.compile(r"</?[A-Za-z][^>]*>")
def load(name):
path = LOCALES / name
return json.loads(path.read_text(encoding="utf-8")) if path.exists() else {}
def file_of(identifier):
for en_name, fr_name in PAIRS:
if identifier in load(en_name):
return fr_name
raise SystemExit(f"unknown id {identifier}: it is in no English catalog")
def escape(text):
return text.replace("\\", "\\\\").replace("\n", "\\n")
def unescape(text):
out, i = [], 0
while i < len(text):
if text[i] == "\\" and i + 1 < len(text):
out.append({"n": "\n", "\\": "\\"}.get(text[i + 1], text[i + 1]))
i += 2
else:
out.append(text[i])
i += 1
return "".join(out)
NBSP = " "
def typography(text):
"""French spacing and apostrophes, applied to every translated (not kept) string.
l'image -> l'image with a typographic apostrophe (also before a {0} slot); a no-break space before : ; ? ! % and inside the guillemets."""
text = re.sub(r"(?<=[A-Za-zÀ-ſ])'(?=[A-Za-zÀ-ſ{])", "’", text)
text = re.sub(r"(?<=\S) ([:;?!])", NBSP + r"\1", text)
text = re.sub(r"(?<=[\d}]) %", NBSP + "%", text)
text = re.sub("« ?", "«" + NBSP, text)
text = re.sub(" ?»", NBSP + "»", text)
return text
def problems(identifier, source, text):
found = []
if not text.strip():
found.append("empty")
expected = [slot for slot in SLOT.findall(source) if not (identifier == "s2463" and slot == "{1}")] # the tests allow this one to drop {1} (the plural suffix)
if sorted(expected) != sorted(SLOT.findall(text)):
found.append("placeholders differ")
if sorted(TAG.findall(source)) != sorted(TAG.findall(text)):
found.append("markup differs")
return found
def missing():
todo = {}
for en_name, fr_name in PAIRS:
en, fr = load(en_name), load(fr_name)
for identifier, text in en.items():
if identifier not in fr:
todo[identifier] = text
return todo
def main(argv):
command = argv[1] if len(argv) > 1 else ""
if command == "missing":
todo = missing()
lines = [f"{identifier}\t{escape(text)}" for identifier, text in todo.items()]
if len(argv) > 2:
Path(argv[2]).write_text("\n".join(lines) + ("\n" if lines else ""), encoding="utf-8")
print(f"{len(lines)} strings without French written to {argv[2]}")
else:
print("\n".join(lines))
print(f"{len(lines)} strings without French", file=sys.stderr)
return 0
if command == "apply" and len(argv) > 2:
incoming = {}
for number, line in enumerate(Path(argv[2]).read_text(encoding="utf-8").splitlines(), 1):
if not line.strip():
continue
if "\t" not in line:
raise SystemExit(f"{argv[2]}:{number}: no tab")
identifier, text = line.split("\t", 1)
incoming[identifier.strip()] = text
bad = 0
for en_name, fr_name in PAIRS:
en, fr = load(en_name), load(fr_name)
changed = False
for identifier, source in en.items():
if identifier in incoming:
text = source if incoming[identifier] == "=" else typography(unescape(incoming[identifier]))
for why in problems(identifier, source, text):
print(f"{identifier}: {why}: {source!r} -> {text!r}")
bad += 1
fr[identifier] = text
changed = True
if changed:
ordered = {identifier: fr[identifier] for identifier in en if identifier in fr}
(LOCALES / fr_name).write_text(json.dumps(ordered, ensure_ascii=False, indent=1 if en_name != "en.json" else 2) + "\n", encoding="utf-8")
unknown = [identifier for identifier in incoming if not any(identifier in load(en_name) for en_name, _ in PAIRS)]
for identifier in unknown:
print(f"{identifier}: not in any English catalog")
bad += 1
print(f"applied {len(incoming)} strings, {bad} problems")
return 1 if bad else 0
if command == "check":
bad = 0
for en_name, fr_name in PAIRS:
en, fr = load(en_name), load(fr_name)
for identifier, source in en.items():
if identifier not in fr:
print(f"{fr_name}: {identifier} has no French yet: {source!r}")
bad += 1
continue
for why in problems(identifier, source, fr[identifier]):
print(f"{fr_name}: {identifier}: {why}")
bad += 1
for identifier in fr:
if identifier not in en:
print(f"{fr_name}: {identifier} is not in {en_name}")
bad += 1
print("French catalogs complete" if not bad else f"{bad} problems")
return 1 if bad else 0
print(__doc__)
return 2
if __name__ == "__main__":
raise SystemExit(main(sys.argv))
+64
View File
@@ -0,0 +1,64 @@
#!/usr/bin/env node
/**
* Screenshots of the app screens in one interface language, from a hermetic preview host (simulated hardware and models,
* scratch profile, no engine, no weights). The browser is a throw-away headless Chrome profile.
*
* node scripts/language-shots.mjs <lang> <outDir> [route ...] (needs `npm run build` first)
* example: node scripts/language-shots.mjs fr C:/Users/me/Desktop/fr-screens models settings setup
*
* Env: CHROME (path to Chrome/Edge), WIDTH (default 1280), HEIGHT (default 800).
*/
import { spawn } from 'node:child_process';
import { chromium } from 'playwright-core';
import { existsSync, mkdirSync, mkdtempSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join, resolve } from 'node:path';
const root = resolve(import.meta.dirname, '..');
const [, , language = 'fr', outDir = 'language-shots', ...routes] = process.argv;
const screens = routes.length ? routes : ['models', 'settings', 'setup'];
if (!existsSync(join(root, 'dist/index.html'))) { console.error('Run npm run build first.'); process.exit(1); }
const chrome = process.env.CHROME ?? ['C:/Program Files/Google/Chrome/Application/chrome.exe', 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe', '/usr/bin/google-chrome', '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'].find(existsSync);
if (!chrome) { console.error('No Chrome or Edge found; set CHROME.'); process.exit(1); }
const home = mkdtempSync(join(tmpdir(), 'strata-language-shots-'));
const hostPort = 8830 + Math.floor(Math.random() * 40), webPort = hostPort + 100;
const scratch = { STRATA_HOME: home, STRATA_MODELS_DIR: join(home, 'models'), STRATA_WORKSPACE: home, STRATA_REAL_ENGINE: '0', STRATA_NATIVE_REPO: join(home, 'no-native-installation'),
STRATA_SETTINGS_FILE: join(home, 'app-settings.json'), STRATA_COMPONENTS_DIR: join(home, 'components'), LOCALAPPDATA: join(home, 'Local'), APPDATA: join(home, 'Roaming'),
XDG_DATA_HOME: join(home, 'xdg-data'), XDG_STATE_HOME: join(home, 'xdg-state'), XDG_CONFIG_HOME: join(home, 'xdg-config'), STRATA_PORT: String(hostPort) };
const children = [];
const run = (args, extra = {}) => { const child = spawn(process.execPath, args, { cwd: root, env: { ...process.env, ...scratch, ...extra }, stdio: 'ignore' }); children.push(child); return child; };
const stop = () => { for (const child of children) { try { child.kill(); } catch {} } try { rmSync(home, { recursive: true, force: true }); } catch {} };
process.on('exit', stop);
run(['server/index.mjs']);
for (let attempt = 0; ; attempt++) {
try { if ((await fetch(`http://127.0.0.1:${hostPort}/api/health`)).ok) break; } catch {}
if (attempt > 200) { console.error('The preview host did not start.'); process.exit(1); }
await new Promise(done => setTimeout(done, 150));
}
run(['tests/fixtures/onboarding-ui-host.mjs'], { STRATA_UI_PREVIEW: '1', STRATA_ONBOARDING_UPSTREAM: `http://127.0.0.1:${hostPort}`, STRATA_ONBOARDING_PORT: String(webPort), STRATA_ONBOARDING_START: 'ready', STRATA_ONBOARDING_SCENARIO: 'telemetry', STRATA_ONBOARDING_PREVIEW: '1' });
for (let attempt = 0; ; attempt++) {
try { if ((await fetch(`http://127.0.0.1:${webPort}/`)).ok) break; } catch {}
if (attempt > 200) { console.error('The preview page did not start.'); process.exit(1); }
await new Promise(done => setTimeout(done, 150));
}
mkdirSync(resolve(outDir), { recursive: true });
const browser = await chromium.launch({ executablePath: chrome, headless: true, args: ['--no-sandbox', '--disable-gpu', '--force-device-scale-factor=1'] });
const page = await browser.newPage({ viewport: { width: Number(process.env.WIDTH ?? 1280), height: Number(process.env.HEIGHT ?? 800) }, deviceScaleFactor: 1 });
await page.addInitScript(code => { try { localStorage.setItem('strata.prefs.v2', JSON.stringify({ language: code, onboardingSeen: true })); } catch {} }, language);
const problems = [];
page.on('pageerror', error => problems.push(`pageerror: ${error.message}`));
for (const screen of screens) {
await page.goto(`http://127.0.0.1:${webPort}/#/${screen}`, { waitUntil: 'load' });
await page.reload({ waitUntil: 'load' });
await page.waitForTimeout(2500);
const file = join(resolve(outDir), `${language}-${screen}.png`);
await page.screenshot({ path: file });
console.log(`${screen}: ${file} (lang=${await page.evaluate(() => document.documentElement.lang)})`);
}
await browser.close();
if (problems.length) console.log(problems.join('\n'));
stop();
process.exit(0);
+1 -1
View File
@@ -58,7 +58,7 @@ export async function countTokens({ baseUrl, key = '', model = '', text, fetchIm
} catch { return null; }
}
/** The plain sentences (also in the interface catalog in all eight languages). `{0}` slots are filled by the page. */
/** The plain sentences (also in the interface catalog in all nine languages). `{0}` slots are filled by the page. */
export const FIT_TEXT = Object.freeze({
tooLarge: 'This message is about {0} tokens long, and this model can read about {1} at a time. It is too large to send as it is.',
tooLargeNext: 'Attach it as a file for the assistant to read in parts, or send a shortened preview.',
+1 -1
View File
@@ -10,7 +10,7 @@
* rewrites a plan turn wrote its numbered plan from "1." again this many times
* context the context is nearly full: the Harness compaction did not keep up
*
* What the person is told is `guardNote`: fixed English sentences that are also in the interface catalog in all eight languages (the page
* What the person is told is `guardNote`: fixed English sentences that are also in the interface catalog in all nine languages (the page
* translates a `delta` frame that carries `key`). Each says what happened and gives one next step.
*/
+7 -3
View File
@@ -7,6 +7,7 @@ import tune_es from '../locales/tune-es.json';
import tune_ru from '../locales/tune-ru.json';
import tune_pt from '../locales/tune-pt.json';
import tune_ko from '../locales/tune-ko.json';
import tune_fr from '../locales/tune-fr.json';
import tools_en from '../locales/tools-en.json';
import tools_zh from '../locales/tools-zh.json';
import tools_ja from '../locales/tools-ja.json';
@@ -15,6 +16,7 @@ import tools_es from '../locales/tools-es.json';
import tools_ru from '../locales/tools-ru.json';
import tools_pt from '../locales/tools-pt.json';
import tools_ko from '../locales/tools-ko.json';
import tools_fr from '../locales/tools-fr.json';
import fix_en from '../locales/fix-en.json';
import fix_zh from '../locales/fix-zh.json';
import fix_ja from '../locales/fix-ja.json';
@@ -23,6 +25,7 @@ import fix_es from '../locales/fix-es.json';
import fix_ru from '../locales/fix-ru.json';
import fix_pt from '../locales/fix-pt.json';
import fix_ko from '../locales/fix-ko.json';
import fix_fr from '../locales/fix-fr.json';
import base_zh from '../locales/zh.json';
import base_ja from '../locales/ja.json';
import base_de from '../locales/de.json';
@@ -30,15 +33,16 @@ import base_es from '../locales/es.json';
import base_ru from '../locales/ru.json';
import base_pt from '../locales/pt.json';
import base_ko from '../locales/ko.json';
import base_fr from '../locales/fr.json';
export const LANGUAGES=[{value:'en',label:'English'},{value:'zh',label:'中文(简体)'},{value:'ja',label:'日本語'},{value:'de',label:'Deutsch'},{value:'es',label:'Español'},{value:'ru',label:'Русский'},{value:'pt',label:'Português'},{value:'ko',label:'한국어'}] as const;
export const LANGUAGES=[{value:'en',label:'English'},{value:'zh',label:'中文(简体)'},{value:'ja',label:'日本語'},{value:'de',label:'Deutsch'},{value:'fr',label:'Français'},{value:'es',label:'Español'},{value:'ru',label:'Русский'},{value:'pt',label:'Português'},{value:'ko',label:'한국어'}] as const;
export type Language=typeof LANGUAGES[number]['value'];
/* The Tune model dialog's strings live in tune-<lang>.json (apps/host/scripts/make-tune-locales.py) so other interface work does not collide with them. */
/* The tool-server, picture and agent-result strings of the tools and images fixes live in tools-<lang>.json for the same reason. */
/* The strings that had no key in the files above (#3479, #3825) and the 0.2.4.3 fixes live in fix-<lang>.json (scripts/make-fix-locales.py). */
const english:Record<string,string>={...baseEnglish,...tune_en,...tools_en,...fix_en};
const [zh,ja,de,es,ru,pt,ko]=[{...base_zh,...tune_zh,...tools_zh,...fix_zh},{...base_ja,...tune_ja,...tools_ja,...fix_ja},{...base_de,...tune_de,...tools_de,...fix_de},{...base_es,...tune_es,...tools_es,...fix_es},{...base_ru,...tune_ru,...tools_ru,...fix_ru},{...base_pt,...tune_pt,...tools_pt,...fix_pt},{...base_ko,...tune_ko,...tools_ko,...fix_ko}] as Record<string,string>[];
const catalogs:Record<Language,Record<string,string>>={en:english,zh,ja,de,es,ru,pt,ko};
const [zh,ja,de,es,ru,pt,ko,fr]=[{...base_zh,...tune_zh,...tools_zh,...fix_zh},{...base_ja,...tune_ja,...tools_ja,...fix_ja},{...base_de,...tune_de,...tools_de,...fix_de},{...base_es,...tune_es,...tools_es,...fix_es},{...base_ru,...tune_ru,...tools_ru,...fix_ru},{...base_pt,...tune_pt,...tools_pt,...fix_pt},{...base_ko,...tune_ko,...tools_ko,...fix_ko},{...base_fr,...tune_fr,...tools_fr,...fix_fr}] as Record<string,string>[];
const catalogs:Record<Language,Record<string,string>>={en:english,zh,ja,de,fr,es,ru,pt,ko};
const entities:Record<string,string>={amp:'&',lt:'<',gt:'>',quot:'"',apos:"'",nbsp:'\u00a0'};
const decode=(text:string)=>text.replace(/&(#x[\da-f]+|#\d+|amp|lt|gt|quot|apos|nbsp);/gi,(whole,key:string)=>key[0]==='#'?String.fromCodePoint(key[1].toLowerCase()==='x'?parseInt(key.slice(2),16):parseInt(key.slice(1),10)):entities[key]??whole);
const ids=new Map(Object.entries(english).map(([id,value])=>[decode(value),id]));
+81
View File
@@ -0,0 +1,81 @@
{
"fx01": "ne s’exécutera plus et sera retirée.",
"fx02": "Téléchargé, mais pas chargé. Ouvrez Modèles pour le charger.",
"fx03": "{0} lignes ajoutées, {1} supprimées",
"fx04": "{0} fichiers modifiés",
"fx05": "Déposez des fichiers pour les ajouter",
"fx06": "Images et fichiers texte",
"fx07": "Garder l’objectif",
"fx08": "Supprimer l’objectif",
"fx09": "L’assistant cesse de travailler à l’atteindre. Votre conversation et vos fichiers restent comme ils sont.",
"fx10": "Ce modèle peut lire les images, mais le moteur installé ici n’inclut pas encore le lecteur d’images : Lire les images est donc désactivé. Mettez à jour le moteur dans Paramètres → À propos pour l’activer.",
"fx11": "Affichage des valeurs de votre optimisation « {0} ».",
"fx12": "Votre optimisation « {0} » règle",
"fx13": "était {0}",
"fx14": "· {0} de RAM",
"fx15": "Le message n’a pas été annulé",
"fx16": "Réglages supplémentaires pour le programme",
"fx17": "Rédiger avec l’IA",
"fx18": "Temps de réflexion",
"fx19": "Temps de rédaction",
"fx20": "tokens/s",
"fx21": "% du contexte",
"fx22": "Cette page demande des fichiers à internet, que l’aperçu ne charge pas : elle peut donc paraître incomplète. Voir le code montre exactement ce qui a été écrit.",
"fx23": "Garder A",
"fx24": "Garder B",
"fx25": "A pris",
"fx26": "Variante",
"fx27": "Modifié",
"fx28": "Rien",
"fx29": "Les deux versions sont prêtes. Comparez A et B, puis gardez-en une.",
"fx30": "L’assistant répond encore",
"fx31": "Envoyez votre message quand il a terminé.",
"fx32": "Le message n’a pas été mis en file d’attente",
"fx33": "Aller au dernier message",
"fx34": "Retirer la tâche",
"fx35": "Ouvrir une nouvelle conversation ; garder celle-ci",
"fx36": "Faire d’abord rédiger un plan à l’assistant ; rien ne s’exécute tant que vous ne l’avez pas approuvé",
"fx37": "Chercher sur le web, lire les pages et répondre avec des sources",
"fx38": "Copié",
"fx39": "Réponse",
"fx40": "Message",
"fx41": "PDF ajouté",
"fx42": "Sélectionnez le texte et copiez-le avec Ctrl+C.",
"fx43": "{0} est dans cette conversation. Posez une question à son sujet dans votre prochain message.",
"fx44": "Le moteur est prêt.",
"fx45": "Étape suivante : choisir un modèle.",
"fx46": "Téléchargement du moteur",
"fx47": "Vous pouvez fermer Strata ; le téléchargement reprendra là où il s’est arrêté.",
"fx48": "Bienvenue dans Strata",
"fx49": "Examen de votre carte graphique…",
"fx50": "Strata a trouvé votre carte graphique :",
"fx51": "{0} cartes trouvées. Strata utilise la première pour le moteur ; vous pourrez changer cela plus tard dans les Paramètres.",
"fx52": "Strata n’a pas reconnu de carte graphique prise en charge.",
"fx53": "Pour y exécuter des modèles, Strata a besoin d’un téléchargement :",
"fx54": "Le moteur pour cette carte",
"fx55": "Le moteur a besoin d’environ {0} Go d’espace libre sur ce disque et il n’y en a que {1} Go. Libérez de l’espace, puis continuez.",
"fx56": "Il vient du serveur de mise à jour de Strata et il est vérifié avant utilisation. Vos modèles et vos conversations ne sont jamais touchés.",
"fx57": "Strata n’a pas pu joindre github.com. Vérifiez votre connexion et réessayez, ou téléchargez le fichier du moteur sur un autre PC et choisissez-le ici.",
"fx58": "Le moteur installé ici est prévu pour une autre marque de carte graphique.",
"fx59": "Strata ne peut pas choisir de moteur pour ce PC dans sa liste de mises à jour.",
"fx60": "Continuer sans moteur",
"fx61": "Le téléchargement s’est arrêté. Continuer le reprend là où il s’est arrêté.",
"fx62": "C’est un très gros modèle. Le téléchargement fait {0} Go et il faut à peu près autant d’espace disque libre. Il tourne sur une carte graphique de 12 Go avec 46 à 64 Go de RAM, lentement : environ 5 à 7 mots par seconde. Ce qui ne tient pas en mémoire est lu depuis votre SSD, un disque NVMe compte donc beaucoup.",
"fx63": "Vous pouvez arrêter le téléchargement et le continuer plus tard ; il reprend là où il s’est arrêté. Strata vous avertit ici mais ne vous bloque jamais.",
"fx64": "Plus rapide",
"fx65": "Qualité maximale",
"fx66": "Par défaut (Plus rapide sur ce PC)",
"fx67": "Par défaut (Qualité maximale sur ce PC)",
"fx68": "Plus rapide (par défaut sur ce PC)",
"fx69": "Qualité maximale (par défaut sur ce PC)",
"fx70": "Longs prompts plus rapides",
"fx71": "Réponses plus rapides sur Radeon RX 9000 / AI PRO R9700",
"fx72": "Accélérations DeepSeek",
"fx73": "Lit les très longs prompts plus vite en approximant une partie du travail. Désactivé par défaut : les réponses sur de longs documents peuvent manquer ou mélanger des détails.",
"fx74": "Répartit le travail entre la carte graphique et le processeur d’une façon qui accélère les réponses sur ces cartes. Désactivez pour revenir au réglage précédent, plus lent.",
"fx75": "Lit les longs prompts plus vite et charge plus vite les parties du modèle dont il a besoin. Désactivez si DeepSeek cesse de fonctionner ou si ses réponses semblent fausses ; il fonctionne alors comme dans la version 0.2.6.",
"fx76": "Activé (recommandé)",
"fx77": "C’est un très gros modèle. Le téléchargement fait {0} Go et il faut à peu près autant d’espace disque libre. Il tourne sur les cartes NVIDIA RTX 30, 40 et 50, sur une Radeon AI PRO R9700 (Linux) ou sur un PC Ryzen AI Max / Strix Halo (Windows) ; sa vitesse dépend de la mémoire et de la carte (la ligne ci-dessous indique à quoi s’attendre sur cet ordinateur). Ce qui ne tient pas en mémoire est lu depuis votre SSD, un disque NVMe compte donc beaucoup.",
"fx78": "Pas encore testé. Un contexte aussi long prend de la mémoire graphique au modèle et lit lentement les longs prompts.",
"fx79": "Désactivé (recommandé)"
}
File diff suppressed because it is too large. Load diff
+6
View File
@@ -0,0 +1,6 @@
{
"tl01": "Utilisez un nom de serveur simple de 32 caractères maximum : lettres, chiffres, tirets ou tirets bas.",
"tl02": "Ces serveurs d’outils ont été laissés de côté car leurs noms ne sont pas autorisés : {0}. Un nom peut contenir jusqu’à 32 lettres, chiffres, tirets ou tirets bas.",
"tl03": "Ces serveurs d’outils ont été laissés de côté car ils n’ont ni programme ni adresse web : {0}.",
"tl04": "Ces serveurs d’outils ont été laissés de côté car un autre a presque le même nom : {0}."
}
+45
View File
@@ -0,0 +1,45 @@
{
"tune01": "Optimiser ce modèle",
"tune02": "Recherche des réglages les plus rapides pour votre PC…",
"tune03": "environ {0} min restantes",
"tune04": "Cela prend environ 20 minutes.",
"tune05": "Arrêté. Vos réglages n’ont pas été modifiés.",
"tune06": "L’optimisation n’est pas terminée. Vos réglages n’ont pas été modifiés.",
"tune07": "Toujours aussi rapide qu’à l’enregistrement.",
"tune08": "C’est plus lent qu’avant. Vous pouvez optimiser à nouveau.",
"tune09": "Impossible de savoir pour l’instant. Votre optimisation a été conservée.",
"tune10": "Réponses {0} % plus rapides, enregistré sous « {1} »",
"tune11": "Vos réglages actuels sont déjà les plus rapides que nous ayons trouvés.",
"tune12": "Rien n’a été modifié.",
"tune13": "Enregistré sous « {0} », il ne sera donc pas réoptimisé à la réouverture de l’application.",
"tune14": "Vitesse : {0} → {1} tok/s",
"tune15": "Les réponses sont identiques à la configuration standard.",
"tune16": "Les réponses peuvent différer légèrement de la configuration standard.",
"tune17": "Les réponses ne sont pas reproductibles d’une exécution à l’autre.",
"tune18": "Comprend un réglage de qualité qui modifie les chiffres.",
"tune19": "Optimisation enregistrée utilisée : {0}",
"tune20": "Réponses {0} % plus rapides",
"tune21": "Ce PC a changé depuis l’optimisation, ces réglages ne sont donc pas utilisés tant que vous n’optimisez pas à nouveau.",
"tune22": "Ce PC ou le moteur a changé depuis l’optimisation. Une vérification courte prend environ 2 minutes.",
"tune23": "Pas encore d’optimisation enregistrée pour ces choix.",
"tune24": "Strata essaie différents réglages sur ce PC et garde ceux qui accélèrent les réponses. Votre modèle est déchargé pendant ce temps, et l’ordinateur sera occupé.",
"tune25": "Terminez d’abord l’opération en cours.",
"tune26": "Durée à y consacrer",
"tune27": "Rapide (environ 20 minutes)",
"tune28": "Approfondie (jusqu’à 2 heures)",
"tune29": "Ce que vous faites surtout",
"tune30": "Programmation avec de longs prompts",
"tune31": "Autoriser les réglages qui changent très légèrement les réponses (même qualité)",
"tune32": "Optimisations enregistrées",
"tune33": "Utilisée",
"tune34": "Utiliser",
"tune35": "Optimiser à nouveau",
"tune36": "Lancer l’optimisation",
"tune37": "Optimisation de votre modèle",
"tune38": "Les réponses peuvent différer d’une exécution à l’autre sur ce PC même avec la configuration standard ; ce réglage n’y ajoute rien.",
"tune39": "Utilisation de votre optimisation « {0} »",
"tune40": "Désactiver",
"tune41": "Activer",
"tune42": "Votre optimisation est désactivée. Les réglages standard sont utilisés.",
"tune43": "Votre PC était occupé, les mesures n’étaient donc pas fiables. Rien n’a été modifié. Réessayez quand il est au calme."
}
+2 -2
View File
@@ -138,7 +138,7 @@ test('a chat that existed before the agent carries a bounded summary into its fi
test('the browser and the person\'s own tools have plain sentences, translated in every language', async () => {
const { readFileSync } = await import('node:fs');
const catalog = Object.fromEntries(['en', 'de', 'es', 'ja', 'ko', 'pt', 'ru', 'zh'].map(l => [l, JSON.parse(readFileSync(new URL(`../src/locales/${l}.json`, import.meta.url), 'utf8'))]));
const catalog = Object.fromEntries(['en', 'de', 'es', 'fr', 'ja', 'ko', 'pt', 'ru', 'zh'].map(l => [l, JSON.parse(readFileSync(new URL(`../src/locales/${l}.json`, import.meta.url), 'utf8'))]));
const idOf = text => Object.entries(catalog.en).find(([, v]) => v === text)?.[0];
const cases = [
['mcp__browser__browser_navigate', 'Opening a page in the browser', 'Opened a page in the browser', "Couldn't open the page"],
@@ -157,7 +157,7 @@ test('the browser and the person\'s own tools have plain sentences, translated i
];
for (const [name, running, done, failed] of cases) {
assert.equal(toolVerb(name, 'running'), running, name); assert.equal(toolVerb(name, 'done'), done, name); assert.equal(toolVerb(name, 'error'), failed, name);
for (const text of [running, done, failed]) { const id = idOf(text); assert.ok(id, `${text} is in the catalog`); for (const l of ['de', 'es', 'ja', 'ko', 'pt', 'ru', 'zh']) assert.ok(catalog[l][id]?.trim(), `${l}: ${text}`); }
for (const text of [running, done, failed]) { const id = idOf(text); assert.ok(id, `${text} is in the catalog`); for (const l of ['de', 'es', 'fr', 'ja', 'ko', 'pt', 'ru', 'zh']) assert.ok(catalog[l][id]?.trim(), `${l}: ${text}`); }
}
const nav = presentTool({ callId: 'c1', name: 'mcp__browser__browser_navigate', args: { url: 'https://example.com' } });
assert.equal(nav.target, 'https://example.com'); assert.equal(nav.verb, 'Opening a page in the browser');
+2 -2
View File
@@ -154,7 +154,7 @@ test('real Harness: a turn that writes a file says what it is doing, in order, a
test('a sentence with a name or a number also carries its catalog template and values, and every status sentence is in the catalog in every language', async () => {
const { readFileSync } = await import('node:fs');
const catalog = Object.fromEntries(['en', 'de', 'es', 'ja', 'ko', 'pt', 'ru', 'zh'].map(l => [l, JSON.parse(readFileSync(new URL(`../src/locales/${l}.json`, import.meta.url), 'utf8'))]));
const catalog = Object.fromEntries(['en', 'de', 'es', 'fr', 'ja', 'ko', 'pt', 'ru', 'zh'].map(l => [l, JSON.parse(readFileSync(new URL(`../src/locales/${l}.json`, import.meta.url), 'utf8'))]));
const idOf = text => Object.entries(catalog.en).find(([, v]) => v === text)?.[0];
const p = new TurnProjector(); const seen = []; p.onStatus = u => seen.push(u);
p.consume({ type: 'assistant-stream', frame: { type: 'chunk', attemptId: 'a', chunk: { type: 'tool-call-delta', index: 0, id: 'c', name: 'write', argumentsDelta: '{"file_path":"/w/pagoda.html","content":"' + 'x'.repeat(4000) } } });
@@ -163,7 +163,7 @@ test('a sentence with a name or a number also carries its catalog template and v
const keys = ['Starting the assistant…', 'Starting…', 'Reading your message…', 'Working out the next step…', 'Thinking… {0} tokens', 'Writing the answer…', 'Waiting for your answer…', 'Helpers are working ({0})…', 'Working on the goal…',
'Writing {0}…', 'Writing a file…', 'Writing {0}… ({1} KB)', 'Writing a file… ({0} KB)', 'Changing {0}…', 'Changing a file…', 'Reading {0}…', 'Reading a file…', 'Running a command…', 'Searching your files…', 'Searching the web…',
'Opening {0}…', 'Opening a web page…', 'Using the browser…', 'Setting the goal…', 'Updating the goal…', 'Checking the goal…', 'Using a tool…', 'Reading your files…', 'Trying an improved version…', 'Checking the result…', 'Comparing the two versions…'];
for (const key of keys) { const id = idOf(key); assert.ok(id, `${key} is in the catalog`); for (const l of ['de', 'es', 'ja', 'ko', 'pt', 'ru', 'zh']) { assert.ok(catalog[l][id]?.trim(), `${l}: ${key}`); assert.deepEqual((catalog[l][id].match(/\{\d\}/g) ?? []).sort(), (key.match(/\{\d\}/g) ?? []).sort(), `${l} keeps the slots of ${key}`); } }
for (const key of keys) { const id = idOf(key); assert.ok(id, `${key} is in the catalog`); for (const l of ['de', 'es', 'fr', 'ja', 'ko', 'pt', 'ru', 'zh']) { assert.ok(catalog[l][id]?.trim(), `${l}: ${key}`); assert.deepEqual((catalog[l][id].match(/\{\d\}/g) ?? []).sort(), (key.match(/\{\d\}/g) ?? []).sort(), `${l} keeps the slots of ${key}`); } }
});
test('a goal step is always sent, even right after another status (it used to be swallowed by the 300 ms gap, which made a test flaky)', () => {
+2 -2
View File
@@ -74,8 +74,8 @@ test('a turn that ends with no words always gets a plain message: out of room, o
assert.equal(g.silent({ ended: done, wrote: false, contextTokens: 9700, stoppedByPerson: true }), null, 'Stop is the person\'s own');
});
test('every message is a plain sentence with a next step, carries its interface key, and is in the catalog in all eight languages', () => {
const langs = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko'];
test('every message is a plain sentence with a next step, carries its interface key, and is in the catalog in all nine languages', () => {
const langs = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko', 'fr'];
const catalogs = Object.fromEntries(langs.map(l => [l, JSON.parse(readFileSync(new URL(`../src/locales/${l}.json`, import.meta.url), 'utf8'))]));
const idOf = text => Object.entries(catalogs.en).find(([, v]) => v === text)?.[0];
for (const [reason, text] of Object.entries(GUARD_NOTES)) {
+1 -1
View File
@@ -5,7 +5,7 @@ import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
const root = resolve(import.meta.dirname, '..');
const languages = ['en', 'de', 'es', 'ja', 'ko', 'pt', 'ru', 'zh'];
const languages = ['en', 'de', 'es', 'fr', 'ja', 'ko', 'pt', 'ru', 'zh'];
const catalog = Object.fromEntries(languages.map(l => [l, JSON.parse(readFileSync(resolve(root, 'src/locales', `${l}.json`), 'utf8'))]));
const idOf = text => Object.entries(catalog.en).find(([, v]) => v === text)?.[0];
+3 -3
View File
@@ -1,5 +1,5 @@
// The page side of the context fixes (2026-10-22 hands-on test): what the error card offers, what the context meter reads while a turn runs,
// and that every sentence the host or the page says about the context is in the catalog in all eight languages.
// and that every sentence the host or the page says about the context is in the catalog in all nine languages.
import test from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
@@ -99,8 +99,8 @@ test('the context meter follows the turn that is running: a tool step does not r
assert.equal(chatMetrics(session([earlier, done]), null, 65536).used, 43090, 'when the turn has ended its final figure stands');
});
test('every sentence about the context is in the catalog in all eight languages, with the same slots', () => {
const langs = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko'];
test('every sentence about the context is in the catalog in all nine languages, with the same slots', () => {
const langs = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko', 'fr'];
const catalogs = Object.fromEntries(langs.map(l => [l, JSON.parse(read(`../src/locales/${l}.json`))]));
const idOf = text => Object.entries(catalogs.en).find(([, v]) => v === text)?.[0];
const sentences = [...Object.values(FIT_TEXT), 'Attach as a file', 'Send a shortened preview', 'Summarize and continue', 'Start a new chat',
+2 -2
View File
@@ -4,9 +4,9 @@ import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import { expertParams } from '../server/catalog.mjs';
const languages = ['en', 'de', 'es', 'ja', 'ko', 'pt', 'ru', 'zh'];
const languages = ['en', 'de', 'es', 'fr', 'ja', 'ko', 'pt', 'ru', 'zh'];
test('the CORS setting explains itself and the explanation exists in all 8 languages', async () => {
test('the CORS setting explains itself and the explanation exists in all 9 languages', async () => {
const cors = expertParams().find(p => p.id === 'server.cors');
assert.match(cors.effect, /does nothing in the app/);
assert.match(cors.effect, /"cors_origins"/);
+2 -2
View File
@@ -87,12 +87,12 @@ test('the Models screen honours the choice (it no longer forces 8K), offers the
assert.match(screen, /installed\?\.ready && context === installed\.context/, 'a load at the prepared context starts from the saved file; only a changed choice runs setup again');
});
test('the note is in the catalog in all eight languages, translated', () => {
test('the note is in the catalog in all nine languages, translated', () => {
const find = lang => Object.values(JSON.parse(read(`../src/locales/fix-${lang}.json`)));
assert.ok(find('en').includes(UNTESTED_NOTE));
const en = JSON.parse(read('../src/locales/fix-en.json'));
const id = Object.keys(en).find(k => en[k] === UNTESTED_NOTE);
for (const lang of ['zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko']) {
for (const lang of ['zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko', 'fr']) {
const text = JSON.parse(read(`../src/locales/fix-${lang}.json`))[id];
assert.ok(text && text !== UNTESTED_NOTE, `${lang} is translated`);
}
+3 -3
View File
@@ -1,5 +1,5 @@
// The Drafting choice in the app (MTP / DFlash2 / Off / Auto): the Models screen row, the setting the host saves, what the host asks Control before
// a load, the download plan line, and the words in all eight languages. The table of which card gets which drafter lives in Python
// a load, the download plan line, and the words in all nine languages. The table of which card gets which drafter lives in Python
// (strata_control/drafting.py, tests/terminal/test_drafting.py); the app never reads it.
import test from 'node:test';
import assert from 'node:assert/strict';
@@ -77,8 +77,8 @@ test('a load fetches the drafter first, never stops for it, and says what ran',
assert.match(source, /drafting:cfg\.drafting\?\?'auto'/, 'the installed model reports its saved choice');
});
test('every sentence of the Drafting choice is in the catalog in all eight languages, with the same slots', () => {
const langs = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko'];
test('every sentence of the Drafting choice is in the catalog in all nine languages, with the same slots', () => {
const langs = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko', 'fr'];
const catalogs = Object.fromEntries(langs.map(l => [l, JSON.parse(read(`../src/locales/${l}.json`))]));
const idOf = text => Object.entries(catalogs.en).find(([, v]) => v === text)?.[0];
const sentences = ['Drafting', 'Auto (recommended)', 'MTP', 'DFlash2',
+60
View File
@@ -0,0 +1,60 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import { build } from 'esbuild';
// French (#3970): the catalogs are complete (the generic language tests cover keys and placeholders); these tests cover
// what is specific to French: spacing before ? ! : ;, apostrophes, short labels staying short, and the picker entry.
const names = [['en', 'fr'], ['fix-en', 'fix-fr'], ['tune-en', 'tune-fr'], ['tools-en', 'tools-fr']];
const read = async name => JSON.parse(await readFile(`src/locales/${name}.json`, 'utf8'));
const compiled = await build({ stdin: { contents: "export * from './src/lib/i18n';", resolveDir: process.cwd() }, bundle: true, write: false, format: 'esm', platform: 'node', loader: { '.json': 'json' } });
const { tr, setTranslationLanguage, localeTag, currentLanguage, LANGUAGES, validLanguage } = await import(`data:text/javascript;base64,${Buffer.from(compiled.outputFiles[0].text).toString('base64')}`);
test('French is in the language picker under its own name', () => {
const entry = LANGUAGES.find(item => item.value === 'fr');
assert.equal(entry?.label, 'Français');
assert.ok(validLanguage('fr'));
assert.equal(LANGUAGES.length, 9);
setTranslationLanguage('fr');
assert.equal(currentLanguage(), 'fr');
assert.equal(localeTag(), 'fr');
assert.equal(tr('Settings'), 'Paramètres');
assert.equal(tr('Cancel'), 'Annuler');
assert.equal(tr('Open {0}', ['Modèles']).includes('{'), false);
assert.equal(tr('unrecognized user content Ω'), 'unrecognized user content Ω');
setTranslationLanguage('en');
});
test('French text keeps the French typography: a no-break space before ? ! : ; and a typographic apostrophe', async () => {
const bad = [];
for (const [englishName, frenchName] of names) {
const english = await read(englishName), french = await read(frenchName);
for (const [id, text] of Object.entries(french)) {
if (text === english[id]) continue; // kept as is: names, file names, class names
if (/[A-Za-zÀ-ÿ\)\]\d%] [?!;:]/.test(text) && !/https?:|\d:\d/.test(text)) bad.push(`${id}: ordinary space before punctuation: ${text}`);
if (/[A-Za-zÀ-ÿ\)\]\d%][?!;]/.test(text)) bad.push(`${id}: no space before ? ! or ;: ${text}`);
if (/[A-Za-zÀ-ÿ]'[A-Za-zÀ-ÿ{]/.test(text)) bad.push(`${id}: straight apostrophe: ${text}`);
}
}
assert.deepEqual(bad, []);
});
test('short labels stay short in French (buttons, tabs, chips)', async () => {
const english = await read('en'), french = await read('fr');
const long = [];
for (const [id, text] of Object.entries(english)) {
if (text.length > 10 || french[id] === text || /\{\d+\}/.test(text)) continue;
// a label of up to 10 letters may take up to 3 times the room, and never more than 36 characters
if (french[id].length > Math.max(18, text.length * 3.2) || french[id].length > 36) long.push(`${id}: ${text} -> ${french[id]} (${french[id].length})`);
}
assert.deepEqual(long, []);
});
test('no French string is still English by accident: at most 5% of the main catalog is left unchanged', async () => {
const english = await read('en'), french = await read('fr');
const same = Object.keys(english).filter(id => english[id] === french[id]);
assert.ok(same.length < Object.keys(english).length * 0.05, `${same.length} unchanged`);
// every unchanged string has no real words in it, or is a name that is spelled the same in French
const words = same.filter(id => english[id].split(/\s+/).length >= 4 && /\s(the|your|you|is|are|this|that|with|from|and)\s/i.test(english[id]) && !/^[-/\\]/.test(english[id]));
assert.deepEqual(words.map(id => `${id}: ${english[id]}`), []);
});
@@ -2,7 +2,7 @@ import {test} from 'node:test';
import assert from 'node:assert/strict';
import {readFile} from 'node:fs/promises';
import {build} from 'esbuild';
const languages=['en','zh','ja','de','es','ru','pt','ko'];
const languages=['en','zh','ja','de','es','ru','pt','ko','fr'];
const catalogs=Object.fromEntries(await Promise.all(languages.map(async language=>[language,JSON.parse(await readFile(`src/locales/${language}.json`,'utf8'))])));
const english=catalogs.en;
const slots=text=>[...text.matchAll(/\{\d+\}/g)].map(match=>match[0]).sort();
+2 -2
View File
@@ -5,7 +5,7 @@ import { readdir, readFile } from 'node:fs/promises';
import { join } from 'node:path';
import { build } from 'esbuild';
const languages = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko'];
const languages = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko', 'fr'];
const read = async name => JSON.parse(await readFile(`src/locales/${name}.json`, 'utf8'));
const built = await build({ stdin: { contents: "export * from './src/lib/i18n';", resolveDir: process.cwd() }, bundle: true, write: false, format: 'esm', platform: 'node', loader: { '.json': 'json' } });
const { tr, setTranslationLanguage } = await import(`data:text/javascript;base64,${Buffer.from(built.outputFiles[0].text).toString('base64')}`);
@@ -38,7 +38,7 @@ test('every tr("...") literal and every command hint has a key in the English ca
assert.deepEqual(missing, []);
});
test('the fix catalogs have the same keys and placeholders in all eight languages', async () => {
test('the fix catalogs have the same keys and placeholders in all nine languages', async () => {
const en = await read('fix-en');
for (const language of languages) {
const catalog = await read(`fix-${language}`);
+1 -1
View File
@@ -53,7 +53,7 @@ test('the notices name the servers, one sentence per reason, in the catalog word
assert.notEqual(notices[0].code, notices[1].code);
assert.deepEqual(mcpSkippedNotices([]), []);
// every sentence is in the catalog of every language (src/locales/tools-<lang>.json)
for (const lang of ['en', 'de', 'es', 'pt', 'ru', 'ja', 'ko', 'zh']) {
for (const lang of ['en', 'de', 'es', 'pt', 'ru', 'ja', 'ko', 'fr', 'zh']) {
const catalog = JSON.parse(await readFile(new URL(`../src/locales/tools-${lang}.json`, import.meta.url), 'utf8'));
const english = JSON.parse(await readFile(new URL('../src/locales/tools-en.json', import.meta.url), 'utf8'));
for (const text of ['These tool servers were left out because their names are not allowed: {0}. A name can have up to 32 letters, numbers, hyphens or underscores.',
+2 -2
View File
@@ -202,12 +202,12 @@ test('the Control command lines for status, resume and leave', async () => {
assert.deepEqual(seen[2], ['models', 'move', '--leave', '--from', '/o', '--install-dir', '/i', '--output', 'json']);
});
test('the models folder strings exist in all 8 languages with the same placeholders', () => {
test('the models folder strings exist in all 9 languages with the same placeholders', () => {
const read = lang => JSON.parse(readFileSync(new URL(`../src/locales/${lang}.json`, import.meta.url), 'utf8'));
const en = read('en');
const ours = Object.keys(en).filter(k => Number(k.slice(1)) >= 8339 && Number(k.slice(1)) <= 8422);
assert.equal(ours.length, 84);
for (const lang of ['de', 'es', 'ja', 'ko', 'pt', 'ru', 'zh']) {
for (const lang of ['de', 'es', 'fr', 'ja', 'ko', 'pt', 'ru', 'zh']) {
const text = read(lang);
for (const key of ours) {
assert.ok(text[key], `${lang} ${key}`);
+2 -2
View File
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import { build } from 'esbuild';
const languages = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko'];
const languages = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko', 'fr'];
const catalogs = Object.fromEntries(await Promise.all(languages.map(async l => [l, JSON.parse(await readFile(`src/locales/${l}.json`, 'utf8'))])));
const built = await build({ stdin: { contents: "export * from './src/lib/plain-errors'; export * from './src/lib/i18n';", resolveDir: process.cwd() }, bundle: true, write: false, format: 'esm', platform: 'node', loader: { '.json': 'json' } });
const { plainFailure, plainFailureText, setTranslationLanguage } = await import(`data:text/javascript;base64,${Buffer.from(built.outputFiles[0].text).toString('base64')}`);
@@ -57,7 +57,7 @@ test('an ordinary sentence is left as it is and gets no Details', () => {
assert.equal(f.detail, undefined);
});
test('every plain message and next step is translated in all eight languages', () => {
test('every plain message and next step is translated in all nine languages', () => {
const en = catalogs.en;
const ids = Object.fromEntries(Object.entries(en).map(([id, text]) => [text, id]));
for (const [raw] of cases) {
+1 -1
View File
@@ -115,7 +115,7 @@ test('the three NVFP4 versions have clear names and one line that tells them apa
assert.match(lines[2], /faster on short prompts/);
assert.equal(lib.versionNote('IQ3_S'), '');
assert.equal(lib.nativeShortName('nvfp4-nvfp4-nvidia'), 'NVFP4 (NVIDIA’s version)');
for (const language of ['zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko']) {
for (const language of ['zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko', 'fr']) {
lib.setTranslationLanguage(language);
const local = ['NVFP4', 'NVFP4-NVIDIA', 'NVFP4-QAD'].map(m => lib.nativeVersionLabel(m));
assert.equal(new Set(local).size, 3, `${language}: three different names`);
+1 -1
View File
@@ -25,7 +25,7 @@ test('Markdown renders every incomplete stream prefix without looping', { timeou
const mod = { exports: {} };
new Function('require', 'module', 'exports', bundle.outputFiles[0].text)(createRequire(import.meta.url), mod, mod.exports);
const { render, setLanguage } = mod.exports;
for(const language of ['zh','ja','de','es','ru','pt','ko']) { setLanguage(language); const markup=render('Ready\n\n**Settings**\n\n*Download*\n\n[Cancel](https://example.com)\n\n| Name | Value |\n| --- | --- |\n| Close | Language |'); for(const word of ['Ready','Settings','Download','Cancel','Name','Value','Close','Language'])assert(markup.includes(word),language+': user text changed: '+word); }
for(const language of ['zh','ja','de','es','ru','pt','ko','fr']) { setLanguage(language); const markup=render('Ready\n\n**Settings**\n\n*Download*\n\n[Cancel](https://example.com)\n\n| Name | Value |\n| --- | --- |\n| Close | Language |'); for(const word of ['Ready','Settings','Download','Cancel','Name','Value','Close','Language'])assert(markup.includes(word),language+': user text changed: '+word); }
setLanguage('en');
for (const marker of ['- ', '* ', '+ ', '1. ', '2) ', ' - ', ' 12. ']) assert.ok(render(marker).includes(marker));
const text = '# Answer\n\n- First item\n- Second item\n\n1. First step\n2. Second step\n\n```js\nconsole.log("hello");\n```\n\n| Name | Value |\n| --- | --- |\n| One | Two |';
+2 -2
View File
@@ -91,8 +91,8 @@ test('the text editor: Notepad on Windows, text mode on a Mac, the system text-f
assert.deepEqual(seen, [['xdg-open', '/s/strata-q.json']], 'with no text editor known the file’s own program opens it');
});
test('every issue sentence exists in all eight languages and keeps its slots', async () => {
const languages = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko'];
test('every issue sentence exists in all nine languages and keeps its slots', async () => {
const languages = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko', 'fr'];
const compiled = await build({ stdin: { contents: "export * from './src/lib/run-config-issues'; export * from './src/lib/i18n';", resolveDir: process.cwd() }, bundle: true, write: false, platform: 'node', format: 'esm' });
const { issueText, setTranslationLanguage } = await import(`data:text/javascript;base64,${Buffer.from(compiled.outputFiles[0].text).toString('base64')}`);
const samples = [
+2 -2
View File
@@ -186,13 +186,13 @@ test('through the host: a Qwen model on a PC the engine cannot speed up offers n
} finally { await f.cleanup(); }
});
test('the Expert settings show the rows in the existing row layout with an On / Off choice (Off recommended for KVA), and the words are in all eight languages', () => {
test('the Expert settings show the rows in the existing row layout with an On / Off choice (Off recommended for KVA), and the words are in all nine languages', () => {
const screen = read('../src/components/NativeSettings.tsx');
assert.match(screen, /<h3 className="h4">\{tr\("Speed"\)\}<\/h3>/);
assert.match(screen, /<label className="native-setting-row" key=\{sw\.id\}><span><strong>\{tr\(sw\.label\)\}<\/strong><small>\{tr\(sw\.hint\)\}<\/small><\/span><Select /, 'the same row, the same Select');
assert.match(screen, /\[\{ value: 'on', label: 'On \(recommended\)' \}, \{ value: 'off', label: 'Off' \}\] : \[\{ value: 'off', label: 'Off \(recommended\)' \}, \{ value: 'on', label: 'On' \}\]/);
assert.match(screen, /if \(write\) env\[name\] = value; else delete env\[name\];/, 'the default removes the entries');
const languages = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko'];
const languages = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko', 'fr'];
const catalog = lang => JSON.parse(read(`../src/locales/fix-${lang}.json`));
const words = [...SPEED_SWITCHES.flatMap(s => [s.label, s.hint]), 'On (recommended)', 'Off (recommended)'];
const english = Object.values(catalog('en'));
+1 -1
View File
@@ -5,7 +5,7 @@ import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import { build } from 'esbuild';
const languages = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko'];
const languages = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko', 'fr'];
const catalogs = Object.fromEntries(await Promise.all(languages.map(async l => [l, JSON.parse(await readFile(`src/locales/tools-${l}.json`, 'utf8'))])));
const main = JSON.parse(await readFile('src/locales/en.json', 'utf8'));
const tune = JSON.parse(await readFile('src/locales/tune-en.json', 'utf8'));
+1 -1
View File
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import { build } from 'esbuild';
const languages = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko'];
const languages = ['en', 'zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko', 'fr'];
const catalogs = Object.fromEntries(await Promise.all(languages.map(async l => [l, JSON.parse(await readFile(`src/locales/tune-${l}.json`, 'utf8'))])));
const main = JSON.parse(await readFile('src/locales/en.json', 'utf8'));
const slots = text => [...text.matchAll(/\{\d+\}/g)].map(m => m[0]).sort();
+2 -2
View File
@@ -162,13 +162,13 @@ test('the profile names the search service in the gate\'s question, and carries
// ---------------------------------------------------------------------------------------------- the words, in every language
test('the card text and the Settings switch exist in all eight languages', async () => {
test('the card text and the Settings switch exist in all nine languages', async () => {
const compiled = await build({ stdin: { contents: "export * from './src/lib/i18n';", resolveDir: process.cwd() }, bundle: true, write: false, platform: 'node', format: 'esm' });
const { tr, setTranslationLanguage } = await import(`data:text/javascript;base64,${Buffer.from(compiled.outputFiles[0].text).toString('base64')}`);
const search = manualDecision(SEARCH, { provider: 'DuckDuckGo, or Bing when DuckDuckGo is busy' }).reason;
const open = manualDecision(FETCH).reason;
const english = [search, open, 'Let the assistant search the web without asking'];
for (const language of ['zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko']) {
for (const language of ['zh', 'ja', 'de', 'es', 'ru', 'pt', 'ko', 'fr']) {
setTranslationLanguage(language);
for (const text of english) assert.notEqual(tr(text), text, `${language}: ${text}`);
const translated = tr(search);
+1 -1
View File
@@ -238,7 +238,7 @@ class WhatTheEngineSaid(unittest.TestCase):
class WordsMatchTheApp(unittest.TestCase):
def test_every_line_the_engine_start_can_say_is_in_the_apps_catalog_in_all_eight_languages(self):
folder = ROOT / "apps" / "host" / "src" / "locales"
catalogs = {l: json.loads((folder / f"{l}.json").read_text(encoding="utf-8")) for l in ("en", "de", "es", "ja", "ko", "pt", "ru", "zh")}
catalogs = {l: json.loads((folder / f"{l}.json").read_text(encoding="utf-8")) for l in ("en", "de", "es", "fr", "ja", "ko", "pt", "ru", "zh")}
ids = {v: k for k, v in catalogs["en"].items()}
self.assertEqual(len(drafting.REASONS), 4)
for reason in drafting.REASONS: