There are many ways you could do this, including Excel sheets or a database.
In code, you could, for example, pass in the word "German" or "English" as a GLOBAL PARAMETER (GP) when you start the test.
Then, you could have a data set of the two different words for each instance and it would return the correct word based on the GP passed in.
If you GP is called "LOCALIZATION" then you could have a method called GetLocalization that fetchs the correct word based on the GP and the index word (let's say you use German as the index). If you pass "German", then the method would return the word just passed to it, but if you pass "English" as the Localization, the method would pass the English word instead.
Code: Select all
private static Dictionary<string, string> LocalizationTable = new Dictionary<string, string>();
//in the init method (or main) add the words to the dictionary:
LocalizationTable.Add("Ja", "Yes"); //and so on for all the words needed...
public static string GetLocalization(string localization, string germanWord)
{
if (localization.Equals("English")
{
return LocalizationTable[germanWord]; //returns the English word and stops the method
}
return germanWord; //Returns the German word, if localization is not English
}
You would then need to use this everywhere that you wanted to localize.
I'm sure there are other ways to do it. I don't have to deal with this type of thing, so mine may not be the best way.
You could also look into using a database and having a stored procedure that sets the localization of the dataset in the DB at startup, based on the same GP above.
Shortcuts usually aren't...