IzPack supports many languages out of the box.
If a country or language is not supported, the following instructions can be used to add a new one.
In IzPack, language packs are identified by a 3 character ISO country or language code. Country codes are converted to lowercase.
Country codes are used in preference to language codes. This is to handle the case where a language variation is spoken for which there is no ISO language code.
E.g. Portuguese and Brazilian Portuguese - these must be specified using "prt" and "bra" respectively.
Each language pack must have a corresponding resource file located at:
com/izforge/izpack/bin/langpacks/installer/<ISO code>.xml
There must also be a flag resource located at:
com/izforge/izpack/bin/langpacks/flags/<ISO code>.gif
E..g The English language pack is used for all English speaking countries, and uses the eng ISO language code..
It has the following resources:
com/izforge/izpack/bin/langpacks/installer/eng.xml
com/izforge/izpack/bin/langpacks/flags/eng.gif
To add a country specific variant of the English language pack, e,g. for Australia
com/izforge/izpack/bin/langpacks/installer/aus.xml
The izpack-maven-plugin needs to reference the jar in order for it to locate the resources
<plugin> <groupId>org.codehaus.izpack</groupId> <artifactId>izpack-maven-plugin</artifactId> <version>5.0.0-rc1-SNAPSHOT</version> <configuration> <installFile>${staging.dir}/install.xml</installFile> <baseDir>${staging.dir}</baseDir> </configuration> <executions> <execution> <id>installer</id> <phase>package</phase> <goals> <goal>izpack</goal> </goals> </execution> </executions> <dependencies> <dependency> <groupId>com.mystuff</groupId> <artifactId>myjar</artifactId> <version>${project.version}</version> </dependency> </dependencies> </plugin> |