fix(i18n): add message keys for viewer, transcribe, and layout controls
Adds 7 Paraglide keys (viewer_previous_page, viewer_next_page, viewer_zoom_out, viewer_zoom_in, transcribe_mark_for_training, layout_menu_open, layout_menu_close) to de/en/es.json. Adds messages.spec.ts to enforce key parity across all three locales. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
43
frontend/src/lib/messages.spec.ts
Normal file
43
frontend/src/lib/messages.spec.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import de from '../../messages/de.json';
|
||||
import en from '../../messages/en.json';
|
||||
import es from '../../messages/es.json';
|
||||
|
||||
describe('message key parity', () => {
|
||||
it('de, en, and es have identical key sets', () => {
|
||||
const deKeys = Object.keys(de).sort();
|
||||
const enKeys = Object.keys(en).sort();
|
||||
const esKeys = Object.keys(es).sort();
|
||||
expect(enKeys).toEqual(deKeys);
|
||||
expect(esKeys).toEqual(deKeys);
|
||||
});
|
||||
|
||||
it('viewer navigation keys are present in all locales', () => {
|
||||
const requiredViewerKeys = [
|
||||
'viewer_previous_page',
|
||||
'viewer_next_page',
|
||||
'viewer_zoom_out',
|
||||
'viewer_zoom_in'
|
||||
];
|
||||
for (const key of requiredViewerKeys) {
|
||||
expect(de, `missing key in de: ${key}`).toHaveProperty(key);
|
||||
expect(en, `missing key in en: ${key}`).toHaveProperty(key);
|
||||
expect(es, `missing key in es: ${key}`).toHaveProperty(key);
|
||||
}
|
||||
});
|
||||
|
||||
it('transcribe mark-for-training key is present in all locales', () => {
|
||||
expect(de).toHaveProperty('transcribe_mark_for_training');
|
||||
expect(en).toHaveProperty('transcribe_mark_for_training');
|
||||
expect(es).toHaveProperty('transcribe_mark_for_training');
|
||||
});
|
||||
|
||||
it('layout menu open/close keys are present in all locales', () => {
|
||||
expect(de).toHaveProperty('layout_menu_open');
|
||||
expect(de).toHaveProperty('layout_menu_close');
|
||||
expect(en).toHaveProperty('layout_menu_open');
|
||||
expect(en).toHaveProperty('layout_menu_close');
|
||||
expect(es).toHaveProperty('layout_menu_open');
|
||||
expect(es).toHaveProperty('layout_menu_close');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user