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

Multiple Languages Support #10

Open
nunocasteleira opened this issue Sep 6, 2017 · 2 comments
Open

Multiple Languages Support #10

nunocasteleira opened this issue Sep 6, 2017 · 2 comments

Comments

@nunocasteleira
Copy link

How can we design a site to support, for example, Portuguese and English?

I defined a i18n folder in my root directory with the Portuguese translations of the section titles, but I'd like to be able to create a multilingual webpage.

Is it possible?

@totoroot
Copy link

Ok, so this issue got opened a while back and unfortunately it appears that the repo owner does not care to discuss issues. It might not be relevant to you anymore, but since I stumbled across the same problem, others might too be confronted with his exact problem in the future so I would like to answer your question...

In the theme's directory you will find the translation files for Korean, Japanese and English in the directory 'i18n'. If you want to add support for other languages, just copy one of those and modify accordingly. I for one needed support for German so I created the file 'de.yaml' for you it would be 'pt.yaml' for Portuguese.

Now the key to letting hugo know which language translations to use, is to put defaultContentLanguage = "de" into the page settings of your config file. For Japanese it would be "ja", for Korean "ko" or "pt" for Portuguese.

Hugo supports building multilanguage sites https://gohugo.io/content-management/multilingual/ but since I only needed German and English I honestly didn't bother and opted for building from two different config files in which I just set the defaultContentLanguage as explained above.

hugo --config config.toml -d public && hugo --config config-de.toml -d public-de

Hope that helps! If you anyone has further questions, just ask.

Lednerb added a commit to Lednerb/hugo-orbit-theme that referenced this issue Jul 3, 2020
@Lednerb
Copy link

Lednerb commented Jul 6, 2020

With the latest update in #23 the process for multiple language versions of your profile is simplified a lot.

Just checkout the example config.toml file:
https://github.com/Lednerb/hugo-orbit-theme/blob/c4c0630f35b206b82bbf826fd05614ed54763e5a/exampleSite/config.toml#L43-L56

For adding new languages you only have to copy the [languages.en] block, change the language code to your desired one and translate the content.

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

No branches or pull requests

3 participants