-
-
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
Multi-language support #474
Comments
Some ideas: _config.yml
scaffolds
The |
If someone is interested, I'm already working on it: https://github.com/kassner/hexo FYI, I never worked with NodeJS before, so probably I'll make a lot of mistakes. When I'll be done, I'll make a pull request. |
Awesome! :) |
The new i18n module is ready for this feature. When you call https://github.com/tommy351/hexo/blob/1c2b23725ea983db9949e5a169207c2f0772b0dc/lib/core/i18n.js |
@tommy351 this isn't just for translate template strings? |
This module is used in the templates. But it can be used in other purposes, too. |
|
But your example is for template translation or "isolated" strings... I want this instead:
Files:
|
@sergiolepore I'm working on the similar problem for my boss. I'll post the solution when I'm done. |
Nice! Thank you soooo much! 😄 |
Here's my solution:
There're still many things to do. Categories, tag and archive pages are not supported so far. |
I'll take a look as soon as I can. Thank you! :) |
Hi, I made an alternative to multi language support just doing some changes in the theme layout files, like this: http://www.shadowdr.com/. It's a bit annoying manage but if this is what you looking for, I would be glad to help. |
@ShadowDanceRunner: That looks great! What would I need to do in order to replicate something like that? When I was considering alternatives I thought about doing many posts with separators /LANG/YYYY/MM/DD (e.g.: /en/2014/03/23) but I realized that It would mean duplicate entries in lists of posts like "recent". I see that you dealt with it nicely but do not show list of posts. Is it due to that problem or is it just a personal preference? |
@IsaacRemuant : In fact I turned off the list, after adjusting I had not checked if it is doubling. As it is now, I know it is doubling the statistics of posts, but I did not care about this. The official theme: https://github.com/ppoffice/hexo-theme-icarus I removed the duplicate listing on the index creating a condition in /layout/_partial/archive.ejs Added the flags with the links to change the language in .//layout/_partial/article.ejs Basically we create 2 posts, one as "mynamepost-en" and other "mynamepost-pt-BR", add in the Front matter of each post the "filename" attribute with the value: "mynamepost". The trick is to create a link in article.ejs like this:
Results in: blog.com/2015-03-31/mynamepost-pt-BR/../mynamepost-en If you need more details I'll be glad to help. (sorry my bad english) |
@ShadowDanceRunner. It worked wonders. Thanks. I had no issue with the translations. However, I had a problem with both the duplicated posts in the "recents" widget (both appear) and its position (the css somehow positioning somehow got broken in the process?) see: http://isaacremuant.github.io/ (the sidebar is at the bottom). |
My first language is Spanish. I've been writing in Spanish since I remember, but now I want to share some thoughts in English. I remembered that Wordpress have a plugin called
WPML
, so I started to write a Hexo Plugin that mimics its functionality. I didn't get far 😢Do you have any plans for this feature? I've been looking at some core files and I think that's not so hard to bring multi-language support by rewriting a few lines.
I'll be waiting until v2.5 comes out 😄
The text was updated successfully, but these errors were encountered: