diff --git a/locales/pivot.pt.coffee b/locales/pivot.pt.coffee index 34d4596e..c2634c62 100644 --- a/locales/pivot.pt.coffee +++ b/locales/pivot.pt.coffee @@ -34,6 +34,7 @@ callWithJQuery ($) -> cancel: "Cancelar", vs: "vs" by: "por" + csv_sep: ";" aggregators: "Contagem": tpl.count(frFmtInt) @@ -65,6 +66,8 @@ callWithJQuery ($) -> "Mapa de Calor": r["Heatmap"] "Mapa de Calor por Linhas": r["Row Heatmap"] "Mapa de Calor por Colunas": r["Col Heatmap"] + "Exportar para TSV": r["TSV Export"] + "Exportar para CSV": r["CSV Export"] if gcr $.pivotUtilities.locales.pt.gchart_renderers = diff --git a/src/export_renderers.coffee b/src/export_renderers.coffee index 6c781065..fa8a775e 100644 --- a/src/export_renderers.coffee +++ b/src/export_renderers.coffee @@ -9,11 +9,18 @@ callWithJQuery = (pivotModule) -> callWithJQuery ($) -> - $.pivotUtilities.export_renderers = "TSV Export": (pivotData, opts) -> - defaults = localeStrings: {} + svExporter = (pivotData, opts, separator) -> + defaults = localeStrings: { + csv_sep: "," + } opts = $.extend(true, {}, defaults, opts) + if separator == "tsv" + separator = "\t" + else + separator = opts.localeStrings.csv_sep + rowKeys = pivotData.getRowKeys() rowKeys.push [] if rowKeys.length == 0 colKeys = pivotData.getColKeys() @@ -48,9 +55,12 @@ callWithJQuery ($) -> result.push row text = "" for r in result - text += r.join("\t")+"\n" + text += r.join(separator)+"\n" return $("