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

フロントエンド: Remixでのi18nの調査と検証 #195

Open
yu23ki14 opened this issue Dec 1, 2024 · 10 comments · May be fixed by #231
Open

フロントエンド: Remixでのi18nの調査と検証 #195

yu23ki14 opened this issue Dec 1, 2024 · 10 comments · May be fixed by #231
Assignees
Labels
Low Priority Low

Comments

@yu23ki14
Copy link
Member

yu23ki14 commented Dec 1, 2024

i18n

Description

  • 海外プロジェクトとの連携や、導入も早めに進めたいので、言語対応を日本語・英語の両方にしたい
  • Remixでのi18nについて調べて、ミニマムでセットアップしてみる

Notes

Screenshots

If applicable, add screenshots to help explain your problem.

@yu23ki14 yu23ki14 added the Low Priority Low label Dec 1, 2024
@mashharuki mashharuki self-assigned this Dec 8, 2024
@mashharuki
Copy link
Collaborator

参考になりそうなブログ記事を発見!!

https://note.com/lizefield/n/naa3fb014a8c9

@mashharuki
Copy link
Collaborator

@mashharuki
Copy link
Collaborator

https://github.com/sergiodxa/remix-i18next
↑ GitHub 基本的にこの内容通りに設定を進めれば良さそう!

@mashharuki
Copy link
Collaborator

スクリーンショット 2024-12-09 20 59 19 ↑ ビルドは通った!!

@mashharuki
Copy link
Collaborator

スクリーンショット 2024-12-09 21 00 33

@mashharuki
Copy link
Collaborator

↑ と思ったらエラーになった・・・。

@mashharuki
Copy link
Collaborator

エラー内容

(node:20938) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 end listeners added to [ReadStream]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
9:44:01 PM [vite] server restarted.
9:44:08 PM [vite] Internal server error: Cannot read properties of undefined (reading 'status')
      at Object.toNodeRequest (/Users/harukikondo/git/toban/node_modules/@remix-run/dev/dist/vite/node-adapter.js:69:28)
      at nodeHandler (/Users/harukikondo/git/toban/node_modules/@remix-run/dev/dist/vite/plugin.js:869:35)
      at /Users/harukikondo/git/toban/node_modules/@remix-run/dev/dist/vite/plugin.js:871:15
✘ [ERROR] Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides)

    ../../node_modules/i18next-fs-backend/esm/readFile.js:8:20:
      8 │ var fs = !isDeno ? (await import('node:fs')).default : undefined;
        ╵                     ~~~~~

✘ [ERROR] Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides)

    ../../node_modules/i18next-fs-backend/esm/writeFile.js:7:20:
      7 │ var fs = !isDeno ? (await import('node:fs')).default : undefined;
        ╵                     ~~~~~

9:44:08 PM [vite] error while updating dependencies:
Error: Build failed with 2 errors:
../../node_modules/i18next-fs-backend/esm/readFile.js:8:20: ERROR: Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides)
../../node_modules/i18next-fs-backend/esm/writeFile.js:7:20: ERROR: Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides)
    at failureErrorWithLog (/Users/harukikondo/git/toban/node_modules/vite/node_modules/esbuild/lib/main.js:1472:15)
    at /Users/harukikondo/git/toban/node_modules/vite/node_modules/esbuild/lib/main.js:945:25
    at /Users/harukikondo/git/toban/node_modules/vite/node_modules/esbuild/lib/main.js:1353:9
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

@mashharuki
Copy link
Collaborator

デモサイト見つけた!
これを参考にする。

https://remix-i18n.fly.dev/?lng=ja

コードは以下の通り
https://github.com/dev-xo/remix-i18n-example?tab=readme-ov-file

@mashharuki
Copy link
Collaborator

https://sergiodxa.com/tutorials/add-i18n-to-a-remix-vite-app
↑ とりあえずこれで検証してみる。

@mashharuki
Copy link
Collaborator

https://github.com/mashharuki/remix-vite-i18next
↑ これで最小構成の検証が完了。

これが移植できれば良さそう。

@mashharuki mashharuki linked a pull request Jan 1, 2025 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Low Priority Low
Projects
None yet
2 participants