-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
Apache Content Negotiation and Eleventy #761
Comments
Hey @rachelandrew, really interesting approach! I've made up a proof-of-concept repo (eleventy-l10n-demo), which includes the files/config to support the approach explained in the post you referenced. We can get creative with Eleventy's This demo site leverages Netlify's https://eleventy-l10n-demo.netlify.app/ To test, Quick Accept-Language Switcher is handy for ensuring the language settings are being honoured ( I hope that helps you or someone else exploring this approach. Definitely one to keep in mind as an alternative to a more manual i18n approach. Thanks for highlighting it! 👍 |
Sorry I’m so late to this party but I was able to dig into this today and made a few changes as a result. For this style of approach I do think it’s better to swap your default permalink behavior to use https://www.11ty.dev/docs/data-eleventy-supplied/#changing-your-project-default-permalinks The new stuff I added for this use case specifically is available on the docs here: https://www.11ty.dev/docs/permalinks/#mapping-one-url-to-multiple-files-for-internationalization I think this will clean up the example you linked to a bit @adamduncan in that you don’t need to hardcode permalinks throughout your files and you will be able to use I’m at close of business today but I’m curious to hear y’alls thoughts! |
This is now officially discussed on our new i18n docs page https://www.11ty.dev/docs/i18n/ though we really recommend the |
@zachleat sorry if this isn't the place to ask, still getting use to github. I was wondering why the folder approach is recommended for file organization over an extensionless url like described in this article. I'm trying to decide what is best and honestly have no idea. |
There is a method of internationalizing content which uses Apache Content Negotiation - explained in this post.
To do this you need to name your files with a language code eg about/history.en.html, about/history.fr.html and then linking to about/history uses a rewrite to return the version for the language of the user.
I am working on a site where they wish to use this method and I really want to use Eleventy. I can use the overrides in Eleventy to create the named files, but then this makes actually working with the site in development impossible, as all my links go to the bare main file name (e.g. about/history) and there is no way to go to the internationalized versions.
If anyone has any ideas as to how I can get this working I would be very grateful. I'm aware there are other ways of doing internationalization, I'm interested as to whether this one is possible.
The text was updated successfully, but these errors were encountered: