-
Notifications
You must be signed in to change notification settings - Fork 0
feat: internationalization #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2025-08-27 23:02:46 CET |
<ReactQueryDevtools initialIsOpen={false} /> | ||
</DictionaryProvider> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can move this out of the dictionary provider since it will never use it.
<ReactQueryDevtools initialIsOpen={false} /> | |
</DictionaryProvider> | |
</DictionaryProvider> | |
<ReactQueryDevtools initialIsOpen={false} /> |
@@ -27,8 +28,10 @@ export default function RootLayout({ | |||
<html className="h-full" lang="en"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change lang="en"
according to the current language preference. Check out this example: https://github.com/cesium/hydrogen/blob/develop/src/app/%5Blang%5D/layout.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move this provider into the providers/
folder instead for consistency.
); | ||
|
||
export async function PreferedLanguage(): Promise<DictionaryLanguage> { | ||
const response = await api.get("/auth/preferences/language"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could create a useGetUserPreference
tanstack query that receives the desired prefrence as an argument, it would go something like this:
export function useGetUserPreference(preference: string) {
return useQuery({
queryKey: ["user", "preferences", preference],
queryFn: () => {} // function that does the fetching and that receives 'preference' as argument
})
}
This way, we can benefit from all the tanstack cool perks and have a centralized way of getting any preference.
Closes #34