Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fix: broken language selector

Blue Moused9bf4c88feed
diff --git a/web/app/i18n.ts b/web/app/i18n.ts
index 6d5c48ca1..2f63138a3 100644
--- a/web/app/i18n.ts
+++ b/web/app/i18n.ts
@@ -1,8 +1,9 @@
-import { InitOptions, changeLanguage as changeLanguageI18n } from 'i18next'
+import { InitOptions } from 'i18next'
import _includes from 'lodash/includes'
import { defaultLanguage, I18N_CACHE_BREAKER, whitelist } from '~/lib/constants'
import { trackCustom } from '~/utils/analytics'
+import { setCookie } from '~/utils/cookie'
const genericConfig: InitOptions = {
supportedLngs: whitelist,
@@ -49,8 +50,9 @@ export function detectLanguage(request: Request): string {
}
export const changeLanguage = (language: string) => {
- changeLanguageI18n(language)
+ setCookie('i18next', language, 31536000, 'lax')
trackCustom('CHANGE_LANGUAGE', { language })
+ window.location.reload()
}
export default genericConfig