Seneca-CDOT/telescope

Broken links when changing language

sirinoks opened this issue · 3 comments

When changing language to a different one in Overview page, it says "page not found". It used to work at some point, but likely, when we added more translations, something broke.

image

Location

In \src\web\docusaurus

URL:
/docs/overview

To run Docusaurus:

  • cd src\web\docusaurus
  • npm install
  • npm run start
  • Click 'Docs' button top left corner

And try different locale options, such as

  • npm run start -- --locale uk

You can find different language options in src\web\docusaurus\docusaurus.config.js.
Specifically - locales: ['en', 'vi', 'uk', 'zh', 'bg'],

To reproduce

Click around in
image
And change the

  • npm run start -- --locale
    languages and see how these links don't lead to each others' appropriate page.

image

Possible fixes

Look into placement of languages src\web\docusaurus\docusaurus.config.js, it might be broken because of positioning mismatch.
Also look into each of src\web\docusaurus\i18n folders for each language.

---
sidebar_position: X
---

mismatch could have also caused this.

More information:

This issue only affects one of the multiple ways docusaurus can be used.
To be more specific:

  • ✔️ working

    • Using nginx to serve docusaurus. (this is what we do for staging and production).
    • Running pnpm build and then pnpm serve. Using these scripts, the overview page can be accessed in any language.
  • ✖️ not working

    • Running pnpm start. Overview pages cannot be accessed this way.

So the fix should only address this specific case, and make sure all the others are not affected.

@manekenpix Do we even care then if it doesn't work when you launch it differently?

@sirinoks I'm not sure. I'm not very familiar with "our" docusaurus, so my guess was that pnpm start is used for local development (rerunning nginx or pnpm build && pnpm serve every time you make a change would probably be a huge pain in the neck), so fixing this seemed like a good idea to me.

Maybe contributors who already worked on our docs can give a better answer?