Set default locale according to browser locale (#11805)

We didn't get much complaints on Localization so I guess we can expand
it more and make it the default behavior to use the browser's locale
when you signup

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Félix Malfait
2025-04-30 13:11:40 +02:00
committed by GitHub
parent e55ff5ac4a
commit cb513bc7a8
7 changed files with 140 additions and 18 deletions

View File

@ -10,10 +10,4 @@ export const dynamicActivate = async (locale: keyof typeof APP_LOCALES) => {
const { messages } = await import(`../../locales/generated/${locale}.ts`);
i18n.load(locale, messages);
i18n.activate(locale);
try {
localStorage.setItem('locale', locale);
} catch (error) {
// eslint-disable-next-line no-console
console.log('Failed to save locale to localStorage:', error);
}
};