Локализовать интерфейс SHiNE на русский и английский

This commit is contained in:
AidarKC
2026-11-09 16:45:21 +03:00
parent 526941eb33
commit 405b9a91a7
133 changed files with 12464 additions and 3296 deletions
+10
View File
@@ -0,0 +1,10 @@
import { readFileSync } from 'node:fs';
const russian = JSON.parse(readFileSync(new URL('../js/i18n/locales/ru.json', import.meta.url), 'utf8'));
export function expandRussian(source) {
return source.replace(/t\('([a-z0-9_.]+)'\)/gu, (call, key) => {
const value = key.split('.').reduce((node, part) => node?.[part], russian);
return typeof value === 'string' ? JSON.stringify(value) : call;
});
}