This page last changed on Jun 19, 2008 by jdeolive.

Random stuff about working with Wicket and the new user interface.

Internationalization

Internationalization

For each UI module there is a file called GeoServerApplication.properties in the root of the classpath (parallel to applicationContext.xml). For each supported language there is a parallel file of the form GeoServerApplication_lang.properties where lang is a two letter language code (lowercase).

module/
  src/
    main/
      java/
        GeoServerApplication.properties
        GeoServerApplication_fr.properties
        GeoServerApplication_es.properties
        ...

The i18n file is a property format identical to the ApplicationResources.properties file used with the old struts UI.

GeoServerApplication.properties
#global entries
ok=OK
cancel=Cancel

#per-page entries
GeoServerHomePage.page.title=Welcome
GeoServerHomePage.page.description=Welcome to GeoServer, your one stop shop for publishing geo-spatial data on the web.

DataPage.page.title=Data and Resources
DataPage.page.description=Manage the data and resources being published by GeoServer.

Usage and Conventions

There are two types of entries in the i18n file, global entries and prefixed entries. Global entries are keys which are used on multiple pages, where as prefixed entries are local to a particular page or component. However prefixed keys can be referenced un-prefixed in an actual markup page. When the lookup occurs the name of the component will be pre-pended automatically. The only case where a prefix is necessary is if a global entry must be overridden.

Examples:

GeoServerApplication.properties
GeoServerHomePage.page.title=Home Page
GeoServerHomePage.page.description=Home Page Description
GeoServerHomePage.html
<wicket:message key="page.title">This is an example of static i18n</wicket:message>
<span wicket:id="description">This is an example of dynamic i18n</span>
GeoServerHomePage.java
public Class GeoServerHomePage extends GeoServerBasePage { 

  public GeoServerHomePage() {

    add( new Label( "description", new StringResourceModel( "page.description" ) );
  
  }
 ...

}
Document generated by Confluence on May 14, 2014 23:00