I've added Kazakh language in system.yaml kk (it doesn't existing in Grav) and now my html lang is empty:
<html lang="{{ grav.language.getActive ?: theme_config.default_lang }}">
What's wrong?
<html lang="">
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
I've added Kazakh language in system.yaml kk (it doesn't existing in Grav) and now my html lang is empty:
<html lang="{{ grav.language.getActive ?: theme_config.default_lang }}">
What's wrong?
<html lang="">
hmm, looks like that should be fine, so have you set up
languages:
translations: true
as described in Single language different than English?
Just a guess, but getActive probably needs translations enabled.
I just checked a site I have, where the single language is en-NZ and I don't have translations enabled. The template has:
<html lang="{{ grav.language.getLanguage ?: theme_config.default_lang }}">
instead of getActive. I think I remember changing that after it didn't work (like yours). I suspect getLanguage will work anyway if there is only one supported language. Try that if you don't need translations.
@hughbris:
hmm, looks like that should be fine, so have you set uplanguages:
translations: trueas described in Single language different than English?
Translations are enabled, but "include default language" is disabled, because i won't use language code, if i have just one language on the site.
@hughbris:
instead of getActive. I think I remember changing that after it didn’t work (like yours). I suspect getLanguage will work anyway if there is only one supported language. Try that if you don’t need translations.
That worked, thanks. But this won't work if we have more than 1 language, right?
@heihachi88:
But this won’t work if we have more than 1 language, right?
Haha, I'm the wrong guy to ask as I pretty much work only in the English language world. My custom en-NZ is about all I've done with languages.
Experiment with different combinations or wait for another answer from someone here
who has multi-language experience.
Log in to reply.
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 2 | 82 | 12 hours ago | ||
| 1 | 55 | 16 hours ago | ||
| 0 | 45 | 1 day ago | ||
| 6 | 348 | 5 days ago | ||
| 3 | 43 | 5 days ago |