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

Index out of range (decimal, group, minus..) #5

Closed
dvorakluk opened this issue Nov 22, 2016 · 4 comments
Closed

Index out of range (decimal, group, minus..) #5

dvorakluk opened this issue Nov 22, 2016 · 4 comments
Assignees
Milestone

Comments

@dvorakluk
Copy link
Contributor

First, let me thank you for this beautiful package.

I think there is missing check for the length of decimal, group and minus fields used for number formatting, as I'm getting runtime error: index out of range with locales/cs.(*cs).FmtCurrency

If these are not available in the cldr data, locales package should not panic.

But if I look into the cldr, i see them there (for cs.xml), so there probably some problem with parsing them? Have you opensourced the parser/generator?

@deankarn
Copy link
Contributor

deankarn commented Nov 22, 2016

Hey @dvorakluk

Thanks yes the parser is open-sourced... just a little hidden https://github.com/go-playground/locales/tree/master/cmd not on purpose, but just gets lost in all the folders.

just a heads up the code is more to get it generated and is not very refined yet (wanted to wait until there were tests for all languages before refining)

I do leverage https://godoc.org/golang.org/x/text/unicode/cldr heavily to do the initial XML loading.

I left some things to panic because if the information isn't there, then that locale shouldn't be used and didn't want to give someone a false sense that it was working, when in fact the data to do so is missing; but if the info is there, there very well may be a problem.

is there a specific locale? cs, cs_...?

I welcome any help you could provide 😄

@deankarn deankarn self-assigned this Nov 22, 2016
@deankarn deankarn added this to the v1 milestone Nov 22, 2016
@dvorakluk
Copy link
Contributor Author

dvorakluk commented Nov 22, 2016

My fault, I have overlooked it in the bunch of folders :)
Please take a look at the PR, it should parse the info where available and thus resolve this issue.

@deankarn
Copy link
Contributor

I will take a look later tonight as soon as I get the chance

@deankarn
Copy link
Contributor

changes merged & locales regenerated in v0.10.3

Thanks @dvorakluk I cannot express what a help this is 👍 Thank You!

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

No branches or pull requests

2 participants