Use xgettext-maven-plugin to extract strings from your source code that need translating. The Maven plugin extracts strings to an XLIFF file that you send for translating. Strings are extracted from the following locations:

Java source files

Javascript source files

XML representations of SVN resources (JCR Nodes)

Configuring String Extraction

Configure how the xgettext-maven-plugin tool extracts strings for your project.

Configures the parsing of Vault files. Identifies the JCR nodes that contain externalized strings and localization hints. Also identifies JCR nodes to ignore.

/parsers/javascript

Identifies the Javascript functions that externalize strings. You do not need to change this section.

/parsers/regexp

Configures the parsing of Java, JSP, and ExtJS Template files. You do not need to change this section.

/potentials

The formula for detecting strings to internationalize.

Identifying the Files to Parse

The /filter section of the i18n.any file identifies the files that the xgettext-maven-plugin tool parses. Add several include and exclude rules that identify files that are parsed and ignored, respectively. You should include all files and then exclude the files that you do not want to parse. Typically, you exclude file types that do not contribute to the UI, or files that define UI but are not being translated. The include and exclude rules have the following format:

{ /include "pattern" }{ /exclude "pattern" }

The pattern part of a rule is used to match the names of the files to include or exclude. The pattern prefix indicate whether you are matching a JCR node (its representation in Vault) or the file system.