Skip to content
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 language #1125

Open
dcardosods opened this issue Mar 20, 2015 · 18 comments
Open

Default language #1125

dcardosods opened this issue Mar 20, 2015 · 18 comments

Comments

@dcardosods
Copy link

The theme I'm using has 3 files in the languages folder , default, fr-FR and zh-Hans.
I need English (default) as my site language. Leaving the language option in _config.yml blank doesn't fallback to default (as I suppose is the expected behavior). iissnan/hexo-theme-next#57 has more details.
In the line lib/theme/index.js#L26 it isn't checked if languages is null before adding it to the array. Maybe the bug is here.

@kfranqueiro
Copy link

This happened to me as well, both with the default landscape theme as well as the light theme. It used the alphabetically-last language in the theme's languages folder (zh-TW in this case). I had to set language to 'default' explicitly to actually make it use "default".

It should be simple to reproduce. Run hexo init somewhere, run hexo server, open your browser to localhost:4000, and boom, you have Chinese text in the sidebar.

Seems kind of hard to believe this has been unresolved for almost a year.

@leesei
Copy link
Member

leesei commented Feb 25, 2016

Agreed, I read in some comment that language's default is en.
This means the theme are incorrect in using default as language name.
Maybe someone can help verify that?

@mnn
Copy link

mnn commented Mar 19, 2016

In my case using default landscape theme with en lead to random language being picked up. Changing language to default fixed all issues.

@mnn
Copy link

mnn commented Mar 26, 2016

It turns out that it is (and probably was) still behaving "randomly", after adding a post I'm getting index page in second language even though I have in confg:

language:
- en
- cs

I'm getting cs translation on main page (in theme I have copied a default.yml file to en.yml just ot be sure). This bug is quite annoying 😞.

@jbuddha
Copy link

jbuddha commented Apr 15, 2016

same issue.... random language everytime... so frustrating.

@weqeo
Copy link

weqeo commented Oct 10, 2016

same...i need chinese,but it give me de.......

@NoahDragon
Copy link
Member

@weqeo set language in hexo _config.yml to zh-cn may solve your issue.

@weqeo
Copy link

weqeo commented Oct 11, 2016

@NoahDragon thanks,i found that this bug only appearanced when i test in localhost,it's just show everything fine when i deploy it to my domain.

@frumpel
Copy link

frumpel commented Feb 21, 2017

I still have this issue using the landscape theme and the main _config.yml language does not seem to influence the language being picked.

@NoahDragon NoahDragon added this to the 4.0 milestone Apr 6, 2017
@NoahDragon NoahDragon mentioned this issue Apr 6, 2017
53 tasks
@FossPrime
Copy link

the strangest thing is, it's random! I use a gitlab runner on some docker image and for some reason sometimes it renders in french, the first language in my theme other than default. https://vblip.com

@curbengh
Copy link
Contributor

curbengh commented Sep 28, 2019

Did #3069 + #3110 resolve this issue?

Maybe related #3654

@stevenjoezhang
Copy link
Member

This issue should have been resolved. I did a lot of tests on multiple languages today:
theme-next/hexo-theme-next#1391, and this problem has not been reproduced on the latest version of Hexo

@SukkaW
Copy link
Member

SukkaW commented Feb 29, 2020

@stevenjoezhang

What about writing a post about how to maintain a Hexo with multiple languages? Such as how to organize the source folder, how to set Front-Matters for each post, how to configure permalink & language settings in _config.yml.

@stevenjoezhang
Copy link
Member

@SukkaW

Yes, I am thinking about it. In fact, Hexo can do more for multi-language support. For example, to generate the homepage and archive pages separately for different languages, users must use a plugin like https://github.com/Jamling/hexo-generator-i18n, or override the default generator: ppoffice/hexo-theme-minos@f026985
How about making the index / archive / tag generator all multilingual by default?

@SukkaW
Copy link
Member

SukkaW commented Feb 29, 2020

@stevenjoezhang

How about making the index / archive / tag generator all multilingual by default?

Sounds like a great idea! Since Hexo 5.0.0 is on the go, it is now or never.

@curbengh
Copy link
Contributor

curbengh commented Mar 6, 2020

How about making the index / archive / tag generator all multilingual by default?

instead of /tags/foo/, /en/tags/foo/ is generated instead?

@stevenjoezhang
Copy link
Member

stevenjoezhang commented Mar 6, 2020

Yes, if the user sets multiple languages in _config.yml, then multiple directories need to be generated separately:
/tags/foo/ (for default language)
/en/tags/foo/
/en/zh-CN/foo/
...

See also #1696, #1450

A few months ago, theme NexT received a feature request about multilingual support: theme-next/hexo-theme-next#1070
Users need a multilingual button for switching the website into different language version. This requires multilingual directories generated by Hexo.

@dimaslanjaka
Copy link
Contributor

I created simple hexo site with support multi language for post/pages/archives based on hexo-theme-minos, but ongoing language switcher and meta seo.

https://github.com/dimaslanjaka/hexo-multi-language

http://www.webmanajemen.com/hexo-multi-language/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests