Skip to content

Conversation

enricoprazeres
Copy link
Contributor

@enricoprazeres enricoprazeres commented Jul 29, 2025

Closes #34

@deployum
Copy link

deployum bot commented Jul 29, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-08-27 23:02:46 CET

@enricoprazeres enricoprazeres marked this pull request as ready for review August 28, 2025 14:27
Comment on lines +33 to +34
<ReactQueryDevtools initialIsOpen={false} />
</DictionaryProvider>
Copy link
Member

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.

Suggested change
<ReactQueryDevtools initialIsOpen={false} />
</DictionaryProvider>
</DictionaryProvider>
<ReactQueryDevtools initialIsOpen={false} />

@@ -27,8 +28,10 @@ export default function RootLayout({
<html className="h-full" lang="en">
Copy link
Member

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

Copy link
Member

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");
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: internationalization
2 participants