Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Grav 1.7 Yamllinter does not detect failing translation files

Solved by pamtbaau View solution

Started by Filippo Masoni 6 years ago · 4 replies · 1367 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 webmasterodp, 1 week ago
4 172 1 week ago
Support · by nwhitfield, 1 week ago
2 150 1 week ago
Support · by stell, 3 weeks ago
5 381 2 weeks ago
Support · by gravinator, 1 month ago
5 574 2 weeks ago
Support · by Gravver, 3 weeks ago
6 360 3 weeks ago