Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New local #1339

Open
skkrist opened this issue Jul 3, 2023 · 1 comment
Open

New local #1339

skkrist opened this issue Jul 3, 2023 · 1 comment

Comments

@skkrist
Copy link

skkrist commented Jul 3, 2023

Is it possible to add a pivot.no.coffee into the package?

pivot.no.coffee:

callWithJQuery = (pivotModule) ->
if typeof exports is "object" and typeof module is "object" # CommonJS
pivotModule require("jquery")
else if typeof define is "function" and define.amd # AMD
define ["jquery"], pivotModule
# Plain browser env
else
pivotModule jQuery

callWithJQuery ($) ->
nf = $.pivotUtilities.numberFormat
tpl = $.pivotUtilities.aggregatorTemplates

noFmt =    nf(thousandsSep: " ", decimalSep: ",")
noFmtInt = nf(digitsAfterDecimal: 0, thousandsSep: " ", decimalSep: ",")
noFmtPct = nf(digitsAfterDecimal: 1, scaler: 100, suffix: "%", thousandsSep: " ", decimalSep: ",")

$.pivotUtilities.locales.no =
    localeStrings:
        renderError: "En feil oppstod ved visning av pivot tabellen."
        computeError: "En feil oppstod under beregning av pivot tabellen."
        uiRenderError: "En feil oppstod ved visning av PivotTable UI."
        selectAll: "Velg alle"
        selectNone: "Velg ingen"
        tooMany: "(for mange verdier å vise)"
        filterResults: "Filtrer verdier"
        totals: "Total"
        vs: "vs"
        by: "av"
        apply: "Bruk"
        cancel: "Annuler"

    aggregators:
        "Antall":                             tpl.count(noFmtInt)
        "Antall unike verdier":               tpl.countUnique(noFmtInt)
        "Liste unike verdier":                tpl.listUnique(", ")
        "Sum":                                tpl.sum(noFmt)
        "Sum i heltall":                      tpl.sum(noFmtInt)
        "Median":                             tpl.median(noFmt)
        "Gjennomsnitt":                       tpl.average(noFmt)
        "Standardavvik":                      tpl.stdev(1, noFmt)
        "Minimum":                            tpl.min(noFmt)
        "Maximum":                            tpl.max(noFmt)
        "Andel av totalen":                   tpl.fractionOf(tpl.count(), "total", noFmtPct)
        "Andel av raden":                     tpl.fractionOf(tpl.count(), "row",   noFmtPct)
        "Andel av kolonnen":                  tpl.fractionOf(tpl.count(), "col",   noFmtPct)

    renderers:
        "Tabell":                          $.pivotUtilities.renderers["Table"]
        "Tabell med søyler":               $.pivotUtilities.renderers["Table Barchart"]
        "Heatmap":                         $.pivotUtilities.renderers["Heatmap"]
        "Heatmap per rad":                 $.pivotUtilities.renderers["Row Heatmap"]
        "Heatmap per kolonne":             $.pivotUtilities.renderers["Col Heatmap"]
@skkrist
Copy link
Author

skkrist commented Oct 9, 2023

@nicolaskruchten Hi, is it possible to add the norwegian set-up as a new local as commented above?

It would be particulary useful to have the correct format (thousand separator, decimal etc)-
I have a shiny application where I use a download button to get pivot table content as a csv-file. Excel is set up with european /norwegian format, so it would be nice to have same format in the pivot-file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant