aerohub / hugo-orbit-theme

Great looking resume/CV theme designed for developers.
MIT License
253 stars 117 forks source link

Multiple Languages Support #10

Open nunocasteleira opened 7 years ago

nunocasteleira commented 7 years ago

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 commented 4 years ago

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 commented 4 years ago

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.