super-csv / super-csv

A fast, programmer-friendly, free CSV library for Java
http://super-csv.github.io/super-csv
Apache License 2.0
527 stars 140 forks source link

i18N #31

Open kitikousei opened 9 years ago

kitikousei commented 9 years ago

Super CSV is an useful tool for read/write csv files. but it dos'nt support i18N

kbilsted commented 9 years ago

Thanks for you input. But can you please elaborate on the problems you are experiencing?

kbilsted commented 9 years ago

Closing due to lack of feed back.

loloq123 commented 8 years ago

I think that our buddy here was referring to the error messages shown when a constraint or parser fails, currently all the messages are hard coded in English and there is no way to overloading them, i.e. I18N' them.

Take for instance org.supercsv.cellprocessor.ParseLong, when the input value fails to be converted to a Long value this code is executed:

throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as an Long", value), context, this, e);

The error message is hardcoded.

kbilsted commented 8 years ago

Hi @loloq123

that clarifies a bit. Is it something you would be interested in implementing?

loloq123 commented 8 years ago

Do you mean being me who do the changes in the code? Alright!

I'm thinking on using this:

https://murygin.wordpress.com/2010/04/23/parameter-substitution-in-resource-bundles/

so all the messages will be defined on a properties file which can be overloaded, defaults being the current ones.

If so, how should I proceed?

2016-02-23 14:49 GMT-06:00 Kasper B. Graversen notifications@github.com:

Hi @loloq123 https://github.com/loloq123

that clarifies a bit. Is it something you would be interested in implementing?

— Reply to this email directly or view it on GitHub https://github.com/super-csv/super-csv/issues/31#issuecomment-187897437.

kbilsted commented 8 years ago

hi @loloq123

Sounds great! Here are of the top of my head requirements for the solution

I can't recall. is it possible to weave into the jar a default language such that you can choose to use supecsv with only one file (the jar dependency)

loloq123 commented 8 years ago

Hi, I've submitted a Pull Request a couple of days ago that contains the I18N implementation. Let me know if you have any comments.

https://github.com/super-csv/super-csv/pull/95