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

How to Multilingue it ? #730

Closed
JOduMonT opened this issue Mar 31, 2020 · 9 comments
Closed

How to Multilingue it ? #730

JOduMonT opened this issue Mar 31, 2020 · 9 comments
Labels
Milestone

Comments

@JOduMonT
Copy link

I reed the 4 issues related but I but didn't succeed ;)
I probably have a good beginning because after duplicating my page with cp and rename the new one with .fr.
image

Hugo generate 2 languages
image

and en fr appear in my navbar
image

but when I go to localhost:1313/fr/ I have almost a complete blank page. I means by this it seams to load ./content/_index.fr.md and I see the french title but the body is empty
image

what I'm missing ?

@stp-ip
Copy link
Member

stp-ip commented Mar 31, 2020

Will dive into this in a bit. The main docs are here: https://about.okkur.org/syna/docs/multilingual/
Any feedback on the docs would be helpful as well.

@stp-ip
Copy link
Member

stp-ip commented Apr 23, 2020

Any more information you can share?

@stp-ip stp-ip added this to the v0.18.0 milestone Apr 23, 2020
@stp-ip stp-ip modified the milestones: v0.17.1, v0.18.0 May 23, 2020
@mpourismaiel
Copy link
Member

Hugo generates pages for each language if the page is registered. If you want landing page in both languages for example, you have to create content/_index.md and content/_index.fr.md, then in content/_index/ you have to create content/_index/index.md and content/_index/index.fr.md and other language coded files for Hugo to grab them.

@stp-ip stp-ip modified the milestones: v0.17.3, v0.18.0 Jul 27, 2020
@stp-ip stp-ip modified the milestones: v0.17.4, v0.18.0 Oct 23, 2020
@CedricReichenbach
Copy link

I'm facing the same issue after following the documentation. After building the site with hugo, there are indeed language subdirectories under public/, such as fr/. Looking at index.html in there, it looks like just none of the components were picked up, but e.g. theme and CSS get included properly:

<!DOCTYPE html>
<html lang="en-us">
<head>
...
</head>
<html>
<body class="bg-light">
    <div id="react"></div>

    <!-- Theme Code -->
      <script async defer src="/scripts/syna-main.min.065c23d84ca56793a8ee2be9d091a50028dc3505b5e4962af6444d641ed77ff5.js"></script>
  </body>
</html>

(left out head contents for brevity)

@CedricReichenbach
Copy link

Update: I figured out what was the issue.

I had somehow overread and skipped the following step in the documentation:

Since Hugo doesn’t expose the default language to the themes, you need to add the parameter to params as well:

[params]
 DefaultContentLanguage = "en"

After adding that, translations work as expected.

@otoimrich
Copy link

Is there a possibility to adjust the language buttons - use dropdown or change colors?

@stp-ip
Copy link
Member

stp-ip commented Nov 23, 2021

Not through a simple config. Would have to be done on the HTML templates and either be opened as a PR so we can integrate any config option or overwrite the theme files on your setup.

@otoimrich
Copy link

one more comment (I know it does not belong here, so delete this post if you wish) I just found that the names of the fragments should not begin with a number. At least of those using js like hero or editor. I thing this info is not in the documentation.

@stp-ip
Copy link
Member

stp-ip commented Nov 23, 2021

Happy for you to open a separate issue or create a pull request adding said documentation.

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

No branches or pull requests

5 participants