Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Quark theme's language

Solved by pamtbaau View solution

Started by z-aszlo 8 years ago · 5 replies · 1164 views
8 years ago

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:

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
last edited 07/23/18 by z-aszlo
8 years ago

@obeliksz I have downloaded the skeleton and tried the following:

  1. In '/user/config/system.yaml' added Hungarian (hu) to the list of supported languages.
    YAML
    languages:
     supported:
       - hu
    
  2. In '/user/config/site.yaml' I added Hungarian as default language.
    TXT
    default_lang: hu
    
  3. In '/user/themes/quark/languages.yaml' I added your section for Hungarian.
    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
      ...
    

    The sidebar now shows 'Népszerű címkék' as title of the Popular Tags.

8 years ago

My installation of user/cofig/system.yaml has no supported part in its languages section, but I added it as you put it:

YAML
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.

8 years ago

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?

last edited 07/23/18 by z-aszlo
8 years ago Solution

@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:

  1. Copy '/user/themes/quark/languages.yaml' to '/user/themes/mytheme/languages.yaml'
  2. Add the translations for Hungarian in that file.
👍 1
8 years ago

Thank you for helping me to a solution on this, learned from you! 😃

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 193 2 months ago
Themes & Styling · by Ian, 2 months ago
3 91 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 451 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 45 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 125 3 months ago