DigitalCommons / mykomap

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

Mykomap contains hard-wired terms for "country" #177

Closed wu-lee closed 1 year ago

wu-lee commented 1 year ago

Specifically lines like this in view/sidebar/directory.ts

const fieldIsCountries = field => field == "Countries" || field == "Des Pays" || field == "Países" || field == "국가" 
ColmDC commented 1 year ago

Did you resolve this one in your last purge? It's not something I can test.

wu-lee commented 1 year ago

It's not resolved yet. Currently the most obvious way to resolve it is to use a single default term for the "Any" case (translated into the appropriate language).

But that would mean that maps which once showed "All Countries" for this case would then instead show "Any" (or whatever we chose).

If we want something which adapts to the case of the vocab in use, we need a new feature to support that, which allows vocabs to supply their own localised phrases for this case, and/or some way to augment existing vocabs through configuration - but that latter's going to make things more complicated by adding more special cases, I think.

wu-lee commented 1 year ago

I've made the hardwiring a bit less of a fragile hack: instead of checking the translated word against a fixed list of translated words (which may not include all the languages being supported in future), it now looks up the Vocab URI and sees if it matches ^https?://.*/countries-iso/?$ - or in other words, looks like one of the the countries-iso vocabs.

It obviously only works on vocab fields - however I don't think we currently use any country fields which aren't for the directory. This hack is mostly here to support ICA and DotCoop.

From a robustness point of view, still better if they make do with a generic "All Entries" title.

ColmDC commented 1 year ago

For OBO, it says All Entries where ICA says All Counties. Is that hacked in the same way?

ColmDC commented 1 year ago

I think let's drop the use of All Countries ans just use the easier to handle All Entries acroess the board.

wu-lee commented 1 year ago

This is now done - All Items is used in all cases.

Will be deployed to testing with the next batch of fixes.

ColmDC commented 1 year ago

Confirmed that that All Entries is now being used in https://dev.dotcoop.solidarityeconomy.coop/