The recommended way to localize your application is to use standard OSGi bundle fragments.

Fragments need to specifiy their fragment host. You can use the Maven Bundle Plugin to create a fragment.

<packaging>bundle</packaging>

[...]

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
        <instructions>
            <Fragment-Host>com.mycompany.myapp.myapp-mymodule;bundle-version=${myapp.osgi.version.clean}</Fragment-Host>
        </instructions>
        <versions>
            <myapp.osgi.version.clean>${project.version}</myapp.osgi.version.clean>
        </versions>
    </configuration>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>cleanVersions</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Replace com.mycompany.myapp.myapp-mymodule with the Bundle-SymbolicName of the fragment host. Make sure you use the OSGi version, not the Maven version (see the cleanVersions goal).

1. Currently Supported Locales

  • en (English; default)

  • de (German)