126 lines
5.6 KiB
C#
126 lines
5.6 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// i18n 字符串资源 - 由 Strings.resx 生成,请勿直接编辑。
|
|
// 修改文案请编辑 Strings.resx 及对应语言的 Strings.{Culture}.resx。
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
using System.Globalization;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Resources;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace Ink_Canvas.Properties
|
|
{
|
|
/// <summary>
|
|
/// 本地化字符串资源,用于 i18n。当前 UI 语言由 Thread.CurrentThread.CurrentUICulture 决定。
|
|
/// </summary>
|
|
[CompilerGenerated]
|
|
public static class Strings
|
|
{
|
|
private const string EmbeddedEnUsResxName = "Ink_Canvas.Properties.Strings.en-US.resx";
|
|
private static readonly object EnUsLock = new object();
|
|
private static Dictionary<string, string> _embeddedEnUs;
|
|
private static ResourceManager _resourceMan;
|
|
private static CultureInfo _resourceCulture;
|
|
|
|
/// <summary>
|
|
/// 用于此类资源查找的 ResourceManager。
|
|
/// </summary>
|
|
public static ResourceManager ResourceManager
|
|
{
|
|
get
|
|
{
|
|
if (ReferenceEquals(_resourceMan, null))
|
|
{
|
|
var temp = new ResourceManager("Ink_Canvas.Properties.Strings", typeof(Strings).Assembly);
|
|
_resourceMan = temp;
|
|
}
|
|
return _resourceMan;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 重写当前线程的 CurrentUICulture,以在此强类型资源类中进行资源查找。
|
|
/// 若不设置,则使用 Thread.CurrentThread.CurrentUICulture。
|
|
/// </summary>
|
|
public static CultureInfo Culture
|
|
{
|
|
get => _resourceCulture;
|
|
set => _resourceCulture = value;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据键获取本地化字符串;若未设置 Culture 则使用当前线程 CurrentUICulture。
|
|
/// </summary>
|
|
public static string GetString(string key)
|
|
{
|
|
var culture = _resourceCulture ?? CultureInfo.CurrentUICulture;
|
|
if (IsEnglishCulture(culture))
|
|
{
|
|
var enUsMap = GetEmbeddedEnUsMap();
|
|
if (enUsMap.TryGetValue(key, out var enValue))
|
|
{
|
|
return enValue;
|
|
}
|
|
}
|
|
return ResourceManager.GetString(key, culture);
|
|
}
|
|
|
|
private static bool IsEnglishCulture(CultureInfo culture)
|
|
{
|
|
if (culture == null) return false;
|
|
if (culture.Name.StartsWith("en", System.StringComparison.OrdinalIgnoreCase)) return true;
|
|
return culture.TwoLetterISOLanguageName.Equals("en", System.StringComparison.OrdinalIgnoreCase);
|
|
}
|
|
|
|
private static Dictionary<string, string> GetEmbeddedEnUsMap()
|
|
{
|
|
if (_embeddedEnUs != null) return _embeddedEnUs;
|
|
lock (EnUsLock)
|
|
{
|
|
if (_embeddedEnUs != null) return _embeddedEnUs;
|
|
var map = new Dictionary<string, string>(System.StringComparer.Ordinal);
|
|
var asm = typeof(Strings).Assembly;
|
|
using (var stream = asm.GetManifestResourceStream(EmbeddedEnUsResxName))
|
|
{
|
|
if (stream != null)
|
|
{
|
|
using (var reader = new ResXResourceReader(stream))
|
|
{
|
|
foreach (DictionaryEntry entry in reader)
|
|
{
|
|
if (entry.Key is string k && entry.Value is string v)
|
|
{
|
|
map[k] = v;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
_embeddedEnUs = map;
|
|
return _embeddedEnUs;
|
|
}
|
|
}
|
|
|
|
public static string Nav_Plugins => GetString(nameof(Nav_Plugins)) ?? "插件";
|
|
public static string Nav_Startup => GetString(nameof(Nav_Startup)) ?? "启动设置";
|
|
public static string Nav_Canvas => GetString(nameof(Nav_Canvas)) ?? "画布设置";
|
|
public static string Nav_CrashAction => GetString(nameof(Nav_CrashAction)) ?? "崩溃处理";
|
|
public static string Nav_Gesture => GetString(nameof(Nav_Gesture)) ?? "手势";
|
|
public static string Nav_InkRecognition => GetString(nameof(Nav_InkRecognition)) ?? "墨迹识别";
|
|
public static string Nav_PPT => GetString(nameof(Nav_PPT)) ?? "PPT";
|
|
public static string Nav_Advanced => GetString(nameof(Nav_Advanced)) ?? "高级";
|
|
public static string Nav_Automation => GetString(nameof(Nav_Automation)) ?? "自动化";
|
|
public static string Nav_RandomWindow => GetString(nameof(Nav_RandomWindow)) ?? "随机选人";
|
|
public static string Nav_Theme => GetString(nameof(Nav_Theme)) ?? "主题";
|
|
public static string Nav_Shortcuts => GetString(nameof(Nav_Shortcuts)) ?? "快捷键";
|
|
public static string Nav_About => GetString(nameof(Nav_About)) ?? "关于";
|
|
public static string App_Title => GetString(nameof(App_Title)) ?? "InkCanvasforClass";
|
|
public static string Booth_Resolution_Tooltip => GetString(nameof(Booth_Resolution_Tooltip)) ?? "展台/截图分辨率";
|
|
public static string Tray_TempShowMainWindow => GetString(nameof(Tray_TempShowMainWindow)) ?? "显示主窗口(2分钟)";
|
|
public static string Tray_OpenSettings => GetString(nameof(Tray_OpenSettings)) ?? "打开设置";
|
|
}
|
|
}
|