I think there are .resources file readers for JS out there, so you could just serve up the appropriate file to the client.Personally, we avoid doing i18n on the client side and instead serve up already-i18n-ed content via JSON or CSS selector transforms, depending.Thanks,Antonio
For what it's worth, I also consider properties-file-based i18n pretty broken. It's not designed with any of the complexities of translation (e.g., pluralization) in mind. But I haven't gotten time to look into the best way of integrating gettext with Lift yet.Thanks,Antonio
Thus far I had only found this jQuery plugin. I might use it but man... I really hate jQuery. I know it doesn't mean I'll have to use it, but just means that it's hanging around. :)
På fredag 17. januar 2014 kl. 05:15:31, skrev Antonio Salazar Cardozo <savedf...@gmail.com>:For what it's worth, I also consider properties-file-based i18n pretty broken. It's not designed with any of the complexities of translation (e.g., pluralization) in mind. But I haven't gotten time to look into the best way of integrating gettext with Lift yet.Thanks,AntonioDo yoy mean Lift's i18 or JAVA's? JAVA's most certainly handles pluralization. That's why our i18n-enums use JAVA's 18n mechanism and not Lifts. Can you give an example of how JAVA's i18n isn't complete enough?
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
---
You received this message because you are subscribed to a topic in the Google Groups "Lift" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/liftweb/8w6lGzifOpo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Thanks for sharing, Andreas. If I have understood correctly, you are manually creating the enums to match the properties file, correct? Have you considered generating the enums from the properties file? This is basically what I had in mind in my original post, except that it would be JS which is generated.Do you guys think this idea I have will be useful to others, or is a good idea at all? :) I just want to be able to take the properties defined in the current locale's resource bundle and toss them up as JS to the client. Everything will be done server side, and the client will be given a dictionary to utilize when it makes sense. I even have in mind to do some of the easier cases of substitution.
object ProjectTexts { object D extends ResourceBundleEnum { val name, isActive = BundleEnum(Bundle.PROJECT_D) } object V extends ResourceBundleEnum { val projectDialog_details_label_budget , projectDialog_title_newProject = BundleEnum(Bundle.PROJECT_V) } }