I think there are two issues here:
1. the "global" issue of "localisation," which is a strategy you need to implement on an application-wide basis. typically, this will involve storing language-dependent strings as resources, and then, depending on the user's system-wide "culture settings," making sure the appropriate strings (or other items, like culture dependent decimal-point separators, etc.) are used [
^].
2. the issue of validating a given string maps to a specific Enumeration value in an 'Enum:
public enum TestEnum
{
NoValue = 0,
one,two,three
}
public TestEnum StringToTestEnum(string input, bool ignoreCase = false)
{
TestEnum result;
TestEnum.TryParse(input, ignoreCase, out result);
return result;
}
Here the use of a special Enumeration value "NoValue" allows you to distinguish that no conversion is possible with a given string.
I think you need to make some strategic decisions about the number of languages your application may need to support in the future, and if non-Roman character sets will be used. There are many well-written resources on the web, and here, on CodeProject, dealing with language localisation issues, like: [
^], [
^], [
^].
imho, dealing with how to make your code accept variable names, etc., in only two languages, for only certain objects in your application is a waste of time.
However, there are ways to differentially compile your code base, including use of #Define/#Undef/#If modifiers, using MEF: [
^] to load code at run-time based on variables, etc. You can use ConditionalAttributes on Classes, and on methods whose return Type is 'void: [
^].