concrete-datastore icon indicating copy to clipboard operation
concrete-datastore copied to clipboard

Ability to add a language as queryparams for `export`

Open KhaledBousrih opened this issue 5 years ago • 1 comments

export endpoint should be able to accept the queryparam ?lang= with the value of the language desired for the export (for example fr).

If this queryparam exists, the following should be transalted to the selected language:

  • Booleans: for example if ?lang=fr, True becomes VRAI and False becomes FAUX
  • datetime and date fields: the value of pendulum with the right locale set should be returned in the format: YYYY/MM/DD HH:mm:ss
  • csv headers: the name of the files should be translated depending on a setting in concrete datatsore: this setting is a dict and looks like:
{
  "fr": {
    "filed_name_1": "nom_du_champ_1",
    "filed_name_2": "nom_du_champ_2"
  }
}

KhaledBousrih avatar Jun 23 '20 14:06 KhaledBousrih

We may have to split the issue into 2 sub-issues :

  • standard translations using i18n mechnisms from Django
  • dynamic translations for meta data about models definition

paschembri avatar Jun 30 '20 12:06 paschembri