public static string ParserString(string origin) { if (origin == string.Empty) { return(string.Empty); } return(LanguagePack.GetLanguageWord(origin)); }
public static string ParserMessage(string originMsg) { if (originMsg == string.Empty) { return(string.Empty); } string errMsg = originMsg; Regex regex = new Regex(@"\$([A-Za-z0-9_]+)"); string word = string.Empty; foreach (Match match in regex.Matches(errMsg)) { word = LanguagePack.GetLanguageWord(match.Value); if (word != null && word != string.Empty) { errMsg = errMsg.Replace(match.Value, word); } } return(errMsg); }