語言

Localization 類別

定義

該 Localization 類別定義了附加屬性,用於本地化屬性與註解。

public ref class Localization abstract sealed
public static class Localization
type Localization = class
Public Class Localization
繼承
Localization

範例

以下程式碼範例展示了為文字區塊定義的在地化屬性與註解。

<!-- Define localization attributes and comments for the text block.
    - The content is visible to the localizer and can be changed.
    - The font size property is visible to the localizer and can be changed.
    - The comment specifies that the trademark font size should be used. -->
<TextBlock
  FontSize="14"
  Localization.Attributes=
    "$Content(Text Readable Modifiable) FontSize(Font Readable Modifiable)"
  Localization.Comments=
    "$Content(Trademark) FontSize(Trademark font size)" >
  your company name here
</TextBlock>

備註

標記作者可能對可擴充應用標記語言(XAML)UI中的元素有特定要求,例如文字長度、字型族或字型大小的限制。 本地化人員需要了解這些資訊,才能提供一致的本地化。 可在可擴充應用程式標記語言(XAML)中指定本地化屬性,讓作者能向本地化工具溝通他們的在地化需求。 這些屬性提供本地化的規則與提示,可用來修改應用程式。 局部化屬性有兩種類型:

  • 本地化屬性。 屬性指定哪些資源(如 FontFamily)要被本地化。

  • 本地化評論。 註解是標記作者附上的自由形式文字。

欲了解更多如何使用這些在地化屬性的資訊,請參閱 「在地化屬性與註解」。

欄位

名稱 Description
AttributesProperty

Attributes識別所附財產。

CommentsProperty

Comments識別所附財產。

附加屬性

名稱 Description
Attributes

該 Localization 類別定義了附加屬性,用於本地化屬性與註解。

Comments

該 Localization 類別定義了附加屬性,用於本地化屬性與註解。

方法

名稱 Description
GetAttributes(Object)

從指定元素取得附加屬性的 AttributesProperty 值。

GetComments(Object)

從指定元素取得附加屬性的 CommentsProperty 值。

SetAttributes(Object, String)

設定 AttributesProperty 指定元素的附加屬性。

SetComments(Object, String)

將附加屬性設定 CommentsProperty 為指定元素。

適用於