csharp/2dust/v2rayN/v2rayN/v2rayN/Tool/UIRes.cs

UIRes.cs
using System.Collections.Generic;
using System.Reflection;
using System.Resources;

namespace v2rayN
{
    public clast UIRes
    {
        static ResourceManager res = new ResourceManager("v2rayN.Resx.ResUI", astembly.GetExecutingastembly());

        static string LoadString(ResourceManager resMgr, string key)
        {
            string value = resMgr.GetString(key);
            if (value == null)
            {
                throw new KeyNotFoundException($"key: {key}");
            }
            return value;
        }

        public static string I18N(string key)
        {
            return LoadString(res, key);
        }
    }
}