Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dashboard/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ export function Layout({ onLogout, userRole }: LayoutProps) {
const next = supportedLanguages[(idx + 1) % supportedLanguages.length];
void i18n.changeLanguage(next);
};
const languageLabel = currentLang === 'he' ? 'עברית' : 'EN';
const languageLabels: Record<SupportedLanguage, string> = {
en: 'EN',
he: 'עברית',
zh: '中文',
};
const languageLabel = languageLabels[currentLang] ?? 'EN';
const isRtl = currentLang === 'he';

return (
Expand Down
4 changes: 3 additions & 1 deletion dashboard/src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { initReactI18next } from 'react-i18next';
import LanguageDetector from 'i18next-browser-languagedetector';
import en from './locales/en.json';
import he from './locales/he.json';
import zh from './locales/zh.json';

export const supportedLanguages = ['en', 'he'] as const;
export const supportedLanguages = ['en', 'he', 'zh'] as const;
export type SupportedLanguage = (typeof supportedLanguages)[number];

export const rtlLanguages: SupportedLanguage[] = ['he'];
Expand All @@ -16,6 +17,7 @@ void i18n
resources: {
en: { translation: en },
he: { translation: he },
zh: { translation: zh },
},
fallbackLng: 'en',
supportedLngs: supportedLanguages as unknown as string[],
Expand Down
1 change: 1 addition & 0 deletions dashboard/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"language": "Language",
"english": "English",
"hebrew": "עברית",
"chinese": "中文",
"back": "Back",
"next": "Next",
"previous": "Previous",
Expand Down
Loading