Skip to content

Commit 519a644

Browse files
committed
einfache sprache behind feature flag
1 parent ff982bc commit 519a644

2 files changed

Lines changed: 22 additions & 9 deletions

File tree

src/ui/language/useTranslation.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
import { useCallback } from 'react';
22
import { useLanguageStore } from '@/ui/storage/useLanguageStore';
33
import translations from './translations';
4+
import featureFlags from "@/featureFlags";
45

5-
export const LANG_OPTIONS = [
6+
const LANG_OPTIONS_RAW = [
67
{ code: "de", short: "DE", label: "Deutsch", icon: `${process.env.PUBLIC_URL}/assets/images/country-flags/german.svg`},
78
{ code: "de_es", short: "DE+E", label: "Einfache Sprache", icon: `${process.env.PUBLIC_URL}/assets/images/country-flags/german.svg` },
89
// { code: "de_ls", short: "DE+L", label: "Deutsch (Leichte Sprache)" },
910
{ code: "en", short: "EN", label: "English", icon: `${process.env.PUBLIC_URL}/assets/images/country-flags/english.svg`},
1011
];
1112

13+
export const LANG_OPTIONS = featureFlags.bielefunke
14+
? LANG_OPTIONS_RAW
15+
: LANG_OPTIONS_RAW.filter(opt => opt.code !== "de_es");
16+
1217
export const pickLang = (obj, lang, fallback) => {
1318
if (!obj || typeof obj !== "object") return fallback;
1419
if (obj[lang] !== undefined) return obj[lang];

src/ui/shared-components/LanguageDropdown.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { Select, MenuItem, Typography } from "@mui/material";
2+
import { Select, MenuItem, Typography, Box } from "@mui/material";
33
import { HBox } from "@/ui/shared-components/LayoutBoxes";
44
import { LANG_OPTIONS } from "@/ui/language/useTranslation";
55
import { useLanguageStore } from '@/ui/storage/useLanguageStore';
@@ -40,13 +40,21 @@ const LanguageDropdown = ({ isApp }) => {
4040
{LANG_OPTIONS.map((opt) => (
4141
<MenuItem key={opt.code} value={opt.code}>
4242
<HBox sx={{ gap: 1, alignItems: "center" }}>
43-
<img
44-
src={opt.icon}
45-
alt={opt.label}
46-
width={28}
47-
height={24}
48-
style={{ display: "block", borderRadius: "2px", opacity: 0.75 }}
49-
/>
43+
<Box
44+
sx={{
45+
width: 28,
46+
borderRadius: "4px",
47+
overflow: "hidden",
48+
}}
49+
>
50+
<img
51+
src={opt.icon}
52+
alt={opt.label}
53+
width="100%"
54+
height="100%"
55+
style={{ display: "block", opacity: 0.75 }}
56+
/>
57+
</Box>
5058
<Typography variant="body2" sx={{ color: isApp ? "white" : "black" }}>
5159
{opt.label}
5260
</Typography>

0 commit comments

Comments
 (0)