de.viaboxx.nlstools.tasks
Class OptimizeBundlesTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
de.viaboxx.nlstools.tasks.OptimizeBundlesTask
- All Implemented Interfaces:
- Cloneable
public class OptimizeBundlesTask
- extends org.apache.tools.ant.Task
Description: analyze nls-texts in bundle files (mentioned in 'masterFile')
and remove all texts that have an equal common translation.
This reduces the bundles by removing redundant translations.
masterFile = file with file names to analyze/optimize.
The task will update each file in 'masterFile'.
example:
<taskdef name="optbundles"
classname="de.viaboxx.nlstools.tasks.OptimizeBundlesTask">
<classpath refid="maven.test.classpath"/>
</taskdef>
<optbundles masterFile="allBundles.txt"
commonBundleFile="Common.xml"
commonBundleBaseName="/Common"
commonEntryKeyPrefix="common"
/>
Transformation examples:
order.address.city => common.city
customer.firstName => common.firstName
Removes the specific text from the bundles, where the common text is equal.
If "commonEntryKeyPrefix" not set, replace equal keys in bundles.
If "deleteEmptyEntries" is true, remove text and entries without equal translations in bundles.
------------------------------
file allBundles.txt (example):
common.xml
customer.xml
orders.xml
------------------------------
User: roman
Date: 08.10.2009
Time: 14:07:20
Copyright: Viaboxx GmbH
| 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 |
OptimizeBundlesTask
public OptimizeBundlesTask()
isDeleteEmptyEntries
public boolean isDeleteEmptyEntries()
setDeleteEmptyEntries
public void setDeleteEmptyEntries(boolean deleteEmptyEntries)
getMasterFile
public File getMasterFile()
setMasterFile
public void setMasterFile(File masterFile)
getCommonBundleFile
public String getCommonBundleFile()
setCommonBundleFile
public void setCommonBundleFile(String commonBundleFile)
getCommonBundleBaseName
public String getCommonBundleBaseName()
setCommonBundleBaseName
public void setCommonBundleBaseName(String commonBundleBaseName)
getCommonEntryKeyPrefix
public String getCommonEntryKeyPrefix()
setCommonEntryKeyPrefix
public void setCommonEntryKeyPrefix(String commonEntryKeyPrefix)
execute
public void execute()
- Overrides:
execute in class org.apache.tools.ant.Task
Copyright © 2014. All Rights Reserved.