Add Swedish locale (#244)

* Add Swedish locale

* Stop reload when changing language

* Add translation

* Remove unused
This commit is contained in:
Luke Vella 2022-07-26 18:50:10 +01:00 committed by GitHub
parent 0546ed44a9
commit 2bacb67beb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 194 additions and 14 deletions

View file

@ -17,12 +17,14 @@ export const LanguageSelect: React.VoidFunctionComponent<{
Cookies.set("NEXT_LOCALE", e.target.value, {
expires: 365,
});
router.push(router.asPath, router.asPath, { locale: e.target.value });
onChange?.(e.target.value);
}}
>
<option value="en">{t("english")}</option>
<option value="fr">{t("french")}</option>
<option value="de">{t("german")}</option>
<option value="sv">{t("swedish")}</option>
</select>
);
};