--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/e40829d8-fbda-47b9-9516-27ea7995cc81%40googlegroups.com.
DearsI am working on porting the i18n module, so far all i did is extract the module and the tests into and external repository and make the tests pass, not real change to the code have been yet. but the i18n module is an important module and is being used by so many gwt application so porting this one should be taken with care, this why i am opining this discussion so that i can hear and share idea's.
i would like to start this discussion by sharing some of my thoughts, which are limited to my knowledge of the gwt i18n, and i would love to get corrections and feedback to what ever wrong or good thinking i have.so first in a gwt 2.x application using i18n with generators assumes that the set of locales available is known during the code generation, for example if you an application that has a module lets call it module A that define a messages interface (MessagesA) and defines the locales to be `en`, `fr` for example, then once the application is compiled, the generator should produce MessagesA class for each locale and we end up with MessagesA_en and MessagesA_fr having that we provide properties files for both.now assume we add a new module to our application module B and B defines another messages interface MessagesB and extends the locale property to add a third locale `it` and provide properties files for MessagesB en,fr and it and also provide a properties file for MessagesA it, then when we compile we will end up with MessagesA_en, MessagesA_fr, and MessagesA_it, MessagesB_en, MessagesB_fr, and MessagesB_it.with this i could extends the application messages by adding a new module thanks to the Property oracle that provide information about all defined and extended locales.now in the APT world with multi modules things are different, the processors does not rum for all modules as one unit instead the processor will run for a single module and will have knowledge limited to that module, so module A processor wont know about locales defined in module B, and module B processor wont know about locale values provided by module A, so and expected result that i will end up with MessagesA_en, MessagesA_fr for module A and MessagesB_it for module B.what do you think?
--You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/d3466879-fa8d-4ea3-840f-c57aabb171bf%40googlegroups.com.
Learner Evermore
I think I18N is important. However, we never liked or used the GWT 2.x style of it because it requires dev time knowledge of locales and multiplies permutations (compile time). It was also inflexible another way - e.g. if a user wants to switch or update the language the code is reloaded as well and the state lost.Instead we load localizations separately from the main code (and have the ability to automaticall, at runtime, merge it with the code, should we wish to do so).A serious GWT must have a serious I18N system, *not* like GWT 2.x.Now, we still need to address porting of existing code - if there remains a desire for porting today. We can make that easier. However, since some work will be involved anyway, the compatibility system does not have to do it the GWT 2.x way, just needs to be more-or-less compatible with it from the coding perspective.
I also one of those who replaced gwt-i18n with my own implementation which was a simple dictionary like, that loads the labels and messages at runtime, but in my case i didnt need more than plain simple text translation without parameters or anything else.with that said, one of the goals of porting gwt 2 modules is to provide a smooth transition for applications that uses gwt into gwt 3.0, this does not mean we cant introduce something new or implement things differently, but we can have both, while we are porting the old module and ensure a smooth transition, we give ourselves a better chance and freedom to brainstorm, introduce and discuss new things.while working on porting i18n module i am trying to break it into smaller modules that are more specific to one thing, so :1- i started by extracting the i18n module from the monolith gwt code, and make sure the test cases works.2- i have draft implementation of an APT based constants generator https://github.com/vegegoku/gwt-constants-apt
3- extracted CLDR into its own module with no JSNI and JSO, the generator is also moved out of the gwt tools into its own module and now works with gradle instead of ant.and i am pretty sure there are many gwt i18n users who will appreciate this non evolutionary porting, but also i believe this will give us a better ground when we start introducing new things, and for such a large module will help us with coordination and get more involved.
I'll try to setup a document today with what I have in mind so we can discuss.
I didn't mean to be dismissive of your work (sorry if that might have sounded like this); on the contrary this is valuable work, but IMO more as an "experimentation" exploring what can be done than a definitive answer to how is should be done now.
On Saturday, April 7, 2018 at 8:39:32 PM UTC+2, Ahmad Bawaneh wrote:I also one of those who replaced gwt-i18n with my own implementation which was a simple dictionary like, that loads the labels and messages at runtime, but in my case i didnt need more than plain simple text translation without parameters or anything else.with that said, one of the goals of porting gwt 2 modules is to provide a smooth transition for applications that uses gwt into gwt 3.0, this does not mean we cant introduce something new or implement things differently, but we can have both, while we are porting the old module and ensure a smooth transition, we give ourselves a better chance and freedom to brainstorm, introduce and discuss new things.while working on porting i18n module i am trying to break it into smaller modules that are more specific to one thing, so :1- i started by extracting the i18n module from the monolith gwt code, and make sure the test cases works.2- i have draft implementation of an APT based constants generator https://github.com/vegegoku/gwt-constants-aptFor example, here, you pass the locales as a constant on the annotation, which is not a “non evolutionary porting” then.This implies that when/if you want to add a new locale, you need to go through all your constants interfaces to not only add properties files (see below about that too) but also add the locale to the annotation. I wonder if we couldn't instead pass an option to the annotation processor (we could also have the processor load the properties files from the processor path; in Gradle this would mean that changing a properties file would trigger a recompile; unfortunately this is impractical at best in Maven). An alternative would be a generator that's not an annotation processor (no idea how you'd call it; that idea maybe not worth pursuing as that could be too cumbersome for users; unless maybe the generator generates intermediate Java source that's only processed by the annotation processor later and never actually used at runtime; the goal only being that the input to javac –maven-compiler-plugin or Gradle JavaCompile task– is only made of Java source files, for more accurate incremental builds –i.e. correctly trigger a recompile when needed).Wrt properties files, current GWT 2.x implementation will look for properties files for the superinterfaces too up to Localizable; which provides a way to centralize the values across the entire application. When adding a new locale, you could then give a single properties file to the translator, and have a single new properties file to add to your application (and not one per constants interfaces; but with your proposed implementation, you'd still have to go through all of them to add the locale to the annotation).Ideally, we should also plan our annotation processors so they work great with Gradle's experimental incremental compilation: https://docs.gradle.org/release-candidate/userguide/java_plugin.html#sec:incremental_annotation_processing
3- extracted CLDR into its own module with no JSNI and JSO, the generator is also moved out of the gwt tools into its own module and now works with gradle instead of ant.and i am pretty sure there are many gwt i18n users who will appreciate this non evolutionary porting, but also i believe this will give us a better ground when we start introducing new things, and for such a large module will help us with coordination and get more involved.I agree that we should aim for maximum backwards compatibility, but there will be breaking changes anyway (if only to replace GWT.create() with calls to a –generated– static factory).I'll try to setup a document today with what I have in mind so we can discuss.