Class 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
    • Constructor Detail

      • Translate

        public Translate()
    • Method Detail

      • setBundle

        public void setBundle​(java.lang.String bundle)
        Sets Family name of resource bundle; required.
        bundle - family name of resource bundle
      • setBundleLanguage

        public void setBundleLanguage​(java.lang.String bundleLanguage)
        Sets locale specific language of resource bundle; optional.
        bundleLanguage - language of the bundle
      • setBundleCountry

        public void setBundleCountry​(java.lang.String bundleCountry)
        Sets locale specific country of resource bundle; optional.
        bundleCountry - country of the bundle
      • setBundleVariant

        public void setBundleVariant​(java.lang.String bundleVariant)
        Sets locale specific variant of resource bundle; optional.
        bundleVariant - locale variant of resource bundle
      • setToDir

        public void setToDir​( toDir)
        Sets Destination directory; required.
        toDir - destination directory
      • setStartToken

        public void setStartToken​(java.lang.String startToken)
        Sets starting token to identify keys; required.
        startToken - starting token to identify keys
      • setEndToken

        public void setEndToken​(java.lang.String endToken)
        Sets ending token to identify keys; required.
        endToken - ending token to identify keys
      • setSrcEncoding

        public void setSrcEncoding​(java.lang.String srcEncoding)
        Sets source file encoding scheme; optional, defaults to encoding of local system.
        srcEncoding - source file encoding
      • setDestEncoding

        public void setDestEncoding​(java.lang.String destEncoding)
        Sets destination file encoding scheme; optional. Defaults to source file encoding
        destEncoding - destination file encoding scheme
      • setBundleEncoding

        public void setBundleEncoding​(java.lang.String bundleEncoding)
        Sets Resource Bundle file encoding scheme; optional. Defaults to source file encoding
        bundleEncoding - bundle file encoding scheme
      • 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.
        forceOverwrite - whether or not to overwrite existing files
      • addFileset

        public void addFileset​(FileSet set)
        Adds a set of files to translate as a nested fileset element.
        set - the fileset to be added
      • execute

        public void execute()
                     throws BuildException
        Check attributes values, load resource map and translate
        execute in class Task
        BuildException - if the required attributes are not set Required :
        • bundle
        • starttoken
        • endtoken