de.viaboxx.nlstools.tasks
Class MergeLocaleTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
de.viaboxx.nlstools.tasks.MergeLocaleTask
- All Implemented Interfaces:
- Cloneable
- Direct Known Subclasses:
- DiffMergeLocaleTask
public class MergeLocaleTask
- extends org.apache.tools.ant.Task
This task takes two bundles and is able to merge new locales in one file into the existing bundle.
This is useful if the translation is not a complete version of the locale bundle and you can't just
replace the file. If there are translations missing, it inserts empty messages for that key.
Example:
<taskdef name="mergeLocale">
classname="de.viaboxx.nlstools.tasks.MergeLocaleTask">
<classpath refid="maven.test.classpath"/>
</taskdef>
<mergeLocale
from="src/main/bundles/Common.xml"
with="src/main/bundles/Common_de_DE.xml"
locales="de_DE"
to="src/main/bundles/Common_de_DE.xml"/>
| Fields inherited from class org.apache.tools.ant.Task |
target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
description, location, project |
| Methods inherited from class org.apache.tools.ant.Task |
bindToOwner, 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.ProjectComponent |
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
loadedBundles
protected MBBundles loadedBundles
translatedBundles
protected MBBundles translatedBundles
MergeLocaleTask
public MergeLocaleTask()
getFrom
public String getFrom()
- The xml file with path name to read from
- Returns:
setFrom
public void setFrom(String from)
getTo
public String getTo()
- The xml file with the path name to write into
- Returns:
setTo
public void setTo(String to)
getWith
public String getWith()
- The xml file with new translated locales
- Returns:
setWith
public void setWith(String xmlWithNewLocale)
getLocales
public String getLocales()
- semicolon separated locale names
- Returns:
setLocales
public void setLocales(String locales)
execute
public void execute()
- Overrides:
execute in class org.apache.tools.ant.Task
processExecute
protected void processExecute()
outputExecute
protected void outputExecute()
throws Exception
- Throws:
Exception
loadExecute
protected void loadExecute()
throws Exception
- Throws:
Exception
findMBTextForLocale
protected MBText findMBTextForLocale(String key,
String locale,
MBBundles bundles)
Copyright © 2012. All Rights Reserved.