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 →

Grav 1.7 Yamllinter does not detect failing translation files

Solved by pamtbaau View solution

Started by Filippo Masoni 6 years ago · 4 replies · 1473 views
6 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?

6 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
6 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.

6 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 TomW, 2 weeks ago
8 227 9 hours ago
Support · by alex, 2 months ago
8 667 23 hours ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 159 3 days ago
Support · by TomW, 6 days ago
2 106 5 days ago