Package de.fenvariel.maven.gettext
Class GettextMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- de.fenvariel.maven.gettext.AbstractGettextMojo
-
- de.fenvariel.maven.gettext.GettextMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="gettext", defaultPhase=GENERATE_RESOURCES) public class GettextMojo extends AbstractGettextMojoInvokes xgettext to extract messages from source code and store them in the keys.pot file.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringcopyrightHolderSet the copyright holder in the output.protected java.lang.StringencodingThe encoding of the source Java files.protected org.apache.maven.model.FileSetextraSourceFilesAn optional set of source files that should be parsed with xgettext.protected booleanjoinExistingprotected java.lang.StringkeywordsThe keywords the xgettext parser will look for to extract messages.protected java.lang.StringmsgidBugsAddressSet the reporting address for msgid bugs.protected booleanomitHeaderprotected java.lang.StringpackageNameSet the package name in the header of the output.protected java.lang.StringpackageVersionSet the package version in the header of the output.protected SortsortSet if the output should be sorted.protected java.lang.StringxgettextCmdThe xgettext command.-
Fields inherited from class de.fenvariel.maven.gettext.AbstractGettextMojo
extraArguments, keysFile, location, outputDirectory, poDirectory, project, sourceDirectory
-
-
Constructor Summary
Constructors Constructor Description GettextMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.io.FilecreateListFile(java.lang.String[] files, java.util.List<java.lang.String> fileList)voidexecute()private java.lang.StringgetAbsolutePath(java.lang.String path)private java.lang.StringtoUnixPath(java.lang.String path)-
Methods inherited from class de.fenvariel.maven.gettext.AbstractGettextMojo
addExtraArguments
-
-
-
-
Field Detail
-
encoding
@Parameter(defaultValue="utf-8", required=true) protected java.lang.String encodingThe encoding of the source Java files. utf-8 is a superset of ascii.
-
keywords
@Parameter(defaultValue="-k_ -k_n1,2", required=true) protected java.lang.String keywordsThe keywords the xgettext parser will look for to extract messages. The default value works with libraries that use the _-format method, as recommended by Gettext documentation.
-
xgettextCmd
@Parameter(defaultValue="xgettext", required=true) protected java.lang.String xgettextCmdThe xgettext command.
-
extraSourceFiles
@Parameter protected org.apache.maven.model.FileSet extraSourceFiles
An optional set of source files that should be parsed with xgettext.<extraSourceFiles> <directory>${basedir}</directory> <includes> <include>** /*.jsp</include> </includes> <excludes> <exclude>** /*.txt</exclude> </excludes> </extraSourceFiles>
-
omitHeader
@Parameter(defaultValue="false") protected boolean omitHeader
-
joinExisting
@Parameter(defaultValue="false") protected boolean joinExisting
-
copyrightHolder
@Parameter(property="project.organisation.name") protected java.lang.String copyrightHolder
Set the copyright holder in the output. string should be the copyright holder of the surrounding package. (Note that the msgstr strings, extracted from the package's sources, belong to the copyright holder of the package.) Translators are expected to transfer or disclaim the copyright for their translations, so that package maintainers can distribute them without legal risk. If string is empty, the output files are marked as being in the public domain; in this case, the translators are expected to disclaim their copyright, again so that package maintainers can distribute them without legal risk. The default value for string is the '' so public domain.
-
packageName
@Parameter(property="project.build.finalName") protected java.lang.String packageName
Set the package name in the header of the output.
-
packageVersion
@Parameter(property="project.version") protected java.lang.String packageVersion
Set the package version in the header of the output. This option has an effect only if the 'packageName' option is also used.
-
sort
@Parameter(defaultValue="FALSE") protected Sort sort
Set if the output should be sorted.
-
msgidBugsAddress
@Parameter protected java.lang.String msgidBugsAddress
Set the reporting address for msgid bugs. This is the email address or URL to which the translators shall report bugs in the untranslated strings: - Strings which are not entire sentences; see the maintainer guidelines in Preparing Strings. - Strings which use unclear terms or require additional context to be understood. - Strings which make invalid assumptions about notation of date, time or money. - Pluralisation problems. - Incorrect English spelling. - Incorrect formatting. It can be your email address, or a mailing list address where translators can write to without being subscribed, or the URL of a web page through which the translators can contact you. The default value is empty, which means that translators will be clueless! Don't forget to specify this option.
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
createListFile
private java.io.File createListFile(java.lang.String[] files, java.util.List<java.lang.String> fileList)
-
getAbsolutePath
private java.lang.String getAbsolutePath(java.lang.String path)
-
toUnixPath
private java.lang.String toUnixPath(java.lang.String path)
-
-