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.

Support

Grav 1.7 Yamllinter does not detect failing translation files

Solved by pamtbaau View solution

Started by Filippo Masoni 5 years ago · 4 replies · 1155 views
5 years ago

I have updated my starter theme that I use as a base for new websites to Grav 1.7. Everythink works, it took a while to understand that I had to escape every {{ content }} with |raw as even enabling twig compatibility or disabling autoescape variables didn't seem to make a difference. So now I have blueprint and twig compatibility disabled and everything works, but if I disable yaml compatibility I get an exception: "Failed to read en.yaml: Duplicate key "OUTOFSTOCK" detected at line 57 (near "OUTOFSTOCK: "Out of Stock"")."
Yaml linter is not reporting any error, both on the admin and with CLI.
How can I check to see if my old yaml files are correct, where do I check the syntax?

5 years ago Solution

@filo91, It seems Admin is only running Yamllinter with default settings. Also, command $ bin/grav yamllinter does not check yaml files in e.g. translations folders.

The following command will recurse the entire Grav folder tree including any translations folder:

BASH
$ bin/grav yamllinter --all
5 years ago

Awesome, thank you for the suggestion. I wish that was included in the documentation.

I actually found an issue with the plugin SEO, the language files had a duplicate key. It hasn't been updated in 2 years, so I guess they'll not change it soon. Fixed it and everything works without compatibility turned off.

5 years ago

@filo91, There still seems to be some activity of the owner...

Also, a Pull Request has been issued on 2021/02/22, to fix the issue.
You might want to subscribe to the PR to get notified of its progress.

👍 1

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 60 16 hours ago
Support · by Anna, 3 days ago
2 66 19 hours ago
Support · by Justin Young, 20 hours ago
1 34 20 hours ago
Support · by Duc , 1 week ago
2 70 6 days ago
Support · by Colin Hume, 1 week ago
2 61 6 days ago