GWT I18n server-side implementation

A project to make GWT localization available on server side.

License

License

Categories

Categories

GWT (Google Web Toolkit) User Interface Web Frameworks Net
GroupId

GroupId

net.lightoze.gwt-i18n-server
ArtifactId

ArtifactId

gwt-i18n-server
Last Version

Last Version

0.26
Release Date

Release Date

Type

Type

jar
Description

Description

GWT I18n server-side implementation
A project to make GWT localization available on server side.
Project URL

Project URL

https://github.com/lightoze/gwt-i18n-server
Source Code Management

Source Code Management

https://github.com/lightoze/gwt-i18n-server

Download gwt-i18n-server

How to add to project

<!-- https://jarcasting.com/artifacts/net.lightoze.gwt-i18n-server/gwt-i18n-server/ -->
<dependency>
    <groupId>net.lightoze.gwt-i18n-server</groupId>
    <artifactId>gwt-i18n-server</artifactId>
    <version>0.26</version>
</dependency>
// https://jarcasting.com/artifacts/net.lightoze.gwt-i18n-server/gwt-i18n-server/
implementation 'net.lightoze.gwt-i18n-server:gwt-i18n-server:0.26'
// https://jarcasting.com/artifacts/net.lightoze.gwt-i18n-server/gwt-i18n-server/
implementation ("net.lightoze.gwt-i18n-server:gwt-i18n-server:0.26")
'net.lightoze.gwt-i18n-server:gwt-i18n-server:jar:0.26'
<dependency org="net.lightoze.gwt-i18n-server" name="gwt-i18n-server" rev="0.26">
  <artifact name="gwt-i18n-server" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.lightoze.gwt-i18n-server', module='gwt-i18n-server', version='0.26')
)
libraryDependencies += "net.lightoze.gwt-i18n-server" % "gwt-i18n-server" % "0.26"
[net.lightoze.gwt-i18n-server/gwt-i18n-server "0.26"]

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.commons : commons-lang3 jar 3.3
org.slf4j : slf4j-api jar 1.7.5

provided (3)

Group / Artifact Type Version
javax.servlet : javax.servlet-api jar 3.1.0
com.google.gwt : gwt-user jar 2.8.1
org.javassist : javassist Optional jar 3.20.0-GA

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

LGPLv3 License Build Status Maven Central

Usage

You can use LocaleFactory.get(Class<T extends LocalizableResource> cls) to obtain Messages, Constants or ConstantsWithLookup both on server and client side.

Server

Add I18nFilter to web.xml or use ThreadLocalLocaleProvider.pushLocale(Locale) with ThreadLocalLocaleProvider.popLocale() to manually set thread-local locale.

Also there are a couple of additional server-only features like MessagesWithLookup interface and encoding proxies, which allow you to use localization in a more dynamic way.

Note: Unfortunately GWT-specific message formats (described here) are currently not supported except for the "static argument" format ({startBold,<b>}).

Client

Add <inherits name="net.lightoze.gwt.i18n.GwtI18nServer"/> to your GWT XML module descriptor.

Call LocaleFactory.put(MyMessages.class, GWT.<MyMessages>create(MyMessages.class)) in your EntryPoint.

Maven repositories

Snapshots - https://oss.sonatype.org/content/groups/public/

Releases - Maven Central

Latest release (for GWT 2.8.1):

    <dependency>
        <groupId>net.lightoze.gwt-i18n-server</groupId>
        <artifactId>gwt-i18n-server</artifactId>
        <version>0.25</version>
    </dependency>

This artifact contains a copy of com.google.gwt.i18n package from GWT distribution, so you don't have to deploy the whole GWT library on the server. In case you want only gwt-i18n-server classes, use an artifact with original classifier.

Versions

Version
0.26
0.25
0.24
0.23
0.22
0.21
0.20
0.19
0.18