Class OdfLocalizer
- Namespace
- OdfKit.Compliance
- Assembly
- OdfKit.dll
Provides the OdfLocalizer API. 提供 OdfLocalizer API。
public static class OdfLocalizer
- Inheritance
-
OdfLocalizer
- Inherited Members
Properties
DefaultCulture
Gets or sets the global default culture. When set, it overrides the thread's default culture. 取得或設定全域預設的文化特性。若設定,將覆蓋執行緒預設語系。
public static CultureInfo? DefaultCulture { get; set; }
Property Value
Methods
GetMessage(string)
Gets the localized error/warning message for the specified key (using the environment culture). 取得指定鍵值的本地化錯誤/警告訊息(使用環境語系)。
public static string GetMessage(string messageKey)
Parameters
messageKeystringThe message key. / 訊息鍵值。
Returns
- string
The localized message for the corresponding culture. / 對應語系的本地化訊息。
GetMessage(string, CultureInfo?)
Gets the localized error/warning message for the specified key and culture. 取得指定鍵值與文化特性的本地化錯誤/警告訊息。
public static string GetMessage(string messageKey, CultureInfo? culture)
Parameters
messageKeystringThe message key. / 訊息鍵值。
cultureCultureInfoThe specified culture; if null, the environment culture is auto-detected. / 指定的文化特性;若為 null 則自動偵測環境語系。
Returns
- string
The localized message for the corresponding culture. / 對應語系的本地化訊息。
GetMessage(string, CultureInfo?, params object?[])
Gets the localized error/warning message for the specified key and culture, formatted with the specified arguments. 取得指定鍵值與文化特性的本地化錯誤/警告訊息,並使用指定參數進行格式化。
public static string GetMessage(string messageKey, CultureInfo? culture, params object?[] args)
Parameters
messageKeystringThe message key. / 訊息鍵值。
cultureCultureInfoThe specified culture; if null, the environment culture is auto-detected. / 指定的文化特性;若為 null 則自動偵測環境語系。
argsobject[]The format arguments. / 格式化參數。
Returns
- string
The formatted localized message. / 格式化後的本地化訊息。
GetMessage(string, params object?[])
Gets the localized error/warning message for the specified key, formatted with the specified arguments (using the environment culture). 取得指定鍵值的本地化錯誤/警告訊息,並使用指定參數進行格式化(使用環境語系)。
public static string GetMessage(string messageKey, params object?[] args)
Parameters
Returns
- string
The formatted localized message. / 格式化後的本地化訊息。
GetSuggestedFix(string)
Short overload of GetSuggestedFix that accepts ruleId; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 ruleId;其餘可選參數使用預設值並轉呼叫最長 GetSuggestedFix 多載。
public static string GetSuggestedFix(string ruleId)
Parameters
ruleIdstring
Returns
GetSuggestedFix(string, CultureInfo?)
Gets the suggested fix guidance for the specified rule identifier and culture. 取得指定規則識別碼與文化特性的建議修復指引。
public static string GetSuggestedFix(string ruleId, CultureInfo? culture)
Parameters
ruleIdstringThe unique identifier of the compliance rule. / 合規性規則的唯一識別碼。
cultureCultureInfoThe specified culture; if null, the environment culture is auto-detected. / 指定的文化特性;若為 null 則自動偵測環境語系。
Returns
- string
The suggested fix guidance string for the corresponding culture. / 對應語系的建議修復指引字串。