[glm-grade=B+] feat(i18n): complete card/filter/action translation keys for 31 languages
Full language display names + RTL set (ar/fa/ur) on /i18n/languages; card.internet/auth/tailscale/dashca, status pills, filter bar and batch-operation strings added to every language dictionary. Frontend: English now loads the server dictionary too (keys are semantic ids, not fallback copy), failed loads keep existing DOM text instead of exposing raw keys, isLoaded() gate for pre-load renders. Rebuilt status/dist. Tests: i18n-cards 9/9, full suite 1837/1837.
This commit is contained in:
@@ -24,13 +24,29 @@ describe('DC-077: i18n Routes', () => {
|
||||
expect(res.body.default).toBe('en');
|
||||
});
|
||||
|
||||
it('GET /i18n/languages includes RTL flag for Arabic', async () => {
|
||||
it('GET /i18n/languages marks Arabic, Persian, and Urdu as RTL', async () => {
|
||||
const app = createI18nApp();
|
||||
const res = await request(app).get('/api/v1/i18n/languages');
|
||||
|
||||
const arabic = res.body.languages.find(l => l.code === 'ar');
|
||||
expect(arabic).toBeTruthy();
|
||||
expect(arabic.rtl).toBe(true);
|
||||
const rtl = (code) => {
|
||||
const entry = res.body.languages.find(l => l.code === code);
|
||||
expect(entry).toBeTruthy();
|
||||
expect(entry.name).not.toBe(code);
|
||||
return entry.rtl;
|
||||
};
|
||||
expect(rtl('ar')).toBe(true);
|
||||
expect(rtl('fa')).toBe(true);
|
||||
expect(rtl('ur')).toBe(true);
|
||||
const english = res.body.languages.find(l => l.code === 'en');
|
||||
expect(english.rtl).toBe(false);
|
||||
});
|
||||
|
||||
it('GET /i18n/translations/fa returns Persian strings, not raw English', async () => {
|
||||
const app = createI18nApp();
|
||||
const res = await request(app).get('/api/v1/i18n/translations/fa');
|
||||
expect(res.status).toBe(200);
|
||||
expect(res.body.translations['action.open']).not.toBe('Open');
|
||||
expect(res.body.translations['filter.online']).not.toBe('Online');
|
||||
});
|
||||
|
||||
it('GET /i18n/translations/en returns English translations', async () => {
|
||||
|
||||
Reference in New Issue
Block a user