Skip to content

Commit

Permalink
[Feature] Add translated descriptions to checks (#54)
Browse files Browse the repository at this point in the history
* Add translated check descriptions

* Fix styling

---------

Co-authored-by: Baspa <[email protected]>
  • Loading branch information
Baspa and Baspa authored Jan 25, 2024
1 parent 2cb86b7 commit 3359529
Show file tree
Hide file tree
Showing 28 changed files with 183 additions and 25 deletions.
24 changes: 24 additions & 0 deletions resources/lang/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
{
"All links on the page should redirect to an url using HTTPS instead of HTTP because this is more secure.": "All links on the page should redirect to an url using HTTPS instead of HTTP because this is more secure.",
"CSS files are not bigger than 15 KB because this will slow down the page load time.": "CSS files are not bigger than 15 KB because this will slow down the page load time.",
"Every image on the page should have an alt tag to describe the image.": "Every image on the page should have an alt tag to describe the image.",
"HTML is not larger than 100 KB because this will slow down the page load time.": "HTML is not larger than 100 KB because this will slow down the page load time.",
"Images are not larger than 1 MB because this will slow down the page load time.": "Images are not larger than 1 MB because this will slow down the page load time.",
"Javascript files are not bigger than 1 MB because this will slow down the page load time.": "Javascript files are not bigger than 1 MB because this will slow down the page load time.",
"The HTML of the page should be GZIP compressed to reduce the size of the response.": "The HTML of the page should be GZIP compressed to reduce the size of the response.",
"The Time To First Byte (TTFB) should be below 600 ms because this will improve the page load time.": "The Time To First Byte (TTFB) should be below 600 ms because this will improve the page load time.",
"The content should contain at least 30% transition words.": "The content should contain at least 30% transition words.",
"The content should not contain sentences with more than 20 words.": "The content should not contain sentences with more than 20 words.",
"The focus keyword should be in the first paragraph of the content because this is the most important part of the content.": "The focus keyword should be in the first paragraph of the content because this is the most important part of the content.",
"The focus keyword should be in the title of the page because the visitor will see this in the search results.": "The focus keyword should be in the title of the page because the visitor will see this in the search results.",
"The lang attribute should be set because this is used by search engines to determine the language of the page.": "The lang attribute should be set because this is used by search engines to determine the language of the page.",
"The length of the content should be at least 2100 characters.": "The length of the content should be at least 2100 characters.",
"The meta description is used by search engines to show a description of the page in the search results.": "The meta description is used by search engines to show a description of the page in the search results.",
"The page response should return a 200 status code because this means the page is available.": "The page response should return a 200 status code because this means the page is available.",
"The page should have an Open Graph image because this is the image that will be used when the page is shared on social media.": "The page should have an Open Graph image because this is the image that will be used when the page is shared on social media.",
"The page should have only one H1 tag because there should be only one main heading on the page. The H1 tag should be used to describe the main topic of the page. The H1 tag is also used by search engines to determine the topic of the page.": "The page should have only one H1 tag because there should be only one main heading on the page. The H1 tag should be used to describe the main topic of the page. The H1 tag is also used by search engines to determine the topic of the page.",
"The page should not contain any broken images because it is bad for the user experience.": "The page should not contain any broken images because it is bad for the user experience.",
"The page should not contain any broken links because it is bad for the user experience.": "The page should not contain any broken links because it is bad for the user experience.",
"The robots.txt file should allow indexing of the page.": "The robots.txt file should allow indexing of the page.",
"The title of the page should not be longer than 60 characters because this is the maximum length that is shown in the search results.": "The title of the page should not be longer than 60 characters because this is the maximum length that is shown in the search results.",
"When the page has the 'nofollow' tag or meta tag set, search engines will not follow the links on the page.": "When the page has the 'nofollow' tag or meta tag set, search engines will not follow the links on the page.",
"When the page has the 'noindex' tag or meta tag set, search engines will not index the page.": "When the page has the 'noindex' tag or meta tag set, search engines will not index the page.",
"accordingly": "accordingly",
"additionally": "additionally",
"admittedly": "admittedly",
Expand Down
26 changes: 25 additions & 1 deletion resources/lang/nl.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
{
"All links on the page should redirect to an url using HTTPS instead of HTTP because this is more secure.": "Alle links op de pagina moeten doorverwijzen naar een URL met HTTPS in plaats van HTTP omdat dit veiliger is.",
"CSS files are not bigger than 15 KB because this will slow down the page load time.": "CSS-bestanden zijn niet groter dan 15 KB omdat dit de laadtijd van de pagina zal vertragen.",
"Every image on the page should have an alt tag to describe the image.": "Elke afbeelding op de pagina moet een alt-tag hebben om de afbeelding te beschrijven.",
"HTML is not larger than 100 KB because this will slow down the page load time.": "HTML is niet groter dan 100 KB omdat dit de laadtijd van de pagina zal vertragen.",
"Images are not larger than 1 MB because this will slow down the page load time.": "Afbeeldingen zijn niet groter dan 1 MB omdat dit de laadtijd van de pagina zal vertragen.",
"Javascript files are not bigger than 1 MB because this will slow down the page load time.": "Javascript-bestanden zijn niet groter dan 1 MB omdat dit de laadtijd van de pagina zal vertragen.",
"The HTML of the page should be GZIP compressed to reduce the size of the response.": "De HTML van de pagina moet GZIP-gecomprimeerd zijn om de grootte van de response te verkleinen.",
"The Time To First Byte (TTFB) should be below 600 ms because this will improve the page load time.": "De Time To First Byte (TTFB) moet onder de 600 ms zijn, omdat dit de laadtijd van de pagina zal verbeteren.",
"The content should contain at least 30% transition words.": "De inhoud moet ten minste 30% overgangswoorden bevatten.",
"The content should not contain sentences with more than 20 words.": "De inhoud mag geen zinnen bevatten met meer dan 20 woorden.",
"The focus keyword should be in the first paragraph of the content because this is the most important part of the content.": "Het focus-trefwoord moet in de eerste alinea van de inhoud staan omdat dit het belangrijkste deel van de inhoud is.",
"The focus keyword should be in the title of the page because the visitor will see this in the search results.": "Het focus-trefwoord moet in de titel van de pagina staan omdat de bezoeker dit in de zoekresultaten zal zien.",
"The lang attribute should be set because this is used by search engines to determine the language of the page.": "Het lang-attribuut moet worden ingesteld omdat dit door zoekmachines wordt gebruikt om de taal van de pagina te bepalen.",
"The length of the content should be at least 2100 characters.": "De lengte van de inhoud moet ten minste 2100 tekens zijn.",
"The meta description is used by search engines to show a description of the page in the search results.": "De meta-beschrijving wordt door zoekmachines gebruikt om een beschrijving van de pagina in de zoekresultaten weer te geven.",
"The page response should return a 200 status code because this means the page is available.": "De pagina moet een 200 statuscode retourneren, omdat dit betekent dat de pagina beschikbaar is.",
"The page should have an Open Graph image because this is the image that will be used when the page is shared on social media.": "De pagina moet een Open Graph-afbeelding hebben omdat dit de afbeelding is die wordt gebruikt wanneer de pagina wordt gedeeld op sociale media.",
"The page should have only one H1 tag because there should be only one main heading on the page. The H1 tag should be used to describe the main topic of the page. The H1 tag is also used by search engines to determine the topic of the page.": "De pagina moet slechts één H1-tag hebben omdat er slechts één hoofdonderwerp op de pagina moet zijn. De H1-tag moet worden gebruikt om het hoofdonderwerp van de pagina te beschrijven. De H1-tag wordt ook door zoekmachines gebruikt om het onderwerp van de pagina te bepalen.",
"The page should not contain any broken images because it is bad for the user experience.": "De pagina mag geen kapotte afbeeldingen bevatten omdat dit slecht is voor de gebruikerservaring.",
"The page should not contain any broken links because it is bad for the user experience.": "De pagina mag geen kapotte links bevatten omdat dit slecht is voor de gebruikerservaring.",
"The robots.txt file should allow indexing of the page.": "Het robots.txt-bestand moet indexering van de pagina toestaan.",
"The title of the page should not be longer than 60 characters because this is the maximum length that is shown in the search results.": "De titel van de pagina mag niet langer zijn dan 60 tekens omdat dit de maximale lengte is die in de zoekresultaten wordt weergegeven.",
"When the page has the 'nofollow' tag or meta tag set, search engines will not follow the links on the page.": "Wanneer de pagina de 'nofollow'-tag of meta-tag heeft, zullen zoekmachines de links op de pagina niet volgen.",
"When the page has the 'noindex' tag or meta tag set, search engines will not index the page.": "Wanneer de pagina de 'noindex'-tag of meta-tag heeft, zullen zoekmachines de pagina niet indexeren.",
"accordingly": "overeenkomstig",
"additionally": "daarnaast",
"admittedly": "toegegeven",
Expand Down Expand Up @@ -114,4 +138,4 @@
"while it is true": "terwijl het waar is",
"without a doubt": "zonder twijfel",
"yet": "toch"
}
}
6 changes: 5 additions & 1 deletion src/Checks/Configuration/NoFollowCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
use Symfony\Component\DomCrawler\Crawler;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class NoFollowCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = "The page does not have 'nofollow' set";

public string $description = "When the page has the 'nofollow' tag or meta tag set, search engines will not follow the links on the page.";

public string $priority = 'low';

public int $timeToFix = 5;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Configuration/NoIndexCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
use Symfony\Component\DomCrawler\Crawler;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class NoIndexCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = "The page does not have 'noindex' set";

public string $description = "When the page has the 'noindex' tag or meta tag set, search engines will not index the page.";

public string $priority = 'low';

public int $timeToFix = 5;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Configuration/RobotsCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
use vipnytt\RobotsTxtParser\UriClient;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class RobotsCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = 'Robots.txt allows indexing';

public string $description = 'The robots.txt file should allow indexing of the page.';

public string $priority = 'low';

public int $timeToFix = 5;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Content/AltTagCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
use Symfony\Component\DomCrawler\Crawler;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class AltTagCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = 'Every image has an alt tag';

public string $description = 'Every image on the page should have an alt tag to describe the image.';

public string $priority = 'low';

public int $timeToFix = 5;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Content/BrokenImageCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
use Symfony\Component\DomCrawler\Crawler;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class BrokenImageCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = 'The page contains no broken images';

public string $description = 'The page should not contain any broken images because it is bad for the user experience.';

public string $priority = 'medium';

public int $timeToFix = 10;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Content/BrokenLinkCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
use Symfony\Component\DomCrawler\Crawler;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class BrokenLinkCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = 'The page contains no broken links';

public string $description = 'The page should not contain any broken links because it is bad for the user experience.';

public string $priority = 'medium';

public int $timeToFix = 10;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Content/ContentLengthCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
use Symfony\Component\DomCrawler\Crawler;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class ContentLengthCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = 'Length of the content is at least 2100 characters';

public string $description = 'The length of the content should be at least 2100 characters.';

public string $priority = 'low';

public int $timeToFix = 30;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Content/KeywordInFirstParagraphCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
use Symfony\Component\DomCrawler\Crawler;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class KeywordInFirstParagraphCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = 'The page has the focus keyword in the first paragraph';

public string $description = 'The focus keyword should be in the first paragraph of the content because this is the most important part of the content.';

public string $priority = 'medium';

public int $timeToFix = 10;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Content/KeywordInTitleCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
use Symfony\Component\DomCrawler\Crawler;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class KeywordInTitleCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = 'The page has the focus keyword in the title';

public string $description = 'The focus keyword should be in the title of the page because the visitor will see this in the search results.';

public string $priority = 'medium';

public int $timeToFix = 1;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Content/MixedContentCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
use Symfony\Component\DomCrawler\Crawler;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class MixedContentCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = 'All links redirect to an url using HTTPS';

public string $description = 'All links on the page should redirect to an url using HTTPS instead of HTTP because this is more secure.';

public string $priority = 'high';

public int $timeToFix = 1;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Content/MultipleHeadingCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
use Symfony\Component\DomCrawler\Crawler;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class MultipleHeadingCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = 'The page has an H1 tag and if it is used only once per page';

public string $description = 'The page should have only one H1 tag because there should be only one main heading on the page. The H1 tag should be used to describe the main topic of the page. The H1 tag is also used by search engines to determine the topic of the page.';

public string $priority = 'low';

public int $timeToFix = 1;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Content/TooLongSentenceCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\Actions;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class TooLongSentenceCheck implements Check
{
use Actions,
PerformCheck;
PerformCheck,
Translatable;

public string $title = 'Too long sentence check';

public string $description = 'The content should not contain sentences with more than 20 words.';

public string $priority = 'medium';

public int $timeToFix = 30;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Content/TransitionWordRatioCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\Actions;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class TransitionWordRatioCheck implements Check
{
use Actions,
PerformCheck;
PerformCheck,
Translatable;

public string $title = 'Transition word ratio check';

public string $description = 'The content should contain at least 30% transition words.';

public string $priority = 'medium';

public int $timeToFix = 60;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Meta/DescriptionCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
use Symfony\Component\DomCrawler\Crawler;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class DescriptionCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = 'The page has a meta description';

public string $description = 'The meta description is used by search engines to show a description of the page in the search results.';

public string $priority = 'medium';

public int $timeToFix = 1;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Meta/LangCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
use Symfony\Component\DomCrawler\Crawler;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class LangCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = 'The lang attribute is set on the html tag';

public string $description = 'The lang attribute should be set because this is used by search engines to determine the language of the page.';

public string $priority = 'medium';

public int $timeToFix = 1;
Expand Down
6 changes: 5 additions & 1 deletion src/Checks/Meta/OpenGraphImageCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
use Symfony\Component\DomCrawler\Crawler;
use Vormkracht10\Seo\Interfaces\Check;
use Vormkracht10\Seo\Traits\PerformCheck;
use Vormkracht10\Seo\Traits\Translatable;

class OpenGraphImageCheck implements Check
{
use PerformCheck;
use PerformCheck,
Translatable;

public string $title = 'The page has an Open Graph image';

public string $description = 'The page should have an Open Graph image because this is the image that will be used when the page is shared on social media.';

public string $priority = 'medium';

public int $timeToFix = 20;
Expand Down
Loading

0 comments on commit 3359529

Please sign in to comment.