-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
How to use Internationalization #1696
Comments
same question, I have added to my _config.yml:
when i write:
the post is created in the right folder Page Name |
+1 It would be great if i18n from the doc could work ! |
So in other words there currently isn't a way to display posts according to language? So for example English posts appearing under the /en/index.html and Japanese posts appearing under the /ja/index.html and etc? |
I think this may solve your problem |
Basic generator isn't generating indexes for different languages yet. Even when using @zyzyz's |
This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Did any one got a solution to display posts/pages in multiple languages? |
+1 |
@hexojs can you help here? I'm having the same problem. |
Any solutions to this issue? |
This project looks dead. I ended up by using jekyll, for those who are facing the same https://forestry.io/blog/creating-a-multilingual-blog-with-jekyll/ |
@stewwan I am moving from Jekyll because I need to use Pug templates for a project. |
Did you try this plugin? https://github.com/DougBeney/jekyll-pug/blob/master/README.md |
@stewwan Yeah. Didn't work as expected. I guess the problem with Hexo is lack of correct documentation as most docs are confusing. |
You can easily generate posts for one language in your index with a simple if statement. Moderators please close this issue as the starter is inactive. |
Sad the i18n doesn't work. This project was awesome. |
I have exactly the same problem. I followed the manual here: https://hexo.io/docs/internationalization
I have some This works fine. If I switch now the site using a link to english with: This comment: #1696 (comment) recommended to use the plugin So I added it and configured it as recommended. If I access the Have someone an idea how to get this working? I saw that switching to another tool like |
@mfechner You should define the pages for each language.
Then your "/en" and "/de" routes will be created and show the right messages. |
@mohsenkhanpour thanks a lot for your answer. As hexo is completely new for me, it really could be, that I do something wrong. I tried now to strip an example that shows my problem, you can find it here: To see the problem, just execute:
Now click on the German and English flag. You will see: If I generate the site using
Here the text in the I hope this makes the problem more reproduceable that I have. |
@mfechner As you see in the built HTML, the string is being rendered by Hexo. I looked at your repo, the problem is you have created
You are missing those index files which are responsible for You only need to define layout in the frontmatter so your index page is rendered using that layout.
It's no wonder you are getting 404 for |
based on this answer hexojs/hexo#1696 (comment) I propose to update the documentation as this is a FAQ. Thanks
This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@mohsenkhanpour thank you for your post, managed to make it work! |
From the documentation i18n is easy to use.
I have to add to my
_config.yml
this:and add the
languages
folder to my theme with the translations.If I had
<%= __('index.title') %>
to myindex.ejs
I have the french translation onhttp://localhost:4000/
but onhttp://localhost:4000/en/
I got this errorCannot GET /en/
.In the document website you didn't even setup the
_config.yml
There is a "page" folder for every translation + the
index.jade
.I've tried to create a "page" folder for my english translation with an index.html file in.
But when I got on
http://localhost:4000/en/
it loads my index.html (the one from my "en" folder) in the `page.ejs``layout but this is not what I want.How do I load my en.yml translation when I'm on
http://localhost:4000/en/
instead of the "en" page?The text was updated successfully, but these errors were encountered: