GWT 2.X Resource not found for key

I developed a GWT application using i18n internationalization. In Host / Dev mode, it works fine, but starting the GWT compilation gives this error: the resource was not found for the xxx key, as shown below.

Compiling module ...rte.RTE Scanning for additional dependencies: file:/home/.../client/i18n/RTEValidationMessages.java Computing all possible rebind results for '...client.i18n.RTEMessages' Rebinding ...client.i18n.RTEMessages Invoking com.google.gwt.dev.javac.StandardGeneratorContext@e7dfd0 Processing interface ...client.i18n.RTEMessages Generating method body for txtIndirizzo3() [ERROR] No resource found for key 'txtIndirizzo3' 

Messages are loaded with late binding.

 public class RTEValidationMessages { private RTEMessages additionalMessages; public RTEValidationMessages() { additionalMessages = GWT.create(RTEMessages.class); } } 

Removing a method that gives an error leads to another random method with an error, say, not before and after the method in the interface ... client.i18n.RTEMessages.

Help is appreciated.

+7
compiler-construction gwt
source share
2 answers

I had a similar error when using internationalization. I had property files for English and Polish: labels_en.properties and labels_pl.properties . The solution was to create also the labels.properties file (in my case it was just a copy of labels_en.properties ). This is strange, but somehow it helped.

You must also save your property files in the same package as your RTEMessages class.

+14
source share

also two important things (see docs ):

To use internationalized characters, make sure your host HTML file contains the charset = utf8 content type in the meta tag in the header:

 <meta http-equiv="content-type" content="text/html;charset=utf-8" /> 

You must also ensure that all relevant source and .properties files are UTF-8 encoded in your IDE.

+1
source share

All Articles