nicolaskruchten / pivottable

Open-source Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop.
https://pivottable.js.org/
MIT License
4.35k stars 1.08k forks source link

Can't set Plotly locale with plotlyConfig #1265

Open renankaic opened 3 years ago

renankaic commented 3 years ago

Hello. I'm loving pivottable. But I'm trying to set locale with Plotly.

I read in documentation about rendererOptions that I should use "plotlyConfig" to pass some configurations to Plotly renderer.

To change the locale, I read in Plotly Documentation that I must import the desired Language Pack and set "locale" property in "config" parameter.

I followed as both documentations said but it doesn't work. Am I doing something wrong?

Please, when possible, could you give a hand?

Here is a CodePen example with locale working directly on Plotly: https://codepen.io/renankaic/pen/OJbaJbG

Here is a JsFiddle with pivottable + Plotly + pt-br language pack: https://jsfiddle.net/xvor2mqd/

nicolaskruchten commented 3 years ago

How can you tell that your second fiddle isn't working?

renankaic commented 3 years ago

How can you tell that your second fiddle isn't working?

The options in the first select box still in English language instead of Portuguese even after importing the Plotly PT-BR Language Pack JS file and setting it on plotlyConfig property

nicolaskruchten commented 3 years ago

So to be clear: changing the plotly language pack does not impact the language of the pivot table selections... For that you'll need to use the pivot table's locale file. The Plotly renderers are like a plugin for the pivot table and they each have their own localization systems.

renankaic commented 3 years ago

Understood. So, I can't change the language after using Plotly, right? But if I change the .js used to enable plotly (the parts with the renderers names strings), will I be able to translate this part?