Skip to content
Grav 2.1 is out: every page speaks Markdown. 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 · 1318 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 complanar, 6 days ago
6 140 17 hours ago
Support · by Rick Beebe, 6 days ago
2 100 2 days ago
Support · by blu3prince, 3 days ago
0 52 3 days ago
Support · by alex, 4 days ago
2 92 3 days ago
Support · by Marcel, 2 weeks ago
1 143 4 days ago