l10n:pseudo

Allows you to do an automated pseudo-localization to test the completeness of your project's internationalization effort. This technique simulates the process of localizing products by prefixing and suffixing all your internationalized messages.

For more information on pseudo-localization, see I18N Testing Guidelines and Techniques.

For more general information on localization, see Java Internationalization: Localization with ResourceBundles.

Mojo Attributes:

  • Requires a Maven 2.0 project to execute.
  • Automatically executes within the lifecycle phase: process-classes

Optional Parameters

Name Type Description
excludes List The list of resources we don't want to pseudo-localize. By default, no files are excluded.
includes List The list of resources we want to pseudo-localize. If not specified, the default pattern is **/*.properties.
inputDirectory File The input directory from which we copy the resources. The plugin scans the build output directory by default, in order to have the complete set of resources that end up in the product. Default value is ${project.build.outputDirectory}.
outputDirectory File The output directory into which to copy the resources. Default value is ${project.build.outputDirectory}.
pseudoLocPattern String Pattern for replacement of localized string values. The plugin iterates over all properties in the property files and replaces the values using {@link java.text.MessageFormat} with this value as a formatting pattern. The pattern is expected to contain this sequence {0} exactly once with a prefix and/or suffix. Default value is XXX 多少 {0} YYY.
pseudoLocale String Locale name that is used for pseudo-localization. The resulting property files will have the following name: <filename>_<pseudoLocale>.properties. Default value is xx.

Parameter Details

excludes

The list of resources we don't want to pseudo-localize. By default, no files are excluded.

  • Type: java.util.List
  • Required: No

includes The list of resources we want to pseudo-localize. If not specified, the default pattern is **/*.properties.
  • Type: java.util.List
  • Required: No

inputDirectory The input directory from which we copy the resources. The plugin scans the build output directory by default, in order to have the complete set of resources that end up in the product.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.outputDirectory}

outputDirectory The output directory into which to copy the resources.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.outputDirectory}

pseudoLocPattern Pattern for replacement of localized string values. The plugin iterates over all properties in the property files and replaces the values using {@link java.text.MessageFormat} with this value as a formatting pattern. The pattern is expected to contain this sequence {0} exactly once with a prefix and/or suffix.
  • Type: java.lang.String
  • Required: No
  • Default: XXX 多少 {0} YYY

pseudoLocale Locale name that is used for pseudo-localization. The resulting property files will have the following name: <filename>_<pseudoLocale>.properties.
  • Type: java.lang.String
  • Required: No
  • Default: xx