共用方式為


使用 LDML 資料描述文化特性

當您的應用程式使用 Save 儲存文化特性 (Culture),結果 CultureAndRegionInfoBuilder 物件的 XML 表示會使用 Locale Data Markup Language (LDML) 1.1 版的格式。 CreateFromLdml 方法是 Save 的反向方法,而且是從這個 XML 檔載入。

大多數描述文化特性的有意義資料都包含在 XML 檔內的 special 項目中。 LDML special 項目允許產品特定的附註和資料。

.NET Framework 使用 special 項目來包含從 msLocale 結構描述 (https://schemas.microsoft.com/globalization/2005/carib/ldml) 所取出的資料。 就像一般的結構描述,這個 URI 為結構描述提供了唯一名稱,卻並非實際文件的 URL。

大多數的相關 XML 項目都會對應到描述文化特性之類別 (例如,CultureAndRegionInfoBuilderCultureInfo) 的屬性或方法的傳回值。 有少數項目為 Windows 的特定項目,而非 .NET Framework 的特定項目,因此沒有包含成為 CultureAndRegionInfoBuilder 的屬性。

如需 LDML 標準的詳細資料,請參閱位於 Unicode 主站台 (英文) 的 Unicode 技術標準 #35,<Locale Data Markup Language (LDML)>。

Windows 專用的項目

本主題有幾個項目屬於「Windows 專用」。 它們僅與 Unmanaged Windows 程式碼有關,而與 .NET Framework 無關。 如果您的應用程式在 .NET Framework 外部建立 LDML 檔案,然後使用 Framework 為其註冊,這個檔案就能用於 Windows 和 .NET Framework。 在 .NET Framework 中,如果您的應用程式是從現有的文化特性定義開頭,接著修改該定義,並將其儲存為自訂文化特性,這些 Windows 專用項目就會完整地從原始的文化特性傳遞到儲存的文化特性。

Identity 項目

下表說明 identity 項目。

項目

備註

version

LDML 1.1,格式為 <version number="1.1">ldml version 1.1</version>

generation

資料檔案產生的時間,例如 <generation date="2006-08-28" />

special

容器,其中所有內容都取自於 msLocale 結構描述

以下是 identity/special 項目。 除非另外指出,所有的值都由 type 屬性 (Attribute) 指定。 例如:

    <identity>
        ...
        <special xmlns:msLocale="https://schemas.microsoft.com/globalization/2005/carib/ldml">
             <!-- A typical case... -->
             <msLocale:cultureAndRegionInfoName type="en-US-fabricam"/>
             ...
             <!-- ...but here are some examples that use CDATA -->
             <msLocale:geoId>244</msLocale:geoId>
             <msLocale:languageIsoName type="twoLetters">
                 en
             </msLocale:languageIsoName> 
             ...
        </special>
    </identity>

下表說明與 identity 項目對應的屬性和方法。

項目

屬性/方法

備註

msLocale:cultureAndRegionInfoName

CultureName

範例:"en"、"en-US"、"en-US-fabricam"

msLocale:cultureAndRegionModifier

IsNeutralCulture

只適用於中性文化特性;type 永遠都會是 "neutral"

msLocale:cultureInfoVersion

N/A

目前為 "1.0"

msLocale:geoId

GeoId

範例:"244";這個值會指定為文字 CDATA,而不是使用 type 屬性指定。

msLocale:parentName

Parent

範例:"en"

msLocale:specificCulture

CreateSpecificCulture

範例:"en-US";僅與中性文化特性相關,這裡它是代表預設的特定文化特性

msLocale:languageNameAbbr

ThreeLetterWindowsLanguageName

範例:"ENU"

msLocale:languageIsoName type="threeLetters"

ThreeLetterISOLanguageName

範例:"eng";這個值會指定為文字 CDATA,而不是使用 type 屬性指定;type 為 "threeLetters"

msLocale:languageIsoName type="twoLetters"

TwoLetterISOLanguageName

範例:"en";這個值會指定為文字 CDATA,而不是使用 type 屬性指定;type 為 "twoLetters"

msLocale:nativeDisplayName

CultureNativeName

範例:"English (United States)"、"Deutsch (Deutschland)"

msLocale:englishName

CultureEnglishName

範例:"English (United States)"、"German (Germany)"

msLocale:countryCode

N/A

Windows 專用;這個值會指定為 CDATA;除了加拿大這個唯一例外情況 (國碼為 2),這個值完全相同於電話的國際通話碼;在 Windows,您可以透過 GetLocaleInfo 或 GetLocaleInfoEx,並將 LCTYPE 指定為 LOCALE_ICOUNTRY,便可存取這個值

msLocale:regionNativeName

RegionNativeName

範例:" United States"、" Deutschland"

msLocale:regionEnglishName

RegionEnglishName

範例:"United States"、"Germany"

msLocale:regionIsoName type="threeLetters"

ThreeLetterISORegionName

範例:"USA";這個值會指定為文字 CDATA,而不是使用 type 屬性指定;type 為 "threeLetters"

msLocale:regionIsoName type="twoLetters"

TwoLetterISORegionName

範例:"US";這個值會指定為文字 CDATA,而不是使用 type 屬性指定;type 為 "twoLetters"

msLocale:textInfoName

TextInfo.CultureName

範例:"en-US"

msLocale:sortName

CompareInfo.Name

範例:"en-US"、"de-DE_phoneb"

msLocale:ietfLanguageTag

IetfLanguageTag

範例:"en-US"

msLocale:englishLanguage

Windows 專用

範例:"English"、"German"

Layout 項目

下表說明 layout 項目。

項目

備註

special

容器,其中所有內容都來自 msLocale 結構描述

下表中的項目是屬於 layout/special 的項目。

項目

屬性/方法

備註

msLocale:direction

IsRightToLeft

文字配置方向,可具有下列值:

  • "left-to-right"

  • "right-to-left"

範例:<msLocale:Direction type="left-to-right" />

Characters 項目

下表說明 characters 項目。

項目

備註

special

容器,其中所有內容都來自 msLocale 結構描述

下表說明 characters/special 項目。 除非另外指出,所有的值都由 type 屬性 (Attribute) 指定。

項目

屬性/方法

備註

msLocale:keyboardLayout

KeyboardLayoutId

其值會以 CDATA 方式處理

msLocale:consoleFallbackName

ConsoleFallbackUICulture

範例:"en-US"

msLocale:fontSignature

N/A

容器,其中存放來自 msLocale 結構描述的進一步內容

mslocale:scripts

N/A

容器,其中存放來自 msLocale 結構描述的進一步內容

下列是屬於 characters/special/msLocale:fontSignature 的項目:

  • msLocale:unicodeRanges

  • msLocale:defaultCodePages

  • msLocale:codePages

嚴格說來,上述的每一個項目都是容器,其中存放取自於 msLocale 結構描述的進一步內容。

下表中的項目是屬於 characters/special/msLocale:fontSignature/msLocale:unicodeRanges 的項目。 所有值都是由 type 屬性所指定。 這是 Windows 專用的資訊,而且部分對應到 Windows LOCALESIGNATURE 結構。

項目

屬性/方法

備註

msLocale:range

N/A

Windows 專用;介於 0 與 122 之間的值,表示 Unicode 子集位元欄位 (USB) 中的位元數字,其包含在 Windows FONTSIGNATURE 結構中;這個項目可出現多次

msLocale:layoutProgress

N/A

Windows 專用;可能的值為:

  • "horizontalRightToLeft"

  • "verticalBeforeHorizontal"

  • "verticalBottomToTop"

下列是屬於 characters/special/msLocale:fontSignature/msLocale:defaultCodePages 和 characters/special/msLocale:fontSignature/msLocale:codePages 的項目:

  • msLocale:ansiCodePage

  • msLocale:ansiOemCodePage

  • msLocale:oemCodePage

嚴格說來,上述的每一個項目都是 msLocale:codePage 項目的容器,其值會以 type 屬性指定。

項目

備註

msLocale:codePage

字碼頁;必須適合包含該字碼頁的項目;例如字碼頁 "1252" 是 Windows ANSI 字碼頁,屬於 msLocale:ansiCodePage;字碼頁 "932" 是 ANSI/OEM 字碼頁,屬於 msLocale:ansiOemCodePage;字碼頁 "855" 是 OEM 字碼頁,屬於 msLocale:oemCodePage

characters/special/msLocale:fontSignature/msLocale:defaultCodePages 應該包含下列其中一項:

  • 包含單一 msLocale:codePage 項目的單一 msLocale:ansiOemCodePage 項目

  • 包含單一 msLocale:codePage 項目的單一 msLocale:ansiCodePage 項目,以及包含單一 msLocale:codePage 項目的單一 msLocale:oemCodePage 項目

msLocale:defaultCodePages 資料是 Windows 專用資料。 characters/special/msLocale:fontSignature/msLocale:codePages 資料也是 Windows 專用資訊。 其中會列出可支援所指定語言和指令碼的所有字碼頁。 因此,此清單可能包含具有相同類型的多個字碼頁。 例如:

<msLocale:codePages>
    <msLocale:ansiCodePage>
        ...
    </msLocale:ansiCodePage>
    <msLocale:oemCodePage>
        <msLocale:codePage type="864" />
        <msLocale:codePage type="708" />
    </msLocale:oemCodePage>
</msLocale:codePages>

下表中的項目是屬於 characters/special/msLocale:fontSignature/msLocale:scripts 的項目。 所有值都是由 type 屬性所指定。 這是 Windows 專用資訊。 在 Windows 中並沒有任何方法能夠設定這項資料,不過它會對應到 Windows GetStringScripts 函式的傳回值。

項目

屬性/方法

備註

msLocale:script

N/A

Windows 專用;以四個字母的 IS0 15924 代碼表示指令碼,例如 "Latn" (拉丁) 或 "Cyrl" (斯拉夫);這個項目可以出現任意次數

Measurement 項目

下表定義屬於 measurement 的項目。

項目

屬性/方法

備註

measurementSystem

IsMetric

type 屬性不是 "metric" 就是 "US"

paperSize

N/A

Windows 專用;這個項目是 height 和 width 項目的容器;可能的值為:

  • width = "216", height = "279" (Letter)

  • width = "216", height = "356" (Legal)

  • width = "297", height = "420" (A3)

  • width = "210", height = "297" (A4)

Dates 項目

屬於 dates 的唯一項目是 calendars 項目。 這只能當做容器項目。

注意事項注意事項

.NET Framework 會使用 POSIX 規則從標準 LDML 項目 (也就是從 LDML 命名空間取出,而不是取自 msLocale 結構描述的項目) 解譯日期與時間格式。例如,AM/PM 指示器是 "a"。msLocale 結構描述中的項目在日期與時間格式方面會遵循 Microsoft 規則。例如,AM/PM 指示項會使用 "tt" 格式模式指定。

下表說明屬於 dates/calendars 的項目。 所有值都是由 type 屬性所指定。

項目

屬性/方法

備註

default

AvailableCalendars

預設日曆;type 屬性不是 "metric" 就是 "US";在 Microsoft 產生的檔案中,預設日曆永遠與 AvailableCalendars[0] 相符

可能的日曆值為:

  • "Gregorian"

  • "Gregorian-US"

  • "Japanese"

  • "Taiwan"

  • "Korean"

  • "Hijri"

  • "Thai"

  • "Hebrew"

  • "Gregorian-ME-French"

  • "Gregorian-Arabic"

  • "Gregorian-XLIT-English"

  • "Gregorian-XLIT-French"

calendar

AvailableCalendars

可用日曆的指示器;這個項目可以重複出現,不過只能在每個可用的行事曆出現一次;可能的 type 屬性值與 default 相同;這個項目也可做為容器,存放提供日曆相關資料的項目

注意:對於非預設的行事曆,這個項目通常是空的。 因此,在 "Gregorian" 和 "Gregorian-US" 都可提供使用的情況下,"Gregorian" 會是預設值,而 "Gregorian-US" 項目便會是 <calendar type=" Gregorian-US" />。

下表中的項目是屬於 dates/calendars/calendar 的項目。 所有值都是由 type 屬性所指定。

項目

屬性/方法

備註

months

N/A

容器

days

N/A

容器

week

N/A

容器

am

AMDesignator

CDATA 會指定用來標記 (Label) 中午之前時間的文字,例如 "AM"

pm

PMDesignator

CDATA 會指定用來標記 (Label) 中午之後時間的文字,例如 "PM"

dateformat

N/A

容器

timeformat

N/A

容器

eras

N/A

容器

dates/calendars/calendar/months 包含了單一個 monthContext 項目,此項目的 type 屬性必須為 "format"。 dates/calendars/calendar/months/monthContext 應包含四個 monthWidth 項目。

項目

屬性/方法

備註

monthWidth type="wide"

MonthNames

容器

monthWidth type="abbreviated"

AbbreviatedMonthNames

容器

monthWidth type="genitive"

MonthGenitiveNames

容器

monthWidth type="genitiveAbbreviated"

AbbreviatedMonthGenitiveNames

容器

dates/calendars/calendar/months/monthContext/monthWidth 應包含一年中每個月份的 month 項目。 項目應有 12 或 13 個,會視日曆而定。 對於每個 months 項目而言,type 是月份的數字,而 CDATA 型別則表示相關的字串。 例如:

...
<calendar type="Gregorian">
   <months>
      <monthContext type="format">
          <monthWidth type="wide">            
              <month type="1">January</month>
              <month type="2">February</month>
              <month type="3">March</month>
              ...
          </monthWidth>
          <monthWidth type="abbreviated">
              <month type="1">Jan</month>
              <month type="2">Feb</month>
              <month type="3">Mar</month>
              ...
          </monthWidth>
          ...
      </monthContext>
   </months>
</calendar>

dates/calendars/calendar/days 包含了單一個 dayContext 項目,此項目的 type 屬性必須為 "format"。 dates/calendars/calendar/days/dayContext 應包含三個 dayWidth 項目。

項目

屬性/方法

備註

dayWidth type="wide"

DayNames

容器

dayWidth type="abbreviated"

AbbreviatedDayNames

容器

dayWidth type="shorter"

ShortestDayNames

容器

dates/calendars/calendar/days/dayContext/dayWidth 應包含一星期中每天的 day 項目。 對於每個 day 項目而言,type 會是下列其中一個值,"sun"、"mon"、"tue"、"wed"、"thu"、"fri"、"sat"。 CDATA 型別表示相關的字串。 例如:

...
<calendar type="Gregorian">
   <days>
      <dayContext type="format">
          <dayWidth type="wide">
              <day type="sun">Sunday</month>
              <day type="mon">Monday</month>
              <day type="tue">Tuesday</month>
              ...
          </dayWidth>
          ...
      </dayContext>
   </days>
</calendar>

下表中的項目是屬於 dates/calendars/calendar/week 的項目。

項目

屬性/方法

備註

firstDay

FirstDayOfWeek

屬性 day 必須是下列其中一個值:"sun"、"mon"、"tue"、"wed"、"thu"、"fri"、"sat"

special

N/A

容器,其中所有內容都來自 msLocale 結構描述

下表中的項目是屬於 dates/calendars/calendar/week/special 的項目。

項目

屬性/方法

備註

msLocale:weekRule

CalendarWeekRule

type 屬性必須是下列其中一個:

  • firstDay

  • firstFourDayWeek

  • firstFullWeek

下表中的項目是屬於 dates/calendars/calendar/dateformats 的項目。

項目

備註

special

容器,其中所有內容都來自 msLocale 結構描述

下表中的項目是屬於 dates/calendars/calendar/dateformats/special 的項目。 所有值都是由 type 屬性所指定。

項目

屬性/方法

備註

msLocale:dateFormatLength type="long"

GetAllDateTimePatterns('D')

容器

msLocale:dateFormatLength type="short"

GetAllDateTimePatterns('d')

容器

msLocale:yearMonth

GetAllDateTimePatterns('Y')

每個相關 DateTime 模式的容器;type 屬性會指定以零起始的索引;應該沒有任何間距

msLocale:monthDay

MonthDayPattern

容器

下表中的項目是屬於 dates/calendars/calendar/dateformats/special/msLocale:dateFormatLength 的項目。 所有值都是由 type 屬性所指定。

項目

屬性/方法

備註

msLocale:default

N/A

這個值對應於預設格式的 type 屬性;在 Microsoft 產生的 LDML 檔案中,預設值永遠是 "0"

msLocale:dateFormat

GetAllDateTimePatterns ('D')、GetAllDateTimePatterns ('d')

每個相關 DateTime 格式模式的容器;type 屬性會指定以零起始的索引;應該沒有任何間距

下列項目是 msLocale:pattern 項目的容器,這些項目會以 CDATA 型別指定值:

  • dates/calendars/calendar/dateformats/special/msLocale:dateFormatLength /msLocale:dateformat

  • dates/calendars/calendar/dateformats/special/msLocale:yearMonth

  • dates/calendars/calendar/dateformats/special/msLocale:monthDay

例如:

<dateFormats>
    <special xmlns:msLocale="https://schemas.microsoft.com/globalization/2005/carib/ldml">
        <msLocale:dateFormatLength type="long">
            <msLocale:default type="0"/>
            <msLocale:dateFormat type="0">
                <msLocale:pattern>dddd, MMMM dd, yyyy</pattern>
            </msLocale:dateFormat>
                       
            <msLocale:dateFormat type="1">
                <msLocale:pattern>MMMM dd, yyyy</pattern>
            </msLocale:dateFormat>
            ...
        </msLocale:dateFormatLength>
        ...
        <msLocale:yearMonth type="0">
            <msLocale:pattern>MMMM, yyyy</msLocale:pattern>
        </msLocale:yearMonth>

        <msLocale:yearMonth type="1">
            <msLocale:pattern>mm, yy</msLocale:pattern>
        </msLocale:yearMonth>

        <msLocale:monthDay>
            <msLocale:pattern>MMMM dd</msLocale:pattern>
        </msLocale:monthDay>
    </special>
</dateFormats>

下表中的項目是屬於 dates/calendars/calendar/timeformats 的項目。

項目

備註

special

容器,其中所有內容都來自 msLocale 結構描述

下表中的項目是屬於 dates/calendars/calendar/timeformats/special 的項目。 所有值都是由 type 屬性所指定。

項目

屬性/方法

備註

msLocale:durationFormats

N/A

Windows 專用;容器

msLocale:timeFormatLength type="long"

GetAllDateTimePatterns('T')

容器

msLocale:timeFormatLength type="short"

GetAllDateTimePatterns('t')

容器

下表中的項目是屬於 dates/calendars/calendar/dateformats/special/msLocale:durationFormats 的項目。 所有值都是由 type 屬性所指定。

項目

屬性/方法

備註

msLocale:default

N/A

Windows 專用;這個值對應於預設格式的 type 屬性;在 Microsoft 產生的檔案中,預設值永遠是 "0"

msLocale:durationFormat

N/A

Windows 專用。 每個相關 DateTime 值的容器;type 屬性會指定以零起始的索引;應該沒有任何間距

下表中的項目是屬於 dates/calendars/calendar/dateformats/special/msLocale:timeFormatLength 的項目。 所有值都是由 type 屬性所指定。

項目

屬性/方法

備註

msLocale:default

N/A

這個值對應於預設格式的 type 屬性;在 Microsoft 產生的檔案中,預設值永遠是 "0"

msLocale:timeFormat

GetAllDateTimePatterns ('T')、GetAllDateTimePatterns ('t')

每個相關 DateTime 值的容器;type 屬性會指定以零起始的索引;應該沒有任何間距

下列項目是 msLocale:pattern 項目的容器,這些項目會以 CDATA 型別指定值:

  • dates/calendars/calendar/dateformats/special/msLocale:durationFormats/msLocale:durationFormat

  • dates/calendars/calendar/dateformats/special/msLocale:timeFormatLength/msLocale:timeformat

例如:

<timeFormats>
    <special xmlns:msLocale="https://schemas.microsoft.com/globalization/2005/carib/ldml">
        <msLocale:durationFormats>
            <msLocale:default type="0" />
            <msLocale:durationFormat type="0">
                <msLocale:pattern>HH:mm:ss</msLocale:pattern>
            </msLocale:durationFormat>
        </msLocale:durationFormats>

        <msLocale:timeFormatLength type="long">
            <msLocale:default type="0"/>
            <msLocale:timeFormat type="0">
                <msLocale:pattern>h:mm:ss tt</msLocale:pattern>
            </msLocale:timeFormat>
            <msLocale:timeFormat type="1">
                <msLocale:pattern>h:mm:ss a</msLocale:pattern>
            </timeFormat>
            ...
        </timeFormatLength>
        ...
    </special>
</timeFormats>

下表中的項目位於 dates/calendars/calendar/eras 下。

項目

屬性/方法

備註

eraAbbr

GetEraName

容器

eraNames

GetAbbreviatedEraName

容器

在 dates/calendars/calendar/eras/eraAbbr 和 dates/calendars/calendar/eras/eraNames 下,每個紀元都應包含一個紀元項目。 對於每個紀元項目而言,型別是紀元的數字,而 CDATA 型別則表示相關的字串。 例如:

<eras>
   <eraAbbr>
      <era type="0">BC</era>
      <era type="1">AD</era>
   </eraAbbr>
   <eraNames>
      <era type="0">Before Christ</era>
      <era type="1">Anno Domini</era>
   </eraNames>
</eras>

Numbers 項目

下表定義屬於 numbers 的項目。

項目

備註

symbols

容器

currencies

容器

special

容器,其中所有內容都來自 msLocale 結構描述

屬於 numbers/symbols 的項目

下表中的項目是屬於 numbers/symbols 的項目。 除了註明的項目以外,這些項目都會將其資料指定為 CDATA 型別。

項目

屬性/方法

備註

decimal

NumberDecimalSeparator

範例:"."

group

NumberGroupSeparator

範例:","

list

TextInfo.ListSeparator

範例:";"

percentSign

PercentSymbol

範例:"%"

infinity type="positive"

PositiveInfinitySymbol,

範例:"Infinity"

infinity type="negative"

NegativeInfinitySymbol

範例:"-Infinity"

nan

NaNSymbol

「非數字」符號。 範例:"NaN"。

special

N/A

容器,其中所有內容都來自 msLocale 結構描述

下表中的項目是屬於 numbers/symbols/special 的項目。 除了註明的項目以外,這些項目都會將其資料指定為 CDATA 型別。

項目

屬性/方法

備註

msLocale:currencyDecimalSeparator

CurrencyDecimalSeparator

範例:"."

msLocale:currencyGroupSeparator

CurrencyGroupSeparator

範例:","

msLocale:leadingZero

N/A

Windows 專用;非 CDATA;type 屬性必須是 "yes" 或 "no",才能允許或不允許前置字元為零

例如:

<symbols>
    <decimal>.</decimal>
    <group>,</group>
    ...
    <infinity type="positive">Infinity</infinity>
    <infinity type="negative">-Infinity</infinity>
    ...
    <special xmlns:msLocale="https://schemas.microsoft.com/globalization/2005/carib/ldml">
        <msLocale:currencyDecimalSeparator>
            .
        </msLocale:currencyDecimalSeparator>
        <msLocale:currencyGroupSeparator>
            ,
        </msLocale:currencyGroupSeparator>
        <msLocale:leadingZero type="yes" />
    </special>
</symbols>

屬於 numbers/currencies 的項目

下表中的項目是屬於 numbers/currencies 的項目。

項目

備註

currency

容器;type 屬性必須指定為 "default"

下表中的項目是屬於 numbers/currencies/currency 的項目。 除了註明的項目以外,這些項目都會將其資料指定為 CDATA 型別。

項目

屬性/方法

備註

symbol

ISOCurrencySymbol

範例:"$"

displayName

CurrencyNativeName

範例:"Dollar"

special

N/A

容器,其中所有內容都來自 msLocale 結構描述

下表中的項目是屬於 numbers/currencies/currency/special 的項目。 除了註明的項目以外,這些項目都會將其資料指定為 CDATA 型別。

項目

屬性/方法

備註

msLocale:isoCurrency

ISOCurrencySymbol

範例:"USD"

msLocale:currencyEnglishName

CurrencyEnglishName

範例:"Dollar"

例如:

<currencies>
    <currency type="default">
        <symbol>$</symbol>
        <displayName>Dollar</displayName>
        <special xmlns:msLocale="https://schemas.microsoft.com/globalization/2005/carib/ldml">
                <msLocale:isoCurrency>USD</msLocale:isoCurrency>
                <msLocale:currencyEnglishName>
                    Dollar
                </msLocale:currencyEnglishName>
    </special>
</currency>

下表中的項目是屬於 numbers/currencies/special 的項目。 除非另外指出,所有的值都由 type 屬性指定。

項目

屬性/方法

備註

msLocale:decimalDigits

NumberDecimalDigits

要在數值中使用的小數位數;指定為 CDATA;範例:"2"

msLocale:negativePattern

NumberNegativePattern

負數值的格式模式

msLocale:currencyDecimalDigits

CurrencyDecimalDigits

要在貨幣值中使用的小數位數;與 msLocale:decimalDigits 相反,這個值是在 type 屬性中指定。範例:"2"

msLocale:currencyPositivePattern

CurrencyPositivePattern

正數貨幣值的格式模式

msLocale:currencyNagativePattern

CurrencyNegativePattern

負數貨幣值的格式模式

msLocale:percentPositivePattern

PercentPositivePattern

正數百分比值的格式模式

msLocale:percentNagativePattern

PercentNegativePattern

負數百分比值的格式模式

msLocale:groupSizes

NumberGroupSizes

數值內小數點左邊數字的各個群組中的位數;實際群組大小會指定為 CDATA 型別;使用 type 屬性來序列化此項目;這些項目的數量沒有限制,每個都有唯一的 type 屬性,從 "0" 開始序列化;值會從最小顯著性的數字群組開始

msLocale:nativeDigits

NativeDigits

當地慣用的數字相當於西方數字 0 到 9,一個對應一個;type 屬性是 "0" 到 "9" 的數字;CDATA 型別會指定用來表示數字的字元

msLocale:digitSubstitution

DigitSubstitution

這個值指定圖形使用者介面顯示數字圖案的方式;type 屬性的有效設定為:

  • "context" (預設值)

  • "none" (永遠都會使用 "0"-"9")

  • "nativeNational" (永遠替代)

例如:

<numbers>
    ...
    <special xmlns:msLocale="https://schemas.microsoft.com/globalization/2005/carib/ldml">
        <msLocale:decimalDigits>2</msLocale:decimalDigits>     
        <msLocale:negativePattern type="1"/>
        <msLocale:currencyDecimalDigits type="2"/>
        <msLocale:currencyPositivePattern type="0"/>
        <msLocale:currencyNegativePattern type="0"/>
        <msLocale:percentNegativePattern type="0"/>
        <msLocale:percentPositivePattern type="0"/>
        <msLocale:groupSizes type="0">3</msLocale:groupSizes>
        <msLocale:currencyGroupSizes type="0">
            3
        </msLocale:currencyGroupSizes>
        <msLocale:nativeDigits type="0">0</msLocale:nativeDigits>
        <msLocale:nativeDigits type="1">1</msLocale:nativeDigits>
        ...
        <msLocale:nativeDigits type="9">9</msLocale:nativeDigits>
        <msLocale:digitSubstitution type="context"/>
    </special>
</numbers>

請參閱

參考

CultureAndRegionInfoBuilder