mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-11-16 23:04:24 +08:00
feat(i18n): add Russian UI and harden localization
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it } from 'vitest';
|
||||
import { formatDateTime, getFormattingLocale } from './format';
|
||||
import { formatDateTime, formatNumber, getFormattingLocale } from './format';
|
||||
|
||||
afterEach(() => {
|
||||
document.documentElement.lang = '';
|
||||
@@ -12,6 +12,11 @@ describe('locale-aware formatting', () => {
|
||||
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');
|
||||
document.documentElement.lang = 'ru';
|
||||
expect(formatDateTime('2026-01-15T00:00:00Z')).toContain('15.01.2026');
|
||||
expect(formatNumber(1234.5)).toBe(
|
||||
new Intl.NumberFormat('ru-RU').format(1234.5),
|
||||
);
|
||||
expect(formatDateTime('自定义文本')).toBe('自定义文本');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user