msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
Other
23 stars 15 forks source link

Documentation links are not translated #4860

Closed mark-prins closed 1 month ago

mark-prins commented 1 month ago

What went wrong? 😲

When using the site in fr or es, when you click on the docs link in the LH nav, the docs site opens in en

Expected behaviour 🤔

For the languages which we have translated docs, please open the docs in that language. Simply append the language code to the docs root URL e.g.

link
Bad: https://docs.msupply.foundation/docs/getting_started/dashboard/
Good: https://docs.msupply.foundation/fr/docs/getting_started/dashboard/

Note the /fr after .foundation

How to Reproduce 🔨

Steps to reproduce the behaviour:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Your environment 🌱

mark-prins commented 1 month ago

Release team: can we get this into v2.3 please? It would be a quick one to change and to test

fergie-nz commented 1 month ago

Hey Mark,

I'm wondering where the triggers are missing? From what I can see, internal navigation within the docs is maintaining languages. Navigating to the docs from somewhere where it is missing?

roxy-dao commented 1 month ago

If you are in Open mSupply and click the doc links while in a language other than English, it redirects you to the docs page in English, but ideally it should redirect you to the docs in the language selected in Open mSupply if available.

mark-prins commented 1 month ago

In AppDrawer we have

  const docsUrl = `${ExternalURL.PublicDocs}${
    EnvUtils.mapRoute(location.pathname).docs
  }`;

where the PublicDocs is in the enum:

export enum ExternalURL {
  PublicDocs = 'https://docs.msupply.foundation/docs',
}

we'd just need to replace /docs with /fr/docs if the current language is French or /es/docs if Spanish. I'd do that in AppDrawer myself

fergie-nz commented 1 month ago

Ah perfect! Thank you

lache-melvin commented 1 month ago

closed by #4903

marthakeezy commented 2 weeks ago

Tested in V2.3.1-RC1, passed, moving to Done ✅