Skip to content
SilktideHelp

How languages work

Silktide works out a primary language for every page it tests, because several checks cannot work without one: a spellchecker needs to know whether "colour" is correct, a grammar checker needs the right rules, and readability needs a formula calibrated for the language. If the language is wrong, those results are wrong too, so it is worth understanding how the language is decided.

A website can use one or many languages, and Silktide does its best to work out which applies to each page. Its best guess can be wrong, which is why every page records not just its language but where that language came from, and why you can correct it at every level.

Where a page's language comes from

For each page, Silktide uses the first of these that applies:

  1. Manual override. A language you set for that one page, from the language menu at the top of the Inspector.
  2. URL rule. A rule you created assigning a language to matching URLs, such as everything under /fr/. Rules are managed on the Languages screen.
  3. The page's own declaration. What the page says about itself in its lang attribute, reconciled against your website's configured languages (see below). This is used only when Trust page-declared language is on for the website.
  4. Website default. The first language configured for the website, used when nothing better is available.

The Languages screen shows each page's resolved language and which of these sources produced it, so you can audit exactly where every value came from.

Websites declare their expected languages

Every website in Silktide has one or more configured languages, set in the website's Advanced settings as its primary languages. These are the languages you expect the website to contain, and they anchor everything above:

  • They are the fallback when a page gives no usable signal.
  • They guide how a page's own declaration is interpreted. A page declaring plain en on a website configured for British English resolves to British English, and a declaration that exactly matches a configured language is used as-is.
  • Spelling checks against them, which is how "color" can be right on one website and wrong on another.

You can also add optional languages: languages the website may contain in places, which spelling should recognize without treating them as the norm. Optional languages do not change how a page's language is decided.

Trusting what pages declare

Trust page-declared language decides whether Silktide reads each page's lang attribute at all. Where it starts depends on the account:

  • On, for accounts that started on Silktide 5. Every website on the account starts with it on, so pages are tested in the language they declare, within the limits below.
  • Off, for accounts that came from Silktide 4. Every website on the account starts with it off, including websites added since, so they keep working as they did in Silktide 4: each page is tested in the website's first configured language unless a URL rule or a per-page override names another.

You can change it for any website in Advanced settings.

When it is on, Silktide uses a page's declaration when the declared language is:

  • one of the website's primary languages, or a variant of one; or
  • English, Spanish, Portuguese, French, German, Italian, Dutch or Chinese, even when the website does not list it. A declared variant Silktide knows, such as fr-CA on a US English website, is kept, and a declaration that leaves the variant open, such as plain fr, is resolved to a sensible regional default.

Any other declared language that the website does not list, such as Swedish on a website configured only for English, or a language Silktide does not recognize, such as Thai, is not used. The page is tested in the website's default language instead. To have those pages tested in their own language, add the language to the website's primary languages, or add a URL rule.

Trusting the page is usually right, but pages sometimes lie: a common template lang="en" on translated content is one of the most frequent causes of wrong spelling and grammar results. When that happens, fix the page's HTML if you can (it is also an accessibility issue), or override Silktide with a URL rule or a per-page override.

Correcting the language

  • One page is wrong: open it in the Inspector and set the language from the dropdown at the top. This beats every other source.
  • A section is wrong: add a URL rule on the Languages screen, for example assigning French to every URL starting /fr/. First matching rule wins.
  • Everything is wrong: check the website's configured languages in Advanced settings, and whether Trust page-declared language is on. Websites on an account from Silktide 4 start with it off, so every page without a rule or override is tested in the first configured language.

Changes to rules and settings take effect on the next test. An Inspector override changes the page's language straight away and is kept across retests, but the page's spelling, grammar and readability results only change when it is next tested. Use Retest in the Inspector to see them now.

What the language affects

  • Spelling checks words against dictionaries for the website's languages and for the page's own language, plus your spelling dictionary. A word is accepted if any of them contains it, so a Spanish page on an English website is checked in both. A per-page override or URL rule that names another variant of the website's language, such as British English on a US English website, replaces it on that page, so American spellings are reported there.
  • Grammar checks each page in one language: the one the page names (a per-page override, a URL rule, or its declared language when trusted), or the website's language when it has only one. A page that could be in several of the website's languages, and does not say which, is not grammar-checked rather than checked against the wrong rules.
  • Readability scores each page with the formula for its resolved language, chosen in readability settings. Silktide scores 29 languages, each with its own formula; the few it does not score yet, such as Arabic, Chinese and Japanese, are listed there. Because the formula follows the resolved language rather than the text, a page resolved to the wrong language is measured with the wrong formula. Silktide leaves a page unscored when its text is not written in that language's alphabet, for example Thai text on a page tested as English. A page in another language that uses the same alphabet, such as Swedish text tested as English, is still scored, so check its language.
  • Accessibility checks also care: a page whose declared language does not match its content is itself a failure, because pronounce the page using the declared language.

Learn more

Last updated

Was this page helpful?