Show the whole 404 page in Russian for missing pages under /ru/

Open
#14 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript

Research direction

Start with src/theme/NotFound/Content/index.js and i18n/ru/code.json to see how the 404 texts are already switched to Russian in the browser. Then find where the root 404.html is served for /ru/ paths and compare it with the built /ru/404.html. Done means a missing /ru/ URL shows a fully Russian page, with a Russian navbar, footer and links, and the choice between the two proposed approaches is recorded in the thread first.

Written by the indexing model from the issue text.

Description

Problem

GitHub Pages serves only the root 404.html for every missing path, and ignores 404.html files in subfolders. The root 404.html belongs to the default (English) build, so a broken link under /ru/, for example https://docs.lsfusion.org/ru/404/ or https://docs.lsfusion.org/ru/development_manual/, opens the English 404 page. The Russian page that Docusaurus builds at https://docs.lsfusion.org/ru/404.html is never used for such links.

The texts of the 404 page are now switched to Russian on these paths: src/theme/NotFound/Content/index.js takes them from i18n/ru/code.json in the browser. The rest of the page still comes from the English build:

  • the navbar and the footer are in English;
  • their links lead to the English pages, for example Learn leads to / instead of /ru/.

Possible solutions

  1. On a path under /ru/, redirect the root 404 page to /ru/404.html. The page becomes fully Russian, but the address bar shows /ru/404.html instead of the broken URL.
  2. On a path under /ru/, load /ru/404.html and replace the current document with it, keeping the URL. The page becomes fully Russian and the broken URL stays visible, but this relies on non-standard behaviour of a Docusaurus page and needs to be checked again after Docusaurus upgrades.
Dominant language
JavaScript
Stars
2
Forks
4
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lsfusion/docusaurus

All issues in lsfusion/docusaurus

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.