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

Add support for localised title of a drop-down filter in the search panel #200

Closed
ColmDC opened this issue Apr 1, 2023 · 12 comments
Closed
Assignees

Comments

@ColmDC
Copy link
Contributor

ColmDC commented Apr 1, 2023

Is your feature request related to a problem? Please describe.
In order to support multiple filters using the same vocabulary in the search panel, we can no longer easily provide localisation for drop down titles. Specifically, by enabling support for having a filter for the combined Primary and Secondary activities and also one for just primary activities, we then broke the localised titles for the ICA filters. We were able to support the ICA localised titles before, because it had only one filter per vocab.

Describe the solution you'd like
Make it possible to configure localised titles for filters in the search panel. It needs to support the old ICA arrangement in [email protected]_981470f as well as support nice titles (not identifier names in camel format) for the OBO panel.

** Considerations **
When looking at this, consider if this change would also easily support other map specific localisations. For example, we may have the localised label of a field to hand, but it was chosen by someone technical and is an accurate title, but we are displaying a map for a non technical audience, so want something friendlier, can we support that?

** Estimate **
I've not looked at that closely yet, estimate it might be hours to a day on mykomap,

@ColmDC
Copy link
Contributor Author

ColmDC commented Apr 1, 2023

From element thread
I think the sensible thing might be just to hand-craft these sorts of vocabs and include the json file along with things like the HTML and CSS, in the map project, to be deployed on the website.)

An example of the kind of thing I mean: this file is deployed along with a map website. It has one vocab, activities-modified, in English only. (Ignore the meta field, it's informational only, not required.) https://dev.maps.solidarityeconomy.coop/temp/obo-public/vocabs.json

Which is approximately equivalent to: https://github.com/DigitalCommons/map-sse/blob/ica10-draft-locality-vocabs/vocabs/standard/activities-modified.ttl

(Although that vocabs.json is still there only by historical accident. It should be removed. ObO should be using one generated by the sausage factory and deployed with the ObO RDF and CSV files if we want it to update whenever - if! - the vocab changes.)

@ColmDC
Copy link
Contributor Author

ColmDC commented Apr 1, 2023

So what would the workflow of this look like for both ICA and OBO requirements?

@wu-lee
Copy link
Contributor

wu-lee commented Apr 3, 2023

For ICA, perhaps define a field-vocabs.json file, and add it to the ICA map project as an asset deployed along with the HTML and JS. It might look like this (abbreviated) example:

{
  "prefixes": {
    "https://dev.lod.coop/ica/ui/": "ui"
  },
  "meta": { // elided...
  },
  "vocabs": {
    "ui:": {
      "EN": {
        "title": "ICA Map UI phrases",
        "terms": {
          "ui:primaryActivity": "Primary Activity",
          "ui:activities": "Secondary Activities",
          "ui:regOrg": "Organisational Structure",
          "ui:baseMembershipType": "Typology",
          // etc...
        }
      }
    }
  }
}

Mykomap already knows how to load these files, which are currently used to define vocabs. We would need to teach Mykomap that custom fields should be localised using a vocab, perhaps by telling it which vocab (or vocabs) to use in the config. Then, when it renders a field called primaryActivity it looks up the localised title for the current language in this vocab and gets "Primary Activity".

We can use this for other localisation purposes - it probably solves the problem we have from having hard-wired localisation in Mykomap's source code for just EN, FR, ES, KO, because we could define the entire UI's localisation like this, and use it to add or over-ride built-in phrases. Perhaps with a bit of thought it would work for spacial-casing things like "All Countries" too? (Although there still needs some way of recognising the need to special-case.)

(Ditto for Owned by Oxford, but with different languages and phrases)

@ColmDC
Copy link
Contributor Author

ColmDC commented Apr 7, 2023

teach Mykomap

Finally we are going to use AI in this project!

@wu-lee
Copy link
Contributor

wu-lee commented May 8, 2023

Possible duplicate of #199?

@ColmDC
Copy link
Contributor Author

ColmDC commented May 10, 2023

Perhaps they are both addressed with the same new finctionality, but with this ticket I wanted to be support the ability for an ICA map to call the Typology Filter 'Typology' and other maps to call it 'Base Member Type', say, which I didn't think would necessaroity be a consequence of solving #199.

@wu-lee
Copy link
Contributor

wu-lee commented May 15, 2023

I think it would be solved by #199 - the localisations for the ICA could be different. See also #178 (comment)

@wu-lee
Copy link
Contributor

wu-lee commented Sep 11, 2023

This is now implemented in the 3.1.0 release of Mykomap, and is utilised in the latest Dotcoop2023 demo map here: https://dev.maps.solidarityeconomy.coop/temp/dotcoop2023/

@ColmDC
Copy link
Contributor Author

ColmDC commented Sep 11, 2023

Possible duplicate of #199?

So did we decide if this was Duplicate of this? #199 seems to have suggestions for some documentation there, so wouldn't want to close it too quickly.

@ColmDC
Copy link
Contributor Author

ColmDC commented Sep 11, 2023

This is now implemented in the 3.1.0 release of Mykomap, and is utilised in the latest Dotcoop2023 demo map here: https://dev.maps.solidarityeconomy.coop/temp/dotcoop2023/

Looking good. Can we also validate by upgrading the ICA map on dev to 3.1.0 and use the old terms for Topology etc.?

@ColmDC
Copy link
Contributor Author

ColmDC commented Sep 22, 2023

Which other recently updated map(s) demonstrates this functionality working? @wu-lee

@ColmDC
Copy link
Contributor Author

ColmDC commented Sep 25, 2023

Which other recently updated map(s) demonstrates this functionality working? @wu-lee

https://dev.maps.solidarityeconomy.coop/ncba/ of course.

So closing this. Will be nice upgrade other to 3.1.0 in good time.

@ColmDC ColmDC closed this as completed Sep 25, 2023
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