I added a new language section to quark’s language.yaml based on the english’s structure and even after deleting the cache I still get SIDEBAR.POPULAR_TAGS.HEADLINE strings on the page. The default lang is set accordingly as set in the language.yaml section. What am I missing?
… actually I’m not using Quark directly but through https://github.com/hibbitts-design/grav-skeleton-open-publishing-space
To be more precise (and maybe of help to the quark translation) this is my addition to the languages.yaml:
hu:
TRANSLATION_TEST: Quark!
BLOG:
ITEM:
CONTINUE_READING: Tovább olvasás...
NEXT_POST: Következő bejegyzés
PREV_POST: Előző bejegyzés
SHOP:
ITEM:
BACK: vissza
NEXT_ITEM: Következő
PREV_ITEM: Előző
SIDEBAR:
SIMPLE_SEARCH:
HEADLINE: Keresés
RELATED_POSTS:
HEADLINE: Kapcsolódó bejegyzések
RANDOM_ARTICLE:
HEADLINE: Véletlenszerű bejegyzés
FEELING_LUCKY: Áldottnak érzem magam!
SOME_TEXT_WIDGET:
HEADLINE: Widget szöveg
POPULAR_TAGS:
HEADLINE: Népszerű címkék
ARCHIVES:
HEADLINE: Archívum
SYNDICATE:
HEADLINE: Szindikátus
FORM_DATA:
SUMMARY: "Itt egy összegző arról, hogy, mit írt számunkra:"
ERROR: Hiba
@obeliksz I have downloaded the skeleton and tried the following:
- In ‘/user/config/system.yaml’ added Hungarian (hu) to the list of supported languages.
languages:
supported:
- hu
- In ‘/user/config/site.yaml’ I added Hungarian as default language.
default_lang: hu
- In ‘/user/themes/quark/languages.yaml’ I added your section for Hungarian.
hu:
TRANSLATION_TEST: Quark!
BLOG:
ITEM:
CONTINUE_READING: Tovább olvasás...
NEXT_POST: Következő bejegyzés
PREV_POST: Előző bejegyzés
...
The sidebar now shows ‘Népszerű címkék’ as title of the Popular Tags.
My installation of user/cofig/system.yaml has no supported
part in its languages
section, but I added it as you put it:
languages:
include_default_lang: true
translations: false
translations_fallback: false
session_store_active: false
http_accept_language: false
override_locale: false
supported:
- hu
In the site.yaml I removed the apostrophes ''
from 'hu'
.
Deleted the cache, still same SIDEBAR.POPULAR_TAGS.HEADLINE
.
Thanks, will check on a completely new installation and try to find out what goes wrong by comparing to it.
Got it solved by changing to true
in the previously quoted languages:
section’s translations
part.
And not sure if that had an effect on it but changed the theme from quark-open-publishing
to the default mytheme
.
But now as I have the supported:
tag, I get an extra locale indication in my url which I don’t want as it is not multilingual, can I get rid of it, how could I go about removing it?
@obeliksz Yes, it is the ‘translations: true’ that makes the difference. By default it’s ‘true’… As said elsewhere… so many yamls, so may properties…
To get rid of the ‘hu’ to your urls set ‘include_default_lang: false’ in the ‘languages’ section.
By the way, It’s good you changed to theme ‘mytheme’ and make changes there, because when ‘quark-open-publishing’ gets updated by the developer, you will loose all your changes. See Theme Inheritance
On adding the Hungarian language, I showed you the wrong/hacky way… The same applies as above, when Quark gets updated, you will loose the Hungarian translation.
The correct way is:
- Copy ‘/user/themes/quark/languages.yaml’ to ‘/user/themes/mytheme/languages.yaml’
- Add the translations for Hungarian in that file.
1 Like
Thank you for helping me to a solution on this, learned from you!