fix(i18n): use English runtime text and localize system UI

This commit is contained in:
Arthur Koba
2026-10-25 19:44:15 +03:00
parent ada0550571
commit 65a96670d5
289 changed files with 8092 additions and 3426 deletions
+17
View File
@@ -0,0 +1,17 @@
import { afterEach, describe, expect, it } from 'vitest';
import { formatDateTime, getFormattingLocale } from './format';
afterEach(() => {
document.documentElement.lang = '';
});
describe('locale-aware formatting', () => {
it('uses the rendered language for dates and preserves invalid input', () => {
document.documentElement.lang = 'en';
expect(getFormattingLocale()).toBe('en');
expect(formatDateTime('2026-01-15T00:00:00Z')).toContain('01/15/2026');
document.documentElement.lang = 'zh-CN';
expect(formatDateTime('2026-01-15T00:00:00Z')).toContain('2026/01/15');
expect(formatDateTime('自定义文本')).toBe('自定义文本');
});
});