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

Ability to pass locale to pivot() #591

Closed
glebfox opened this issue Dec 2, 2016 · 7 comments
Closed

Ability to pass locale to pivot() #591

glebfox opened this issue Dec 2, 2016 · 7 comments

Comments

@glebfox
Copy link

glebfox commented Dec 2, 2016

As described here pivotUI() has the locale parameter:

pivotUI(input [,options [,overwrite [,locale]]])

but pivot() doesn't.

pivot(input [,options])

and locale hardcoded:

defaults = {
...
   localeStrings: locales.en.localeStrings
};

It would be very convenient to have the same locale parameter for pivot() as well as in pivotUI().

Sorry, if I missed any guides how to localize pivot().

Regards,

Gleb.

@nicolaskruchten
Copy link
Owner

You can localize pivot() by passing in localeStrings with the options object. This is also possible with pivotUI() but the extra locale parameter to that function is a shortcut.

@glebfox
Copy link
Author

glebfox commented Dec 4, 2016

But it isn't obvious that I have to pass localeStrings to rendererOptions too. Or I missed this point in documentation? If so, then sorry.

@nicolaskruchten
Copy link
Owner

You're right that this is not very clear. I'll think about the implications of adding the locale parameter to pivot()

@glebfox
Copy link
Author

glebfox commented Dec 4, 2016

Thx. Also, I probably found a bug with localization. If I pass a locale to pivotUI() and my configuration contains rendererOptions (for example this sample with localization) then renderer will have no localization. To avoid this I have to pass localeStrings to rendererOptions by myself. Is it expected behaviour?

@nicolaskruchten
Copy link
Owner

OK @glebfox I think the recent commits to master should fix both of these issues: you can now specify locale for both pivot() and pivotUI() and the options and locale strings are more sensibly merged together, so you should not need to pass localeStrings through rendererOptions if you are using the top-level locale parameter.

If you have a second, can you confirm this on your end and I'll do a proper release and update the documentation?

@glebfox
Copy link
Author

glebfox commented Dec 28, 2016

Hi, I think everything is OK, thx for your fix.

Regards,

Gleb

@nicolaskruchten
Copy link
Owner

Super! I've just released the change as version 2.6.0 and updated the documentation. Thanks for the bug report :)

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

2 participants