Skip to content

Commit

Permalink
Disabling Polish and Faroese in the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
HaukurPall committed Sep 12, 2023
1 parent 96353f9 commit 885c81f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "0.5.2",
"version": "0.5.3",
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^1.6.2",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Disclaimer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function Disclaimer() {
"By using this service you agreee to our use of cookies. Translations may be logged for quality assurance purposes."
)}
</p>
<p>{t("disclaimer-last-updated", "Last updated: ")} 2023-01-12</p>
<p>{t("disclaimer-last-updated", "Last updated: ")} 2023-09-12</p>
</Message>
</div>
);
Expand Down
43 changes: 27 additions & 16 deletions src/components/LanguagePicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ function LanguageDirectionPicker() {
// TODO: Get this information from the backend
const SUPPORTED_LANGUAGE_PAIRS = useMemo(() => {
return {
en: ["is", "fo"],
is: ["en", "pl"],
pl: ["is"],
fo: ["en"],
is: ["en"],
en: ["is"],
};
// return {
// en: ["is", "fo"],
// is: ["en", "pl"],
// pl: ["is"],
// fo: ["en"],
// };
}, []);
const LANGUAGE_OPTIONS = useMemo(() => {
return {
Expand All @@ -54,18 +58,18 @@ function LanguageDirectionPicker() {
value: "en",
flag: "uk",
},
pl: {
key: "pl",
text: t("Polish"),
value: "pl",
flag: "pl",
},
fo: {
key: "fo",
text: t("Faroese"),
value: "fo",
flag: "fo",
},
// pl: {
// key: "pl",
// text: t("Polish"),
// value: "pl",
// flag: "pl",
// },
// fo: {
// key: "fo",
// text: t("Faroese"),
// value: "fo",
// flag: "fo",
// },
};
}, [t]);
useEffect(() => {
Expand All @@ -87,6 +91,13 @@ function LanguageDirectionPicker() {
const SRC_LANGUAGE_OPTIONS = Object.keys(LANGUAGE_OPTIONS).map(
(key) => LANGUAGE_OPTIONS[key]
);
// In case the currently selected sourceLang is not supported, select the first as sourceLang
if (
SRC_LANGUAGE_OPTIONS.map((option) => option.value).indexOf(sourceLang) ===
-1
) {
dispatch(setSourceLanguage(SRC_LANGUAGE_OPTIONS[0].value));
}
return (
<div className="LanguageDirectionPicker">
<div className="LanguageDirection">
Expand Down

0 comments on commit 885c81f

Please sign in to comment.