-
Notifications
You must be signed in to change notification settings - Fork 53
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
i18n support ? #6
Comments
To be honest, I’ve never been intimately involved in an i18n project so my understanding of how things are usually handled is minimal. That said, this should doable by a plugin/hook. Essentially in your route.js file would return request objects that include any params you need to build the permalink/URL as usual but you’d also include any params needed for i18n such as a In your svelte template/layout you’d then use Then in your hooks.js file or in a plugin, register a regex function on the Honestly, as I’ve written this out I believe writing a plugin to support this should be relatively straight forward and due to the fact plugins have their own closure scope users could define their The only wildcard in my mind is the data.js file which would need to be left up to the final developer to make sure they were looking at the Another possible concern I see is an SEO one around effective management if If you have any feedback here or things I left out please do point them out. I’d love to make this issue into a “spec” of sorts for a plugin so someone with a business usecase to support this could implement this in a reusable pattern. |
Thank's for your complete answer. To me, you seem to cover most of the issues. |
Hey, just a quick thought... I am far from being an i18n expert (or an ElderJS expert for that matter). I have built some multilingual websites but never really understood i18n libraries as it seems to me that it is up to the dev to keep a dictionary of terms to be translated and replaced where necessary. That is probably what i18n libs are doing but like I said... never really understood the benefice they offer... ^^' That being said, I am not sure the html hook is the best place to handle translations as (if I understand ElderJS correctly) all hydrated content would be left out of the process and your Again, it may just be me not understanding i18n processes but in any case I see no problem implementing multilingual websites with ElderJS as is. |
@m4rrc0 I am far from an i18n expert but you bring up a very good point. Hydration is definitely an issue to take into account. I'd defer to people with more knowledge, but it seems a JSON dictionary imported into Svelte components would solve a lot of this as the dictionary would be available in SSR and on the client without having to hydrate it again. Just passing in the request object to be hydrated could be enough. If anyone is exploring i18n, totally interested in learning about different approaches and Elder.js can support those approaches. :) |
You can find a first draft of my plugin here: https://github.com/kiuKisas/elderjs-plugin-i18n |
Quick question: Does anything concern i18n support is plan for elderjs ?
The text was updated successfully, but these errors were encountered: