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.

Plugins

Grav's Login plugin text strings don't load in prooperly

Started by Ara Abcarians 6 years ago · 4 replies · 525 views
6 years ago

when using the grav login plugin's default /login page, any idea why the text strings dont function properly?

Screen Shot on 2020-04-16 at 10-55-16|645x500

the text for those all seem to be set in plugins/login/languages/en.yaml but are not being used by the plugin properly.

last edited 04/16/20 by Ara Abcarians
6 years ago

Could you be using a theme that override's the login plugin's template?

The template for the login form should be using Twig similar to {{ 'PLUGIN_LOGIN.BTN_LOGIN'|t }}. The login plugin allows changing your login form path too through route: in its YAML, so check that setting and then look up the corresponding template, starting with your active theme. When you find the active login template, mess around with it and tell us what you find out.

6 years ago

hey,

I'm using a custom theme I started with bin/plugin devtools new-theme and as far as i can tell I don't have anything overriding the template. I found the template within the login plugin and it seems to be using all the correct twig variables you mentioned {{ 'PLUGIN_LOGIN.BTN_LOGIN'|t }} if i remove the twig variables i can just put plain text in there and it works fine. Just confused at why the variables arent working as they should be.

6 years ago

I think i figured out the issue. My site is multi language, and my default language is en-us so i guess its not using the default en.yaml file for the variables. I duplicated en.yaml and created a en-us.yaml and now it works. Any way to get it to default to en.yaml or something if it cant detect a language?

Screen Shot on 2020-04-17 at 16-12-56|690x486

6 years ago

I started to look into this because I typically use 'en-NZ' and am certain I check the html element's rendered @lang routinely. I looked up a few sites and it does seem that the ones which use a theme sourcing grav.language.getActive now output a blank string. One I found that uses grav.language.getLanguage outputs it correctly for me. Hmm, I don't have time to look into this further now. These sites only support one language if that makes any difference.

So for science, what is your output from grav.language.getActive vs grav.language.getLanguage? My hypothesis is that one of these is broken, and it's the one being checked for translations.

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 49 1 week ago
Plugins · by Xavier, 4 weeks ago
2 57 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1184 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 50 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 75 2 months ago