Austrian
and German
German differ, as reported an Austrian in pacollins/hugo-future-imperfect-slim#61.
However, Hugo doesn’t support language codes like de-at in defaultContentLanguage.
Austrian
and German
German differ, as reported an Austrian in pacollins/hugo-future-imperfect-slim#61.
However, Hugo doesn’t support language codes like de-at in defaultContentLanguage.
When you say it isn’t supported, what is happening exactly that indicates that?
Copied from FEATURE: Switch from flags to language names · Issue #61 · pacollins/hugo-future-imperfect-slim · GitHub
After experimenting, Hugo does not recognize
de-atoratas adefaultContentLanguage.Error: site config value "de-AT" for defaultContentLanguage does not match any language definition Error: site config value "at" for defaultContentLanguage does not match any language definitionSo this might be an issue to push further up the chain.
Hugo does support country-specific language codes.
Yet, the languageCode seems to set the language without a ‘sub-regional’ context only.
(The issue you are pointing to is theme-specific and can easily be solved, I guess.)
You can use the following:
languageCode: de-at
For a multilingual website you can use this:
defaultContentLanguage: de
languages:
de:
weight: 1
languageCode: de-at
en:
…
In your baseof.html you can use this:
<html lang="{{ .Site.LanguageCode }}">
If you go to http://localhost:1313/index.xml you will also find this line:
<language>de-at</language>
That shows tests of de-AT and at, but what about de-at specifically. Does that work, or give an error?
Interpreted as site default language (English).
[Languages]
[Languages.de]
languageCode = "de-at"
LanguageName = "Deutsch (Österreich)"
<div id="content">
{{ .Content }}
<div class="contact-container">
{{ if .Params.netlify }}
<form name="contact" action="thank-you" netlify center width="300px">
{{ else }}
<form id="contact" action="//{{ .Params.emailService }}" method="post" center width="300px">
{{ end }}
<h4>{{ i18n "categories" }}</h4>
<h4>{{ i18n "repliestext" .Params.contactanswertime }}</h4>
<p>{{ .Params }}</p>
<fieldset>
<input placeholder="{{ with .Params.contactname }}{{ . }}{{ else }}Name{{ end }}" type="text" name="name" tabindex="1" required autofocus>
</fieldset>
<fieldset>
<input placeholder="{{ with .Params.contactemail }}{{ . }}{{ else }}Email{{ end }}" type="email" name="_replyto" tabindex="2" required>
</fieldset>
<fieldset>
<input placeholder="{{ with .Params.contactsubject }}{{ . }}{{ else }}Subject{{ end }}" type="text" name="_subject" tabindex="3" required>
</fieldset>
<fieldset>
<textarea placeholder="{{ with .Params.contactmessage }}{{ . }}{{ else }}Message{{ end }}" name="message" tabindex="4" required></textarea>
</fieldset>
<fieldset>
<input type="hidden" name="_language" value="{{ .Params.contactlang }}">
</fieldset>
<fieldset>
<button name="submit" class="button" type="submit" id="contact-submit" tabindex="5">{{ i18n "submit" }}</button>
</fieldset>
</form>
</div>
[date_format]
other = "02-01-2006"
[postreadingtime]
one = "1 Minute"
other = "{{ .Count }} Minuten"
[recent_posts]
other = "Letzte Artikel"
[see_more]
other = "Mehr erfahren"
[read_more]
other = "Weiterlesen"
[categories]
other = "Kategorien"
[category]
other = "Kategorie"
[tags]
other = "Tags"
[tag]
other = "Tag"
[uncategorized]
other = "Unkategorisiert"
[share_post]
other = "Teilen"
[about]
other = "Über mich"
[learn_more]
other = "Mehr erfahren"
[repliestext]
one = "Antworten innerhalb von 1 Stunde."
other = "Antworten innerhalb von {{ .Count }} Stunden."
[submit]
other = "Senden"
[404_pagenotfound]
other = "Seite nicht gefunden"
[404_sorry]
other = "Entschuldigung, die Seite, die Sie suchen, ist leider nicht gibt."
[404_goback]
other = "Gehe zurück"
[blog]
other = "Blog"
[contact]
other = "Kontakt"
[next_page]
other = "Nächste Seite"
[previous_page]
other = "Vorherige Seite"
[attribution]
other = "Thema : <a href='https://github.com/pacollins/hugo-future-imperfect-slim' target='_blank' rel='noopener'>Hugo Future Imperfect Slim</a><br>Ein <a href='https://html5up.net/future-imperfect' target='_blank' rel='noopener'>HTML5 Port</a> | Unterstützt von: <a href='https://gohugo.io/' title='{{ .Site.Hugo.Version }}' target='_blank' rel='noopener'>Hugo</a>"
Did you add defaultContentLanguage and weight to config.toml mentioned above (above example is YAML)?
I’ve tried, though I think that shouldn’t be necessary since one might want something like
Eng
Eng
Simplified Chinese (zh-CN)
Traditional Chinese (zh-TW)
Traditional Chinese (zh-HK)Dropping support for any one of
,
and
can trigger sentiments of hundreds of netizens like: https://gitlab.com/gitlab-org/gitlab-ce/issues/60768
I’ve added <p>{{ .Lang }}</p> in the Go-HTML template for debug, as well as applying for suggested changes.
+++
title = "Contact"
type = "contact"
netlify = false
emailservice = "formspree.io/example@email.com"
contactname = "Your name"
contactemail = "Your Email"
contactsubject = "Subject"
contactmessage = "Your Message"
contactlang = "en"
contactanswertime = 24
+++
It seems that the German verison of the above file gets rendered since the form placeholder text is determined by content/contact/_index(.*).html.
The submit button text is missing despite nonempty German traslation for submit in the local file in my previous reply.
I’m found the solution !Thanks to the project Public Money Public Code.
# config.toml
[Languages.zh-TW]
languageCode = "zh-TW"
languageName = "正體中文(臺灣)"
While the file name should be foo.zh-tw.md in lower case for the language-country part.