#############################################
/src/t0001/client/T0001.java
#############################################
package t0001.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
public class T0001 implements EntryPoint {
public void onModuleLoad() {
PhotoConstants constants = (PhotoConstants) GWT.create
(PhotoConstants.class);
Window.alert(constants.upnpAppName());
RootPanel.get().add(new HTML("ALLES MIST"));
}
}
#############################################
src/t0001/client/PhotoConstants.java
#############################################
package t0001.client;
import com.google.gwt.i18n.client.Constants;
public interface PhotoConstants extends Constants {
String upnpAppName();
}
#############################################
/src/t0001/client/PhotoConstants.properties
#############################################
upnpAppName = it's all big shit
On Jan 25, 10:43 am, Thomas Broyer <[email protected]> wrote:
> On Jan 24, 10:04 pm, Ashish Khivesara <[email protected]>
> wrote:
>
>
>
>
>
> > Hi,
> > I am trying to do a simple constant lookup. com.google.gwt.i18n.client.
> > Constants is what I need to use.
>
> > I created the interface
>
> > public interface PhotoConstants extends Constants{
>
> > String appName();
>
> > }
>
> > I am calling is in GWT Entry Point code as follows
>
> > PhotoConstants constants = (PhotoConstants)GWT.create(PhotoConstants.class);
> > Window.alert(constants.upnpAppName());
>
> > I created a PhotoConstants.properties file in war/ directory.
>
> The *.properties file should be in the same package as the
> corresponding *.java file. This is a compile-time thing, and the
> compiler doesn't look into your war/ directory (it only outputs into
> it)
>
> > However I get the following Exception.
>
> > This maybe because I dont have the properties file in the correct location??
> > The documentation does not say anything about it though...
>
> http://code.google.com/webtoolkit/doc/latest/DevGuideI18n.html#DevGui...
> says:
> """Static string internationalization uses traditional
> Java .properties files to manage translating tags into localized
> values. These files may be placed into the same package as your main
> module class. They must be placed in the same package as their
> corresponding Constants/Messages subinterface definition file."""
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.