feat: automatically detect language on server and translate UI (#530)

* feat: detect language on the server and translate page

* translate auth pages

* PR reviews
This commit is contained in:
Rotimi Best
2024-12-28 23:11:55 +01:00
committed by GitHub
parent 1f1ee8afd3
commit 381776f388
24 changed files with 431 additions and 232 deletions
@@ -76,7 +76,10 @@ export async function getProfile({
}
// Skip refetching profile, if already in store
if (profileStore.id) return;
if (profileStore.id) {
handleLocaleChange(profileStore.locale);
return;
}
// Check if user has profile
let {
@@ -124,7 +127,7 @@ export async function getProfile({
setAnalyticsUser();
// Fetch language
handleLocaleChange(profileStore.locale);
handleLocaleChange(newProfileData[0].locale);
if (isOrgSite) {
const { data, error } = await supabase
@@ -179,8 +182,7 @@ export async function getProfile({
// Set user in sentry
setAnalyticsUser();
// Fetch language
handleLocaleChange(profileStore.locale);
handleLocaleChange(profileData.locale);
const orgRes = await getOrganizations(profileData.id, isOrgSite, orgSiteName);