using System;
namespace TeamAAS.Localization
{
///
/// C# 代码侧的翻译入口(非 XAML)。
/// 界面文案用 / ,会被构建扫描器收集进语言包;
/// 日志/通知等文案一律用 ,不进语言包。
///
public static class L10n
{
/// 翻译一条界面文案(原文即语言包 key)。
public static string T(string originalText) => GlobalLocalizationManager.Instance.Translate(originalText);
///
/// 翻译带变量的模板文案。模板里用 {0} {1} 占位,
/// 例如 F("执行完成: {0},耗时 {1}ms", result, ms)。
/// 英文语序与中文不同,必须整句做模板,禁止"前缀文本 + 变量"拼接。
///
public static string F(string formatText, params object[] args)
=> string.Format(GlobalLocalizationManager.Instance.Translate(formatText), args);
}
///
/// 日志/通知文本专用入口:刻意不做翻译、不进语言包(key 不随界面翻译维护)。
/// 写日志时用 LogText.Raw("请先选择供料器") 标记意图,扫描器不会收集。
///
public static class LogText
{
public static string Raw(string text) => text;
}
}