{
const attributes = schema.attributes || {};
const columns = attributes.columns || [];
@@ -790,7 +790,7 @@ export const getters = {
if ( typeof entry === 'string' ) {
const col = findBy(columns, 'name', entry);
if ( col ) {
- return fromSchema(col);
+ return fromSchema(col, rootGetters);
} else {
return null;
}
@@ -812,7 +812,7 @@ export const getters = {
out.push(NAMESPACE);
}
} else {
- out.push(fromSchema(col));
+ out.push(fromSchema(col, rootGetters));
}
}
@@ -831,7 +831,7 @@ export const getters = {
return out;
- function fromSchema(col) {
+ function fromSchema(col, rootGetters) {
let formatter, width, formatterOpts;
if ( (col.format === '' || col.format == 'date') && col.name === 'Age' ) {
@@ -848,9 +848,13 @@ export const getters = {
formatter = 'Number';
}
+ const exists = rootGetters['i18n/exists']
+ const t = rootGetters['i18n/t']
+ const labelKey = `tableHeaders.${col.name}`
+
return {
name: col.name.toLowerCase(),
- label: col.name,
+ label: exists(labelKey) ? t(labelKey) : col.name,
value: col.field.startsWith('.') ? `$${ col.field }` : col.field,
sort: [col.field],
formatter,
diff --git a/utils/download.js b/utils/download.js
index cd790c1ad2..65b0adbcad 100644
--- a/utils/download.js
+++ b/utils/download.js
@@ -7,15 +7,13 @@ export async function downloadFile(fileName, content, contentType = 'text/plain;
return saveAs(blob, fileName);
}
-// [{name: 'file1', file: 'data'}, {name: 'file2', file: 'data2'}]
+// {[fileName1]:data1, [fileName2]:data2}
export function generateZip(files) {
// Moving this to a dynamic const JSZip = import('jszip') didn't work... figure out later
const zip = new JSZip();
for ( const fileName in files) {
- const file = files[fileName];
-
- zip.file(fileName, file.data);
+ zip.file(fileName, files[fileName]);
}
return zip.generateAsync({ type: 'blob' }).then((contents) => {