DigitalCommons / mykomap

A web application for mapping initiatives in the Solidarity Economy
3 stars 0 forks source link

Remove hardwired link for ICA data in internationalised about page #125

Closed wu-lee closed 2 years ago

wu-lee commented 2 years ago

I noticed that the "about" page is now generated programmatically inside sea-map using internationalised labels, so that the about.html is redundant, but also, this code hardwires a link to the ICA source data, so something needs to be done about that (currently this info isn't easily accessible in the browser-side)

We should also think about what to do with the old about.html config. Should we keep it as is, improve it somehow, or remove it? (If we keep it we need to support internationalisation.)

Originally posted by @wu-lee in https://github.com/SolidarityEconomyAssociation/mutual-aid-project/issues/2#issuecomment-923751083

wu-lee commented 2 years ago

This has been implemented, and is currently running on the dev-1 deployment of owned-by-oxford.

I've solved it by:

So now a single about.html file can provide localised content, by putting the different languages inside div elements like this:

<div lang="EN"> This is English</div>
<div lang="FR">Ce si est en Francais</div>
This text is left in whatever the language

If the about.html file is not provided, then there is no text at the top, just the links (with localised text)

I've also added more validation so that only a those language codes listed in the config.json file attribute languages are allowed, anything else, including oddly formed language codes, will default back to the first language code listed in languages (which must contain at least one).

ColmMassey commented 2 years ago

Nice. How can I test this? @wu-lee

wu-lee commented 2 years ago

Well, I can upload some multi-language about text on ObO, and enable more than one language in the config?

I've set it to this:

<!DOCTYPE html>
<html>
  <body>
    <div lang="EN">
      <h3>Owned by Oxford</h3>
      <p>The map has been created by the Solidarity Economy Association.</p>
    </div>
    <div lang="FR">
      <h3>Propriété d'Oxford</h3>
      <p>La carte a été réalisée par l'Association Economie Solidaire.</p>
    </div>
    <div lang="KO">
      <h3>스포드 소유</h3>
      <p>지도는 연대경제협회에서 만들었습니다.</p>
    </div>
  </body>
</html>

And enabled languages EN, FR, and KO. You can check these do what you expect:

ColmMassey commented 2 years ago

Very nice.