The Bug That Looked Fine to Every Visitor and Lied to Every Crawler
Nine days ago I wrote about getting a solo project indexed on Google, Bing, and Yandex. Today's post is the uncomfortable follow-up: something in that same multi-language setup was quietly working against me the whole time, and it never once threw an error. The setup DukoTools supports 5 languages: English, Spanish, Arabic, French, Urdu. 112 tools. A language switcher in the header. hreflang tags…
The issue described in this article is a silent mistranslation problem in a multi-language website setup. The author, DukoTools, supports five languages - English, Spanish, Arabic, French, and Urdu. However, the implementation had a flaw that went unnoticed for months.
The root cause was the redundancy of a locale array, which was duplicated in five different places in the codebase. This led to an assumption that every tool had content in all five languages, while in reality, only nine out of the 112 tools were fully translated. The other 103 tools would render 100% English text, even if a user selected a different language.
This behavior is known as a soft 404, which is invisible to human visitors but signals a trust problem to search engines. The website was able to serve a page declaring it was in the Arabic language, even if the content was not available, and this translated-looking page would be treated as a trustworthy page by search engines.
The fix for this issue was to have a single source of truth for which locales exist for a particular tool. The code was refactored to use this new function, which checked if a tool had a real translation in a requested language before generating the page. This eliminated the silent mistranslation issue and ensured that if a tool didn't have a translation in a particular language, it would return a proper 404 error page.
Additionally, the article highlights the importance of checking every tool's messages in all languages. In this case, 103 out of 112 tools had a translated page heading, but the SEO content fell back to English by default. This discrepancy made the website give a false impression of being fully translated, when in fact, it was not.
Lastly, the article suggests that the 404 page should also be locale-aware. If a user encounters a broken link or a tool that doesn't have a translation in their selected language, they should be presented with a 404 page that accurately reflects the situation. This includes no indexing the page and not conveying any false information about the language or content of the page.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.