i18n:bundle

Full name:

org.nuiton.i18n:i18n-maven-plugin:4.1:bundle

Description:

Generate an aggregate i18n bundle for all dependencies of the project. The main idea is to have a final unique i18n bundle for an application to launch, this really improve i18n loading time to have a unique named bundle, no need to seek in all dependencies... Moreover, this permits also to deal with order of i18n keys, more precisely, we want to use the higher level i18n key for an application. If the i18n key is present on a library, we want to be able to override it in application (or user wants it:)). This goal permits this using the dependencies graph order of artifacts.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: runtime.
  • The goal is not marked as thread-safe and thus does not support parallel builds.
  • Since version: 0.12.
  • Binds by default to the lifecycle phase: generate-resources.
  • Invokes the execution of this plugin's goal collect-i18n-artifacts prior to executing itself.

Required Parameters

Name Type Since Description
<bundleOutputDir> File 1.0.0 Root directory where to generate aggregated bundles (this directory will be added as resources of the project).
Default value is: ${basedir}/target/generated-sources/resources.
User property is: i18n.bundleOutputDir.
<bundleOutputName> String 1.0.2 Name of the bundle to generate.
Default value is: ${project.artifactId}-i18n.
User property is: i18n.bundleOutputName.
<bundleOutputPackage> String 2.3.2 Package name of the generate aggregated bundles. Note: By default we use the META-INF package since it is the favorite package of I18n runtime initializer. The package name is dotted as it will be stored as folder like in Java language. Example :
    package name : foo.bar
    directory    : foo/bar

Default value is: META-INF.
User property is: i18n.bundleOutputPackage.
<bundles> String 0.12 Locales to treate, separated by comma. Example :
fr_FR,en_GB

Default value is: fr_FR,en_GB.
User property is: i18n.bundles.
<collectOutputDir> File 1.0.2 Directory where to generate bundles.
Default value is: ${basedir}/target/i18n.
User property is: i18n.collectOutputDir.
<collectOutputName> String 1.0.2 BAse name of file which contains bundles locations.
Default value is: collect-${project.artifactId}-i18n.
User property is: i18n.collectOutputName.
<encoding> String 0.12 Encoding used to load and store properties.
Default value is: ${project.build.sourceEncoding}.
User property is: i18n.encoding.

Optional Parameters

Name Type Since Description
<bundleCsvFile> File 2.5 Deprecated. since 3.3, prefer use the new mojo generate-csv-bundle instead
Default value is: ${basedir}/target/${project.artifactId}-i18n.csv.
User property is: i18n.bundleCsvFile.
<bundleCsvSeparator> String 2.5 Deprecated. since 3.3, prefer use the new mojo generate-csv-bundle instead
Default value is: .
User property is: i18n.bundleCsvSeparator.
<bundleFormatConverter> String 2.4 Converter used to change format of bundles.
User property is: i18n.bundleFormatConverter.
<bundleInputEncoding> String 2.4 Encoding used to load any i18n property files. If not defined, will use the encoding parameter.
User property is: i18n.bundleInputEncoding.
<bundleOutputEncoding> String 2.4 Encoding used to write any i18n property files. If not defined, will use the encoding parameter.
User property is: i18n.bundleOutputEncoding.
<checkBundle> boolean 1.0.0 A flag to check that bundles are complete (no missing i18n translations). Note : This behaviour will be activated is failsIfWarning is on.
Default value is: true.
User property is: i18n.checkBundle.
<failsIfAnyKeyMissingInBundle> boolean 3.6.1 A flag to make the build fails if there is some missing keys. Note : This parameter should be used in a release profile to ensure bundles are complete.
Default value is: false.
User property is: i18n.failsIfAnyKeyMissingInBundle.
<failsIfAnyKeyMissingValue> boolean 3.6.1 A flag to make the build fails if there is some missing key values. Note : This parameter should be used in a release profile to ensure bundles are complete.
Default value is: false.
User property is: i18n.failsIfAnyKeyMissingValue.
<failsIfWarning> boolean 2.0 Deprecated. since 3.6.1, prefer use now failsIfAnyKeyMissingValue or failsIfAnyKeyMissingInBundle.
Default value is: false.
User property is: i18n.failsIfWarning.
<generateCsvFile> boolean 2.5 Deprecated. since 3.3, prefer use the new mojo generate-csv-bundle instead
Default value is: false.
User property is: i18n.generateCsvFile.
<generateDefaultLocale> boolean 2.1 A flag to generate a bundle with the first locale defined as a default bundle (with no locale specialization).
Default value is: false.
User property is: i18n.generateDefaultLocale.
<generateDefinitionFile> boolean 2.0 A flag to generate the i18n definition file. This file contains all generated bundles and the paths of all i18n artifacts used to make it.
Default value is: true.
User property is: i18n.generateDefinitionFile.
<showEmpty> boolean 1.0.0 A flag to show missing i18n translation. Note : Need the checkBundle to be activated).
Default value is: false.
User property is: i18n.showEmpty.
<silent> boolean 1.0.0-rc-5 Silent flag to see only errors in console.
Default value is: false.
User property is: i18n.silent.
<verbose> boolean 0.12 Verbose flag. Note : if not setted, we used the maven.verbose property.
Default value is: ${maven.verbose}.
User property is: i18n.verbose.

Parameter Details

<bundleCsvFile>

Deprecated. since 3.3, prefer use the new mojo generate-csv-bundle instead
Location of the csv file to generate if parameter generateCsvFile is on.
  • Type: java.io.File
  • Since: 2.5
  • Required: No
  • User Property: i18n.bundleCsvFile
  • Default: ${basedir}/target/${project.artifactId}-i18n.csv

<bundleCsvSeparator>

Deprecated. since 3.3, prefer use the new mojo generate-csv-bundle instead
Char separator used when generating the csv bundle file if parameter generateCsvFile is on.
  • Type: java.lang.String
  • Since: 2.5
  • Required: No
  • User Property: i18n.bundleCsvSeparator
  • Default:

<bundleFormatConverter>

Converter used to change format of bundles.
  • Type: java.lang.String
  • Since: 2.4
  • Required: No
  • User Property: i18n.bundleFormatConverter

<bundleInputEncoding>

Encoding used to load any i18n property files. If not defined, will use the encoding parameter.
  • Type: java.lang.String
  • Since: 2.4
  • Required: No
  • User Property: i18n.bundleInputEncoding

<bundleOutputDir>

Root directory where to generate aggregated bundles (this directory will be added as resources of the project).
  • Type: java.io.File
  • Since: 1.0.0
  • Required: Yes
  • User Property: i18n.bundleOutputDir
  • Default: ${basedir}/target/generated-sources/resources

<bundleOutputEncoding>

Encoding used to write any i18n property files. If not defined, will use the encoding parameter.
  • Type: java.lang.String
  • Since: 2.4
  • Required: No
  • User Property: i18n.bundleOutputEncoding

<bundleOutputName>

Name of the bundle to generate.
  • Type: java.lang.String
  • Since: 1.0.2
  • Required: Yes
  • User Property: i18n.bundleOutputName
  • Default: ${project.artifactId}-i18n

<bundleOutputPackage>

Package name of the generate aggregated bundles. Note: By default we use the META-INF package since it is the favorite package of I18n runtime initializer. The package name is dotted as it will be stored as folder like in Java language. Example :
    package name : foo.bar
    directory    : foo/bar
  • Type: java.lang.String
  • Since: 2.3.2
  • Required: Yes
  • User Property: i18n.bundleOutputPackage
  • Default: META-INF

<bundles>

Locales to treate, separated by comma. Example :
fr_FR,en_GB
  • Type: java.lang.String
  • Since: 0.12
  • Required: Yes
  • User Property: i18n.bundles
  • Default: fr_FR,en_GB

<checkBundle>

A flag to check that bundles are complete (no missing i18n translations). Note : This behaviour will be activated is failsIfWarning is on.
  • Type: boolean
  • Since: 1.0.0
  • Required: No
  • User Property: i18n.checkBundle
  • Default: true

<collectOutputDir>

Directory where to generate bundles.
  • Type: java.io.File
  • Since: 1.0.2
  • Required: Yes
  • User Property: i18n.collectOutputDir
  • Default: ${basedir}/target/i18n

<collectOutputName>

BAse name of file which contains bundles locations.
  • Type: java.lang.String
  • Since: 1.0.2
  • Required: Yes
  • User Property: i18n.collectOutputName
  • Default: collect-${project.artifactId}-i18n

<encoding>

Encoding used to load and store properties.
  • Type: java.lang.String
  • Since: 0.12
  • Required: Yes
  • User Property: i18n.encoding
  • Default: ${project.build.sourceEncoding}

<failsIfAnyKeyMissingInBundle>

A flag to make the build fails if there is some missing keys. Note : This parameter should be used in a release profile to ensure bundles are complete.
  • Type: boolean
  • Since: 3.6.1
  • Required: No
  • User Property: i18n.failsIfAnyKeyMissingInBundle
  • Default: false

<failsIfAnyKeyMissingValue>

A flag to make the build fails if there is some missing key values. Note : This parameter should be used in a release profile to ensure bundles are complete.
  • Type: boolean
  • Since: 3.6.1
  • Required: No
  • User Property: i18n.failsIfAnyKeyMissingValue
  • Default: false

<failsIfWarning>

Deprecated. since 3.6.1, prefer use now failsIfAnyKeyMissingValue or failsIfAnyKeyMissingInBundle.
A flag to make the build fails if there is some warnings while generating bundle, says when it misses some translations. Note : This parameter should be used in a release profile to ensure bundles are complete.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: i18n.failsIfWarning
  • Default: false

<generateCsvFile>

Deprecated. since 3.3, prefer use the new mojo generate-csv-bundle instead
A flag to generate the i18n csv file wich contains all translation for all locales. Useful to translate from a language to another one.
  • Type: boolean
  • Since: 2.5
  • Required: No
  • User Property: i18n.generateCsvFile
  • Default: false

<generateDefaultLocale>

A flag to generate a bundle with the first locale defined as a default bundle (with no locale specialization).
  • Type: boolean
  • Since: 2.1
  • Required: No
  • User Property: i18n.generateDefaultLocale
  • Default: false

<generateDefinitionFile>

A flag to generate the i18n definition file. This file contains all generated bundles and the paths of all i18n artifacts used to make it.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: i18n.generateDefinitionFile
  • Default: true

<showEmpty>

A flag to show missing i18n translation. Note : Need the checkBundle to be activated).
  • Type: boolean
  • Since: 1.0.0
  • Required: No
  • User Property: i18n.showEmpty
  • Default: false

<silent>

Silent flag to see only errors in console.
  • Type: boolean
  • Since: 1.0.0-rc-5
  • Required: No
  • User Property: i18n.silent
  • Default: false

<verbose>

Verbose flag. Note : if not setted, we used the maven.verbose property.
  • Type: boolean
  • Since: 0.12
  • Required: No
  • User Property: i18n.verbose
  • Default: ${maven.verbose}