codeforIATI / iati-datastore

An open-source datastore for IATI data with RESTful web API providing XML, JSON, CSV plus ETL tools
https://datastore.codeforiati.org
Other
1 stars 1 forks source link

Internationalising CSV output #341

Open markbrough opened 2 years ago

markbrough commented 2 years ago

Is your feature request related to a problem? Please describe.

Users can now select different languages in the front-end interface. However, the data is still output in EN.

Describe the solution you’d like

For CSV and Excel exports:

NB relevant codelists can be retrieved from here: https://codelists.codeforiati.org/

The initially-supported languages should be: EN, FR, ES, PT

Note that we don't yet have complete translations for every codelist in each of these languages, but we will work on this separately.

Describe alternatives you’ve considered

Using CDFD: https://countrydata.iatistandard.org

Additional context

Add any other context or screenshots about the feature request here.

odscjames commented 2 years ago

Also Excel.

& also headers of Excel/CSV

markbrough commented 2 years ago

This is the Enum type: https://github.com/codeforIATI/iati-datastore/blob/main/iati_datastore/iatilib/codelists/enum.py

odscjames commented 2 years ago

Can roll out a bit at a time - do other 2 first then ENUM one. May want to rewrite ENUM handling at same time.

markbrough commented 2 years ago

I updated the description a little bit providing a breakdown of required work

radix0000 commented 2 years ago

Have begun looking a this, have a couple of clarifying questions see below.

radix0000 commented 2 years ago

Description types

radix0000 commented 2 years ago

Locales

markbrough commented 2 years ago

Hello @radix0000 and welcome! Looking forward to working together, especially after such an insightful first few comments here :)

Description types - you are right. We should keep all description types, and yes we should add these as new columns. Your column headers are good. Also agree with description_general containing a fall-back to the most general description if there is not a description of type 1.

Locale - I agree that it is nice to be flexible with which languages we can support, but there are a number of constraints:

  1. the IATI data - we will use this for titles and descriptions, and are dependant on whether or not a publisher has published these in a particular language
  2. codelists - so far, codelists have been translated into:
  3. interface - so far, the Datastore interface has been translated into:
    • French
    • Portuguese
  4. CSV headers - we haven't yet translated any of these but we can use some text we have translated elsewhere to do this quite quickly at least for FR, and I think probably for ES and PT.

The internationalisation of the output will depend particularly on (2) above, and the accessibility will depend on (3), so requesting another language might not get the user very far. But if it is not complicated to implement then why not allow other languages and fall back to EN CSV headers and codelists if these are not available in the requested language?

NB the preferred language is already automatically set if the user's language is other than English -- try changing the preferred language in your browser and then going to the interface. I can see why you might want to download French versions of the files using the English interface but I don't think we should bother worrying about that right now, as the user can just switch to the French interface.