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

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

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

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.


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.

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?

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.