Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wu-lee opened this issue Sep 21, 2021 · 4 comments
Closed

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

wu-lee opened this issue Sep 21, 2021 · 4 comments
Assignees

Comments

@wu-lee
Copy link
Contributor

wu-lee commented Sep 21, 2021

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 DigitalCommons/mutual-aid-project#2 (comment)

@wu-lee
Copy link
Contributor Author

wu-lee commented Nov 17, 2021

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

I've solved it by:

  • Passing the default graph info back to osea-map with the SPARQL query results (otherwise it doesn't know the data source link to use)
  • Always listing these data URLs in the about config (as before, localised, but no longer hardwired, and catering for multiple data sets)
  • Also always listing a link to the sea-map technical documentation (as before)
  • Now inserting the about.html text at the top (as it used to be), except
  • Before inserting, remove any HTML tags with a lang attribute which isn't the target language code

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
Copy link
Contributor

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

@wu-lee
Copy link
Contributor Author

wu-lee commented Nov 18, 2021

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:

@wu-lee wu-lee self-assigned this Nov 18, 2021
@ColmMassey
Copy link
Contributor

Very nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants