org.apache.tools.ant.taskdefs.optional.i18n

Class Translate

public class Translate extends MatchingTask

Translates text embedded in files using Resource Bundle files. Since ant 1.6 preserves line endings
Method Summary
voidaddFileset(FileSet set)
Adds a set of files to translate as a nested fileset element.
voidexecute()
Check attributes values, load resource map and translate
voidsetBundle(String bundle)
Sets Family name of resource bundle; required.
voidsetBundleCountry(String bundleCountry)
Sets locale specific country of resource bundle; optional.
voidsetBundleEncoding(String bundleEncoding)
Sets Resource Bundle file encoding scheme; optional.
voidsetBundleLanguage(String bundleLanguage)
Sets locale specific language of resource bundle; optional.
voidsetBundleVariant(String bundleVariant)
Sets locale specific variant of resource bundle; optional.
voidsetDestEncoding(String destEncoding)
Sets destination file encoding scheme; optional.
voidsetEndToken(String endToken)
Sets ending token to identify keys; required.
voidsetForceOverwrite(boolean forceOverwrite)
Whether or not to overwrite existing file irrespective of whether it is newer than the source file as well as the resource bundle file.
voidsetSrcEncoding(String srcEncoding)
Sets source file encoding scheme; optional, defaults to encoding of local system.
voidsetStartToken(String startToken)
Sets starting token to identify keys; required.
voidsetToDir(File toDir)
Sets Destination directory; required.

Method Detail

addFileset

public void addFileset(FileSet set)
Adds a set of files to translate as a nested fileset element.

Parameters: set the fileset to be added

execute

public void execute()
Check attributes values, load resource map and translate

Throws: BuildException if the required attributes are not set Required :

setBundle

public void setBundle(String bundle)
Sets Family name of resource bundle; required.

Parameters: bundle family name of resource bundle

setBundleCountry

public void setBundleCountry(String bundleCountry)
Sets locale specific country of resource bundle; optional.

Parameters: bundleCountry country of the bundle

setBundleEncoding

public void setBundleEncoding(String bundleEncoding)
Sets Resource Bundle file encoding scheme; optional. Defaults to source file encoding

Parameters: bundleEncoding bundle file encoding scheme

setBundleLanguage

public void setBundleLanguage(String bundleLanguage)
Sets locale specific language of resource bundle; optional.

Parameters: bundleLanguage langage of the bundle

setBundleVariant

public void setBundleVariant(String bundleVariant)
Sets locale specific variant of resource bundle; optional.

Parameters: bundleVariant locale variant of resource bundle

setDestEncoding

public void setDestEncoding(String destEncoding)
Sets destination file encoding scheme; optional. Defaults to source file encoding

Parameters: destEncoding destination file encoding scheme

setEndToken

public void setEndToken(String endToken)
Sets ending token to identify keys; required.

Parameters: endToken ending token to identify keys

setForceOverwrite

public void setForceOverwrite(boolean forceOverwrite)
Whether or not to overwrite existing file irrespective of whether it is newer than the source file as well as the resource bundle file. Defaults to false.

Parameters: forceOverwrite whether or not to overwrite existing files

setSrcEncoding

public void setSrcEncoding(String srcEncoding)
Sets source file encoding scheme; optional, defaults to encoding of local system.

Parameters: srcEncoding source file encoding

setStartToken

public void setStartToken(String startToken)
Sets starting token to identify keys; required.

Parameters: startToken starting token to identify keys

setToDir

public void setToDir(File toDir)
Sets Destination directory; required.

Parameters: toDir destination directory

Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.