zhao
2021-07-19 8347f2fbddbd25369359dcb2da1233ac48a19fdc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
 
namespace HH.WMS.WebUI.LanService
{
    public class LanServiceDll
    {
        public static string translate(string key)
        {
            var cookie = HttpContext.Current.Request.Cookies.Get("lanGroup");
 
            string language = cookie == null ? "zh_CN" : cookie.Value;
            string text = "";
            var lanGroup = HttpRuntime.Cache.Get("lanGroup") as Dictionary<string, Dictionary<string, string>>;
 
            if (lanGroup != null && lanGroup.Keys.Contains(language))
            {
                Dictionary<string, string> _lanGroup = lanGroup[language];
                if (!string.IsNullOrEmpty(key) && _lanGroup.Keys.Contains(key))
                {
                    text = _lanGroup[key];
                }
            }
            return text;
        }
    }
}