hugo-scroll icon indicating copy to clipboard operation
hugo-scroll copied to clipboard

Multi-language support

Open maaque opened this issue 1 year ago • 10 comments

When I add multilanguage support in the config.toml like

[languages] [languages.de] title = "Test Deutsch" weight = 2

[languages.en] title = "Test English" weight = 1

and try to start the hugo server I get the error message: Error: Error building site: "/home/content/impressum.de.md:13:1": failed to extract shortcode: template for shortcode "icon" not found

As soon as I remove the language section is works again. Any idea, what I am doing wrong?

maaque avatar Mar 25 '23 19:03 maaque

Hi @maaque, honestly I am not sure this theme supports i18n, I've only used it for single language sites. It can take some time before I get to look at it closer, but it's a good idea.

zjedi avatar Mar 25 '23 22:03 zjedi

That would be really appreciated and BTW, many thanks for this great template

maaque avatar Mar 26 '23 07:03 maaque

Any hints how multilanguage support could be implemented?

Probably simplest approach would be like content subfolders /de and /en with the content inside - but how would the top homepage need to look like?

spi43984 avatar Sep 28 '23 15:09 spi43984

@spi43984 see https://gohugo.io/functions/i18n/ I think we should stick to Hugo patterns when possible

zjedi avatar Sep 30 '23 22:09 zjedi

@spi43984 see https://gohugo.io/functions/i18n/ I think we should stick to Hugo patterns when possible

I agree - I could try an help but would need some short instruction how hugo-scroll is set up and where to dig in.

spi43984 avatar Oct 01 '23 09:10 spi43984

With the exampleSite I tried

defaultContentLanguage = "en"
defaultContentLanguageInSubdir = true

[languages]
  [languages.de]
    contentDir = 'content/de'
    disabled = false
    languageCode = 'de-DE'
    languageDirection = 'ltr'
    languageName = 'Deutsch'
    title = 'Projekt Dokumentation'
    weight = 1
    [languages.de.params]
      subtitle = 'Referenz, Tutorials und Erklärungen'
  [languages.en]
    contentDir = 'content/en'
    disabled = false
    languageCode = 'en-US'
    languageDirection = 'ltr'
    languageName = 'English'
    title = 'Project Documentation'
    weight = 2
    [languages.en.params]
      subtitle = 'Reference, Tutorials, and Explanations'

with content/homepage copied into two directories content/de and content/en (that resulted in content/de/homepage and content/en/homepage).

I had to copy layouts/shortcodes into exampleSite/layouts. Then got rid of a similar error to Error: Error building site: "/home/content/impressum.de.md:13:1": failed to extract shortcode: template for shortcode "icon" not found.

A page is not rendered though correctly, see only "Page Not Found" in browser. Need to dig in further.

spi43984 avatar Oct 15 '23 18:10 spi43984

any luck with Multi-Language support? Thank you.

valsha avatar Oct 18 '23 14:10 valsha

any luck with Multi-Language support? Thank you.

not yet. Still need to work on that. Could need a little support...

spi43984 avatar Oct 18 '23 17:10 spi43984

@maaque @valsha @spi43984 multi-language support now being developed in #177, check the PR while the code is hot :)

zjedi avatar May 11 '24 11:05 zjedi

Hm, what worked at Netlify doesn't work for Github pages, this will need some more fixing for exampleSite, but the feature is now available.

zjedi avatar May 19 '24 20:05 zjedi