Skip to content
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

unable to resolve translations when start in local #7723

Open
nanne007 opened this issue Jun 2, 2024 · 1 comment
Open

unable to resolve translations when start in local #7723

nanne007 opened this issue Jun 2, 2024 · 1 comment

Comments

@nanne007
Copy link

nanne007 commented Jun 2, 2024

I followed the guide here https://github.com/Uniswap/interface/tree/main/apps/web to start web interface.
I got errors when running yarn start in apps/web folder.

Failed to compile.

Module not found: Error: Can't resolve './i18n/locales/translations' in '/Users/caojiafeng/projects/Uniswap/interface/apps/web/src'
ERROR in ./src/i18n.tsx 20:11-65
Module not found: Error: Can't resolve './i18n/locales/translations' in '/Users/caojiafeng/projects/Uniswap/interface/apps/web/src'

It has something to do with translation.
How to resolve the issue?

@JayJay1024
Copy link

I think there might be a conflict between server-side rendering and client-side rendering. I temporarily solved this issue by directly returning enUsLocale

--- a/apps/web/src/i18n.tsx
+++ b/apps/web/src/i18n.tsx
@@ -18,10 +18,11 @@ i18n
       if (!language.includes('-')) {
         return
       }
-      if (language === 'en-US') {
-        return enUsLocale
-      }
-      return import(`./i18n/locales/translations/${language}.json`)
+      return enUsLocale
+      // if (language === 'en-US') {
+      //   return enUsLocale
+      // }
+      // return import(`./i18n/locales/translations/${language}.json`)
     })
   )
   .on('failedLoading', (language, namespace, msg) => {

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

No branches or pull requests

3 participants
@nanne007 @JayJay1024 and others