Assuming the key always remains unchanged, short the triple to apply only to the value (also, if you compare several times, I would save the value isEnglish or isJapanese ):
typeLookup.add("6", Request.Cookies["language"] == "ja-JP" ? "中間" : "Q2");
However, you can always create an assistant:
Dictionary<string, string> typeLookup = new Dictionary<string, string>(); System.Action<String,String,String> japEng = (key,japaneseValue,englishValue) => { if (Request.Cookies["language"].Value == "ja-JP") typeLookup.Add(key, japaneseValue); else typeLookup.Add(key, englishValue); }; japEng("6", "中間", "Q2");
Another option ...
source share