public class TranslationCheck extends AbstractFileSetCheck
The TranslationCheck class helps to ensure the correct translation of code by checking property files for consistency regarding their keys. Two property files describing one and the same context are consistent if they contain the same keys.
An example of how to configure the check is:
<module name="Translation"/>Check has a property basenameSeparator which allows setting separator in file names, default value is '_'.
E.g.:
messages_test.properties //separator is '_'
app-dev.properties //separator is '-'
| Constructor and Description |
|---|
TranslationCheck()
Creates a new
TranslationCheck instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
beginProcessing(String charset)
Called when about to be called to process a set of files.
|
void |
finishProcessing()
Called when all the files have been processed.
|
protected void |
processFiltered(File file,
List<String> lines)
Called to process a file that matches the specified file extensions.
|
void |
setBasenameSeparator(String basenameSeparator)
Sets the separator used to determine the basename of a property file.
|
destroy, fireErrors, getMessageCollector, getMessageDispatcher, init, log, log, process, setFileExtensions, setMessageDispatchergetCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconfigurecontextualizepublic TranslationCheck()
TranslationCheck instance.public void beginProcessing(String charset)
AbstractFileSetCheckbeginProcessing in interface FileSetCheckbeginProcessing in class AbstractFileSetCheckcharset - the character set used to read the files.protected void processFiltered(File file, List<String> lines)
AbstractFileSetCheckprocessFiltered in class AbstractFileSetCheckfile - the file to be processedlines - an immutable list of the contents of the file.public void finishProcessing()
AbstractFileSetCheckfinishProcessing in interface FileSetCheckfinishProcessing in class AbstractFileSetCheckpublic void setBasenameSeparator(String basenameSeparator)
basenameSeparator - the basename separatorCopyright © 2001–2015. All rights reserved.