Snapshot of uncommitted work: landing, bots, prod infra, partner cabinet, backoffice stage 1

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
zabudko-ruandClaude Opus 5.5 committed 2026-10-21 01:23:32 +04:00
1 parent 45d7512d2b
commit d452824c62
314 files changed
+44394 -121

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
/**
* Выгрузка для носителей языка: i18n-review/<lang>.csv
* key, ru, translation, status, approved
* Носитель правит колонку translation и ставит "yes" в approved, затем: pnpm i18n:import <файл>.
*
* pnpm i18n:export — все языки, только needs_review
* pnpm i18n:export -- --all — все ключи
*/
import { mkdirSync, writeFileSync } from 'node:fs';
import path from 'node:path';
import { csvEscape, readLocale, readReview, ROOT, statusOf, TARGETS } from './lib.ts';
const all = process.argv.includes('--all');
const ru = readLocale('ru');
const review = readReview();
const outDir = path.resolve(ROOT, '../../i18n-review');
mkdirSync(outDir, { recursive: true });
for (const locale of TARGETS) {
const msgs = readLocale(locale);
const rows = [['key', 'ru', 'translation', 'status', 'approved']];
for (const [key, source] of Object.entries(ru)) {
const status = statusOf(review, locale, key, source, msgs[key]);
if (!all && status === 'approved') continue;
rows.push([key, source, msgs[key] ?? '', status, '']);
}
const file = path.join(outDir, `${locale}.csv`);
// BOM — чтобы Excel открыл UTF-8 с армянским и китайским
writeFileSync(file, '' + rows.map((r) => r.map(csvEscape).join(',')).join('\n') + '\n');
console.log(`${file}: ${rows.length - 1} строк`);
}