xnau / pdb-polylang

Supports use of the Polylang plugin with Participants Database
1 stars 0 forks source link

Drop-down list options shows up in all languages in CSV export #1

Open RVeldhuyzen opened 4 years ago

RVeldhuyzen commented 4 years ago

When exporting the database entries to an CSV file the chosen options for drop-down lists show the entire language string of the chosen option.

A sex drop-down list has these options: [:en]Male[:nl]Man[:es]Hombre,[:en]Female[:nl]Vrouw[:es]Mujer.

When male is chosen the exported CSV for this entry will show [:en]Male[:nl]Man[:es]Hombre

It would be desirable if either the default language (preferable) or the submitted language shows up in the CSV export. Would that be possible?

xnau commented 4 years ago

This is an interesting question.

It is possible, but not sure how we would choose the language. Presumably, each record will have been made in a specific language, but unless that information is in the record, there's no way to know which language was chosen when the record was created.

Best thing to do is probably to set up a filter so that if the administrator has set up some way to record the chosen language in the record, they can apply the translation filter to the exported data.

RVeldhuyzen commented 4 years ago

Thanks for the quick reply.

Ideally I'd like to see it just outputting the default language selected in Polylang, since that is the language all of the administrators speak and it would give the exported CSV files a clean and easy to manually parse format.

I could see outputting the selected language variant being handy in very specific situations, but for most cases, just using the default seems to make the most sense to me.

xnau commented 4 years ago

That makes sense to me too. I just want to consider that some users might be expecting the whole multilingual string in there.