#Simple Remix Translations (Slugs Translations Support)

1 messages · Page 1 of 1 (latest)

gentle narwhal
#

I've been working on a multilingual website and wanted a clean solution for managing both content translations and URL slugs. I couldn't find an ideal approach, so I built this basic implementation:
https://github.com/faizan47/remix-multilingual-slugs

The solution is simple, lightweight (no external libraries), and uses type-safe slugs for better maintainability. Feel free to check it out, and I'd love to hear any feedback or suggestions for improvement!

GitHub

Contribute to faizan47/remix-multilingual-slugs development by creating an account on GitHub.

proper flint
#

This is amazing.

#

I’ve been trying to set something like this too. How do you handle redirecting when no lang parameter is present ?

Also, how do you keep relative path links ? For example if I’m at /en/posts and i make a post request to “posts/new” does it know to go there and not the es/articulos

marsh violet
#

How do you define different urls for different langs? I guess you end up with multiple routes that goes to the same location.

example:

/en/about
/es/about
/nn/about

and if you also define a translated route too
/nn/om-oss
/en/om-oss
/es/om-oss

Seems like there is something that needs to be handled? or do you already have this covered?

pulsar wasp
#

I like this idea. Do you think you could update your sample code to include a nested route?

Ex: something like /products and /products/:category/:id where the category is multilingual.

gentle narwhal
# proper flint I’ve been trying to set something like this too. How do you handle redirecting w...
  1. I handle that in the root router.
  2. Yes, I'm not sure why would that be an issue. Everything(for handling multi language slugs) is defined in vite config https://github.com/faizan47/remix-multilingual-slugs/blob/main/vite.config.ts
GitHub

Contribute to faizan47/remix-multilingual-slugs development by creating an account on GitHub.

gentle narwhal
gentle narwhal
# marsh violet How do you define different urls for different langs? I guess you end up with mu...

No, we don't have multiple routes. That's what I wanted to avoid.

Have a look at these two files. Everything will be much cleared.

https://github.com/faizan47/remix-multilingual-slugs/blob/main/vite.config.ts

https://github.com/faizan47/remix-multilingual-slugs/raw/refs/heads/main/app/types.ts

The readme should be updated to indicate this. Sorry for the confusion.

Feel free to create a PR.

GitHub

Contribute to faizan47/remix-multilingual-slugs development by creating an account on GitHub.