public static string GetWithParam(string term, string valueX) { string words = LocalizationManager.GetTranslation(term); if (words == null) { words = term; } int i2p_ZeroLength = words.IndexOf("[i2p_Zero]", System.StringComparison.Ordinal); int i2p_OneLength = words.IndexOf("[i2p_One]", System.StringComparison.Ordinal); if (valueX == "0") { if (i2p_ZeroLength == -1) { if (i2p_OneLength == -1) { /* no need to trim. */ } else { words = words.Substring(0, i2p_OneLength); } } else { words = words.Substring(i2p_ZeroLength + 9); } } else if (valueX == "1") { if (i2p_OneLength == -1) { if (i2p_ZeroLength == -1) { /* no need to trim. */ } else { words = words.Substring(0, i2p_ZeroLength); } } else { words = words.Substring(i2p_OneLength + 9); } } else { if (i2p_ZeroLength == -1) { if (i2p_OneLength == -1) { /* no need to trim */ } else { words = words.Substring(0, i2p_OneLength); } } else { words = words.Substring(0, i2p_ZeroLength); } } if (words.Contains("{[X]}")) { words = words.Replace("{[X]}", valueX); } return words; }