diff --git a/jsapp/js/components/formEditors.es6 b/jsapp/js/components/formEditors.es6 index 9e437e0be0..95483d698d 100644 --- a/jsapp/js/components/formEditors.es6 +++ b/jsapp/js/components/formEditors.es6 @@ -159,10 +159,33 @@ export class ProjectDownloads extends React.Component { dataInterface.getAssetExports(this.props.asset.uid).done((data)=>{ if (data.count > 0) { data.results.reverse(); - this.setState({exports: data.results}); + let results = data.results.map(result => { + if (result.data) { + let lang = result.data.lang, + langDescription = lang; + + // Backend now changes `_default` to `FormPack.constant.UNTRANSLATED` in `ExportTaskViewSet`. + // `FormPack.constant.UNTRANSLATED` constant equals `None`. + // Old exports can still have `_default` as value for `lang` though. + if (lang === '_default' || lang === null) { + langDescription = t('Default'); + } + // Because `xml` can be a code for an existing language (https://en.wikipedia.org/wiki/Malaysian_Sign_Language), + // `_xml` is now sent to backend instead of `xml`. + // Backend also changes `_xml` to `FormPack.constant.UNSPECIFIED_TRANSLATION` + // `FormPack.constant.UNSPECIFIED_TRANSLATION` constant equals `False`. + else if (lang === '_xml' || lang === false) { + langDescription = t('XML values and headers'); + } + result.data['lang_desc'] = langDescription; + } + return result; + }); + + this.setState({exports: results}); // Start a polling Interval if there is at least one export is not yet complete - data.results.every((item) => { + results.every((item) => { if(item.status === 'created' || item.status === 'processing'){ this.pollingInterval = setInterval(this.refreshExport, 4000, item.url); return false; @@ -232,7 +255,7 @@ export class ProjectDownloads extends React.Component {