View Single Post
Old 01-08-2012, 07:43 AM   #81
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by eureka View Post
Thanks a lot. I appreciate it.
Just committed the changes. Please test-drive the new version and let me know if it works (I don't have Windows around...).

Quote:
Originally Posted by eureka View Post
I know that .properties must be in ISO-8859-1, when they are designed to be read by Java. But if you'll convert all .properties into .class on compiling locale bundle, then format of .properties will be of no matter for Java; it's contents of .class that will matters. And strings in .class could be UTF-8 AFAIK. (And Transifex supports UTF-8 in .properties with 'type=MOZILLAPROPERTIES').

Am I right in principle? Could you take a look into this?
I guess you're right in principle. But (there are two "but"s):
- localized property files come from transifex (tx pull), not from the extraction tool.
- I am not converting every single properties file into a class, but only some. There is a very simple heuristic behind the selection: i) if a properties file contains arrays, then necessarily create a class from it; ii) otherwise, temporarily create a class, then bundle whichever file is smaller (the original properties file, or the class file). This could of course be changed to make everything into a class, but this will normally bloat the size of the .jar (factor ~ 2 while testing the de locale). In addition, the classes are not terribly efficient (they internally use a Base64-encoded version of the serialized String of the contents, which must be decoded and deserialized when the class is loaded). Of course there are no benchmarks around, but I guess that this may be slower than directly using .properties. So to summarize, the resulting jar contains a mix of .properties and .class files.
ixtab is offline   Reply With Quote