Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Theme doesn't use languages.yaml for label translations

Started by Michael 9 years ago · 3 replies · 1551 views
9 years ago

I added a new theme and it is working correctly.
Within this theme a I added some custom fields for special Menuoptions and added a new section within the Admin Panel -> Pages -> Options. Works great and fine
Now I wanted to use translated labels and tried to refer to the languages.yaml file. But it doesn't work.

My default.yaml blueprint says:

YAML
form:
  fields:
    tabs:
      fields:
        options:
          fields:
            menuoptions:
              type: section
              title: Menuoptions
              underline: true

              fields:
                header.icon:
                  type: select
                  toggleable: true
                  label: THEME_THEMENAME:ICON
                  default: default
                  placeholder: Select Icon
                  data-options@: '\Grav\Theme\SilentR::iconList'

THEMENAME is of course within the languages.yaml file located in the theme's root folder

YAML
THEME_THEMENAME:
  ICON: My Icon

But it doesn't work. So I switched back to Antimatter and tried within the this file. Same result, the file is not taken in account. As last point I tried to print out the (within Anitmatter) to print out some of the 'standard' strings {{ BLOG.ITEM.CONTINUE_READING|e }}. Same result, even the frontend prints out the tag but not the translation. What am I missing?

last edited 11/21/17 by Michael
9 years ago

Certainly it is necessary to replace

TXT
label: THEME_THEMENAME:ICON

with

TXT
label: THEME_THEMENAME.ICON

The rest seems all right

9 years ago

Your right, - thanks - but changing it to
THEME_THEMENAME.ICON doesn't change it 😦
I still get it printed out in the admin panel…

27|690x72

last edited 11/21/17 by Michael

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Anna, 2 days ago
2 53 16 hours ago
Forms & Blueprints · by Anna, 3 days ago
7 82 16 hours ago
Forms & Blueprints · by Anna, 1 week ago
5 186 6 days ago
Forms & Blueprints · by TomW, 1 month ago
3 379 1 month ago
Forms & Blueprints · by Japhy, 2 months ago
2 595 2 months ago