Package core.helpers
Class LocalizationHelper
java.lang.Object
core.helpers.LocalizationHelper
public class LocalizationHelper extends Object
local: in project directory web: in web config directory mobile: in mobile
config directory
- Author:
- Ehsan Matean
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_LOCALstatic StringLOCALIZATION_PATH -
Constructor Summary
Constructors Constructor Description LocalizationHelper() -
Method Summary
Modifier and Type Method Description static List<String>getColumnHeaders(org.apache.commons.csv.CSVParser parser)gets the list of the column in csv filestatic FilegetCsvFile(String filename)static Map<String,String>jsonFileToMap(String filePath)static Map<String,String>jsonStringToMap(String jsonString)static voidloadCsvFileContent()loads the content of the csv filestatic voidlocalizationLoadJson(String fileName)loads localization map from a json file to the test object datastatic voidlocalizationSetupCsv(String language)sets the language for csv localization filestatic Stringlocalize(String key)static StringlocalizeFromCsv(String value)static StringlocalizeFromJson(String key)gets local language from json file specified in properties file
-
Field Details
-
DEFAULT_LOCAL
-
LOCALIZATION_PATH
-
-
Constructor Details
-
LocalizationHelper
public LocalizationHelper()
-
-
Method Details
-
localize
-
localizeFromCsv
-
localizationSetupCsv
sets the language for csv localization file- Parameters:
language-
-
localizeFromJson
gets local language from json file specified in properties file- Parameters:
key-- Returns:
-
localizationLoadJson
loads localization map from a json file to the test object data- Parameters:
fileName-
-
jsonStringToMap
-
jsonFileToMap
-
loadCsvFileContent
public static void loadCsvFileContent()loads the content of the csv file- Throws:
Exception
-
getColumnHeaders
gets the list of the column in csv file- Parameters:
parser-- Returns:
-
getCsvFile
-