-
Notifications
You must be signed in to change notification settings - Fork 45
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
Default locale #1
Comments
Well what do you imagine under a 'default locale'? Do you want one 'default' language that does not render inside a Is a page redirect to a 'default locale' what you want? You'd have to implement that by yourself. Therefore, check out root-index.html. This page has a Also, look into the YAML front-matter wiki page. As an idea, you could write a JavaScript that figures out the browsers language and automatically redirects the user to the optimal language for him or herself. |
I have implemented automatic language redirect for the example page. Check out the commit 27e6c42. |
A default that does not render inside a subdirectory is what I thought about. I know there are other ways to do, but I wanted to know what your thoughts are about it. Thanks for the example and the explanation! |
Hello! Sorry to resurrect a closed issue but I think this issue could use some further thought. This plugin does a very good job of implementing localization. I'm glad I found it. Unfortunately a javascript redirect to a default language is considered sub-optimal in my case. For an opensource project our default language is English and we are attempting to support multiple languages going forward. Not having a default language pollutes my default URI scheme a bit and doesn't give the best user experience. There are other javascript location redirects that happen in my default page that will conflict with the localization redirect. Additionally, some care is going into the URI scheme to enhance SEO optimization and I don't think a default redirect is optimal for indexing. Even with the root-index.html solution, any clicks off the main page will cause links to happen to /en instead of the default lang. My hope for using this plugin is that the project will always use english as it's default documentation source and we can slowly recruit volunteers to provide further translations. I've attempted to duplicate page content without language settings in hopes that it would create a 'default' view in the destination directory, but I receive build errors
Is there any other work around for this? |
The exception is being triggered because you probably removed the What you want is a |
👍 for this.. any suggestion? There is no sense adding a language slug on each default language url. |
@calmyournerves
Result: the Swiss site (chde) inherits the translation from German site (de), the German site (de) inherits from English site (en), for all keys not included in the specific language. In the example the key site is the same in all languages, key description is different in en, de and chde but not in at. This reduces the amount of redundant translation data and the time to maintain translations. Viele Grüße nach Zürich aus Luzern. |
No longer needed redirects. Just check #37. |
I still think it would be great to have a languages fallback system. Having this en:
title: Jekyll
desc: Hello
fr:
desc: Bonjour would be greatbut something even better would be to also be able to get the french title if it doesn't exist in english. However it would already be great to have it working for english as fallback |
@git-no that's neat but does not work when using multiple language files. |
Hi there,
thanks for this plugin! I was wondering if it's possible to define a default locale or if you have plans to implement something like that. Or are there other ways to manage that?
Cheers!
The text was updated successfully, but these errors were encountered: