Custom localization file
A custom localization file is text file with key-message pairs in the format of
-
a Java properties file
a Java properties file has ISO 8859-1 encoding, all other characters must be
represented as Unicode escape sequences, like \u0823.
-
a properties file with UTF-8 encoding
A properties file with UTF-8 encoding has the advantage that you do not have to use
escape sequences. However it might not be supported by i18n tools.
A custom localization file can be used to
-
override system messages
If any of the default messages in the installer is not appropriate for your use-case, you can
change it by looking up the corresponding keys in the appropriate
$INSTALL4J_HOME/resource/messages/messages_*.utf8 file and define the same
key in your custom localization file to override that message.
-
localize your installer
Anywhere in the install4j IDE where you can enter text that is used at runtime, you can use
custom localization keys, i.e.
variables of the form ${i18n:myKey}. Those keys are read from
your custom localization file and offered by the
variable selection dialog.
If required, you can use parameters for your messages by using the usual {n}
syntax in the value and listing the parameters in function-like manner after the key name in the variable
instance. For example, if your key name is myKey and your message value is
Create {0} entries of type {1}
you can use a variable
${i18n:myKey("5", "foo")}
in order to fill the parameters, so that the actual message becomes
Create 5 entries of type foo
However, in the context of localizing an installer this is rarely necessary.