Skip to content
Open
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
3 changes: 3 additions & 0 deletions frontend/src/components/LanguagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export default function LanguagePicker({
onChangeLang: (lang: string) => void;
}) {
// Filter to only show valid language codes (2-letter ISO codes or locale format like en-GB)
// Special exception for en-layperson
const validLanguages = ontology.getLanguages().filter((lang) => {
if (lang === 'en-layperson') return true;
const countryCode = lang.split('-').pop() || lang;
return /^[a-zA-Z]{2}$/.test(countryCode);
});
Expand Down Expand Up @@ -47,6 +49,7 @@ function getEmoji(lang: string) {
en: "en-GB",
cs: "cs-CZ",
zh: "zh-CN",
"en-layperson": "en-GB",
};

const code = specialCases[lang] || lang;
Expand Down
Loading