Package com.jalios.jcms.tools
Class LangPropertiesChecker
java.lang.Object
com.jalios.jcms.tools.AbstractChecker
com.jalios.jcms.tools.LangPropertiesChecker
Check language properties for missing or duplicated internationalization string.
Calling this class in Eclipse:
Calling this class in Eclipse:
- create a Debug or Run Java application on this class
- arguments: specify which langProperties files or directory you want to check
JCMS lang properties (all langs)
LangPropertiesChecker ${workspace_loc}/JCMS/webapps/en/WEB-INF/jalios/languages
JCMS lang properties (en + fr only)
${workspace_loc}/JCMS/webapps/en/WEB-INF/jalios/languages/en.prop ${workspace_loc}/JCMS/webapps/en/WEB-INF/jalios/languages/fr.prop
Plugin lang properties (all langs)
${workspace_loc}/JCMS/webapps/en/WEB-INF/plugins/ACMEPlugin/properties/languages
Plugin lang properties (en + fr only)
${workspace_loc}/JCMS/webapps/en/WEB-INF/plugins/ACMEPlugin/properties/languages/en.prop ${workspace_loc}/JCMS/webapps/en/WEB-INF/plugins/ACMEPlugin/properties/languages/fr.prop
Note: some plugins may require core properties to pass tests. Eg: ESNPlugin where alert.name.recommendation property is declared in core I18N.prop
${workspace_loc}/JCMS/webapps/en/WEB-INF/jalios/languages/en.prop ${workspace_loc}/JCMS/webapps/en/WEB-INF/jalios/languages/fr.prop ${workspace_loc}/JCMS/webapps/en/WEB-INF/plugins/ESNPlugin/properties/languages/en.prop ${workspace_loc}/JCMS/webapps/en/WEB-INF/plugins/ESNPlugin/properties/languages/fr.prop- Since:
- jcms-5.0.1
- Author:
- Olivier Jaquemet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedHashMap<String, HashMap<String, Integer>> protected final org.apache.oro.text.regex.PatternCompilerstatic final PatternPattern used to match all date parameter such as{0,date,yyyy/MM/dd HH:mm}in a property valueprotected org.apache.oro.text.regex.Patternprotected final org.apache.oro.text.regex.PatternMatcherprotected org.apache.oro.text.regex.Patternprotected LangPropertiesFields inherited from class com.jalios.jcms.tools.AbstractChecker
CHANNEL, PROP_SUFFIX_FILE_FILTER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddPropertyKey(String propKey) Performs the following checks on the loaded languages properties : property missing in one of the required language property defined multiple timesstatic voidvoidsetCheckOnlyMissingProperties(boolean onlyMissing) Request that the checker only check for missing properties and not for their correctness.static voidstatic voidMethods inherited from class com.jalios.jcms.tools.AbstractChecker
getCheckedFile, getFileList, getFileList, loadLanguageProperties, loadProperties, loadProperties, saveError
-
Field Details
-
compiler
protected final org.apache.oro.text.regex.PatternCompiler compiler -
matcher
protected final org.apache.oro.text.regex.PatternMatcher matcher -
properties
-
langList
-
keyPattern
protected org.apache.oro.text.regex.Pattern keyPattern -
paramPattern
protected org.apache.oro.text.regex.Pattern paramPattern -
checkedPropertyMap
-
DATE_PARAMETER_PATTERN
Pattern used to match all date parameter such as{0,date,yyyy/MM/dd HH:mm}in a property value
-
-
Constructor Details
-
LangPropertiesChecker
-
-
Method Details
-
usage
-
usage
-
main
- Throws:
IOException
-
addPropertyKey
-
setCheckOnlyMissingProperties
public void setCheckOnlyMissingProperties(boolean onlyMissing) Request that the checker only check for missing properties and not for their correctness. Default is to check every required aspect possible.- Parameters:
onlyMissing- true to check only missing, false to perform every required aspect possible.
-
checkProperties
Performs the following checks on the loaded languages properties :- property missing in one of the required language
- property defined multiple times
- Returns:
- a CheckResult with errors if any
-