digidem / comapeo-core

A local-first library for collaborating on mapping projects
MIT License
8 stars 1 forks source link

Return translated values #935

Open tomasciccola opened 3 days ago

tomasciccola commented 3 days ago

Description

Currently, when listing observations, tags associated with them are return without translation. Returning the translated value of tags (but also additional translated values, see 934 would be helpful. A first version of this would be just returning the translated values of the language used by the user that recorded the observation. A better version of this would be returning all the translations for each value

gmaclennan commented 3 days ago

Could you explain the use-case for needing the data in the language used by the user, or needing all translations, as opposed to being able to specify the translation language via the REST API the same as we do via the regular API? ping @rudokemper

rudokemper commented 2 days ago

There are 2 use cases that I have in mind:

1) Retrieving translation strings for a specific language to be able to use on front ends. I think this need can be met by specifying the translation language via the REST API.

2) Retrieving all translation strings as a way to comprehensively archive a CoMapeo project in all dimensions - including config design in addition to collected data. The motivation here is to get as much of the CoMapeo project as possible, as we might not be able to anticipate future uses. For example, today we might need Tiriyo translations for a specific front end / output, but if the config was also translated to Wayana, then that may be useful years from now, and it would be good to retrieve that as well.

To illustrate further, the same logic would apply to a possible API feature to fetch icons. It would be nice to have these to use on front ends like a map view, but also to archive for safekeeping and future uses.