Class Translate
- java.lang.Object
- 
- org.apache.tools.ant.ProjectComponent
- 
- org.apache.tools.ant.Task
- 
- org.apache.tools.ant.taskdefs.MatchingTask
- 
- org.apache.tools.ant.taskdefs.optional.i18n.Translate
 
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable,- SelectorContainer
 
 public class Translate extends MatchingTask Translates text embedded in files using Resource Bundle files. Since ant 1.6 preserves line endings
- 
- 
Field Summary- 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTaskfileset
 - 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description Translate()
 - 
Method SummaryModifier and Type Method Description voidaddFileset(FileSet set)Adds a set of files to translate as a nested fileset element.voidexecute()Check attributes values, load resource map and translatevoidsetBundle(java.lang.String bundle)Sets Family name of resource bundle; required.voidsetBundleCountry(java.lang.String bundleCountry)Sets locale specific country of resource bundle; optional.voidsetBundleEncoding(java.lang.String bundleEncoding)Sets Resource Bundle file encoding scheme; optional.voidsetBundleLanguage(java.lang.String bundleLanguage)Sets locale specific language of resource bundle; optional.voidsetBundleVariant(java.lang.String bundleVariant)Sets locale specific variant of resource bundle; optional.voidsetDestEncoding(java.lang.String destEncoding)Sets destination file encoding scheme; optional.voidsetEndToken(java.lang.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(java.lang.String srcEncoding)Sets source file encoding scheme; optional, defaults to encoding of local system.voidsetStartToken(java.lang.String startToken)Sets starting token to identify keys; required.voidsetToDir(java.io.File toDir)Sets Destination directory; required.- 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTaskadd, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 - 
Methods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 - 
Methods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation
 
- 
 
- 
- 
- 
Method Detail- 
setBundlepublic void setBundle(java.lang.String bundle) Sets Family name of resource bundle; required.- Parameters:
- bundle- family name of resource bundle
 
 - 
setBundleLanguagepublic void setBundleLanguage(java.lang.String bundleLanguage) Sets locale specific language of resource bundle; optional.- Parameters:
- bundleLanguage- language of the bundle
 
 - 
setBundleCountrypublic void setBundleCountry(java.lang.String bundleCountry) Sets locale specific country of resource bundle; optional.- Parameters:
- bundleCountry- country of the bundle
 
 - 
setBundleVariantpublic void setBundleVariant(java.lang.String bundleVariant) Sets locale specific variant of resource bundle; optional.- Parameters:
- bundleVariant- locale variant of resource bundle
 
 - 
setToDirpublic void setToDir(java.io.File toDir) Sets Destination directory; required.- Parameters:
- toDir- destination directory
 
 - 
setStartTokenpublic void setStartToken(java.lang.String startToken) Sets starting token to identify keys; required.- Parameters:
- startToken- starting token to identify keys
 
 - 
setEndTokenpublic void setEndToken(java.lang.String endToken) Sets ending token to identify keys; required.- Parameters:
- endToken- ending token to identify keys
 
 - 
setSrcEncodingpublic void setSrcEncoding(java.lang.String srcEncoding) Sets source file encoding scheme; optional, defaults to encoding of local system.- Parameters:
- srcEncoding- source file encoding
 
 - 
setDestEncodingpublic void setDestEncoding(java.lang.String destEncoding) Sets destination file encoding scheme; optional. Defaults to source file encoding- Parameters:
- destEncoding- destination file encoding scheme
 
 - 
setBundleEncodingpublic void setBundleEncoding(java.lang.String bundleEncoding) Sets Resource Bundle file encoding scheme; optional. Defaults to source file encoding- Parameters:
- bundleEncoding- bundle file encoding scheme
 
 - 
setForceOverwritepublic 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
 
 - 
addFilesetpublic void addFileset(FileSet set) Adds a set of files to translate as a nested fileset element.- Parameters:
- set- the fileset to be added
 
 - 
executepublic void execute() throws BuildExceptionCheck attributes values, load resource map and translate- Overrides:
- executein class- Task
- Throws:
- BuildException- if the required attributes are not set Required :- bundle
- starttoken
- endtoken
 
 
 
- 
 
-