buxfix(i18n): read utf8 resource if needed. #190 - #212
Conversation
bugfix(i18n): read utf8 resource if needed. caelum#190 caelum#212 opened 16 days ago by khajavi
There was a problem hiding this comment.
I think this code is quite big and complex, I think we should extract it to a separate class to be able to unit test it easier, what do you think @khajavi?
|
@khajavi thanks for the contribution! I suppose you've tested this modifications in your machine, but is hard to accept such a complex PR without unit tests. I've just finished reviewing it and I think you should extract some classes to be able to unit test it easier. What do you think? Maybe some simple tests with properties files and different encodings? What do you think @xdarklight @JamesSullivan @leocwolter? |
|
The standard solution for this issue is to use unicode characters ( The downside of this "standard solution" is that the localization file is not editable with a standard text editor anymore (because all non-ASCII characters are encoded), but there are many tools out there - (Attesoro for example - which assist you with editing properties files: they present you the human readable (Persian) text while saving it as ISO-8859-1 with unicode characters. I'm not sure what we want to do in Mamute as both solutions have their pros and cons. |
|
I think @xdarklight has summed it up quite nicely. If forced to choose I would go with the standard solution, using Unicode characters (\uXXXX), to keep things as simple as possible. |
|
Writing Unicode translations in ISO-8859-1 standard is cumbersome. I promote to use utf8 bundles for languages that need Unicode strings. @xdarklight
what is the problem with routing and configuration properties? |
|
@khajavi see Environment implementation - it's not using An alternative to using Attesoro is editing the translations with UTF-8, then using JDK's There's also plenty of web-based translation tools available which can be used instead of manually editing the .properties files. Just to name a few:
Using these would be a decision which has to be made by the Mamute maintainers. @khajavi please don't get me wrong - your solution definitely has it's upsides! |
|
Hmm, seems you are right. I need some time to fix this issue. On Thu, Feb 4, 2016 at 10:56 PM, Martin Blumenstingl <
Milād Khājavi |
|
@khajavi that's exactly what I would suggest you avoid: changing lots of code everywhere. I just thought about it again and we might be able to mix both approaches: |
|
@khajavi let us know when you finish to make the changes |
|
Ok, sure. On Sat, Feb 13, 2016 at 6:40 PM, Felipe Oliveira notifications@github.com
|
No description provided.