Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/msurdi/remix-i18n-example
I18n example for Remix without large external dependencies
https://github.com/msurdi/remix-i18n-example
i18n javascript react remix
Last synced: about 2 months ago
JSON representation
I18n example for Remix without large external dependencies
- Host: GitHub
- URL: https://github.com/msurdi/remix-i18n-example
- Owner: msurdi
- Created: 2024-03-20T06:17:51.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-14T06:36:24.000Z (9 months ago)
- Last Synced: 2024-10-14T13:24:04.495Z (3 months ago)
- Topics: i18n, javascript, react, remix
- Language: JavaScript
- Homepage:
- Size: 96.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Remix translations example
This is an example of a possible approach to implementing translations in a [Remix](https://remix.run/) application.
Key takeaways:
* No external dependencies other than [react-string-replace](https://www.npmjs.com/package/react-string-replace) for doing interpolations.
* Easy to adapt to your own needs given it is using just Remix primitives.
* Can translate strings in React components, in Remix actions/loaders/etc and in any backend Node module.
* Translations are loaded only once, bundled with the initial HTML payload together with the the rest of the loader's data and then cached on client navigations, until a full page reload is done.
* The message strings can have any value interpolated, including other React components.## Trying it out
1. Run `npm install`
2. Run `npm run dev`