using Godot;
namespace ColdMint.scripts.utils;
///
/// Translation server utils
/// 翻译服务器工具
///
public static class TranslationServerUtils
{
///
/// Gets a translation of a field and displays it formatted
/// 获取某个字段的翻译,并且将其格式化显示
///
///
///
///
public static string? TranslateWithFormat(string key, params object[] args)
{
var value = TranslationServer.Translate(key);
return value == null ? null : string.Format(value, args);
}
///
/// Gets a translation of a field
/// 获取某个字段的翻译
///
///
///
public static string? Translate(string? key)
{
return TranslationServer.Translate(key);
}
}