I am working on internationalizing a project that has a custom date picker. The en-US version displays a message like to the user “Invalid date, valid format is mm/dd/yyyy.” The “Invalid date, valid format is mm/dd/yyyy” is a resource string. The allows for the date format to be customized from the culture default so simply translating the ‘mm/dd/yyyy’ part is not an option. I know how to get the date format from the current culture (in .net) but I was wondering if there a way translate the m’s, d’s, and y’s or what the generally accepted practice for this type of problem is?
Share
You would need to externalize it that is move it to resource file. There is no practice as such, but what I could recommend is to actually generate the entry from DateTimeFormatInfo (there is a format switch “g” that gives you so-called general, that is default date & time format). Adding appropriate comment won’t hurt either.