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.

Forms & Blueprints

Theme doesn't use languages.yaml for label translations

Started by Michael 9 years ago · 3 replies · 985 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 Ton Haarmans, 5 years ago
13 1135 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 61 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 134 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 108 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 128 7 months ago