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

Adds a second example #21

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

tsteckenborn
Copy link
Contributor

This adds a second sample.

From my perspective the following gaps:

  • When starting in dev, on client side, there's Uncaught SyntaxError: Identifier 'RefreshRuntime' has already been declared (at root.tsx:29:1). I assume some issue with the HMR due to the React Router and React Vite plugins.
  • Currently the languages are hardcoded. We'd need a sample on e.g. language based on the browsers locale. Yet then the behaviour w.r.t. to the client and server entry would need to be checked (as they should return the same I assume otherwise there are hydration errors)
  • I noticed that the same description and text might still result in two different translation keys. To me it's currently unclear how to best reuse translations.
  • I'm currently unsure on how to best translates texts that might be included dynamically (e.g. from configuration or services)
  • I'm currently unsure on how to best translate larger contents. Assuming e.g. a website would have a blog on how best return different languages or translated mdxs?

Not actually deployed yet, so we'd need to check if it works when deployed.

@kayhadrin
Copy link
Collaborator

Just noticing this draft PR.
For the "questions" I see in the PR description, I'd first suggest creating new discussion topics in the Q&A section. 🙂

@cpojer
Copy link
Collaborator

cpojer commented Jan 8, 2025

Regarding the error about RefreshRuntime, that's an issue with the React Router Vite plugin, see remix-run/react-router#12352. tl;dr: The React Router Vite plugin should be changed to take a babel option so it can be used instead of the React Vite plugin.

@@ -5,7 +5,7 @@
"sideEffects": false,
"type": "module",
"scripts": {
"build": "NODE_ENV=production react-router build",
"build": "NODE_ENV=production pnpm fbtee:manifest && pnpm fbtee:collect && pnpm fbtee:translate && react-router build",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't pnpm fbtee:translate && react-router build suffice here, as it anyways works on a different set of files then the ones created by manifest and collect?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The translate command needs .source_strings.json.

@cpojer cpojer force-pushed the docs/second-example branch from 3b83a0c to acd251f Compare January 10, 2025 00:24
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.

3 participants