| 1 |
<!-- |
| 2 |
* This file is part of the LibreOffice project. |
| 3 |
* |
| 4 |
* This Source Code Form is subject to the terms of the Mozilla Public |
| 5 |
* License, v. 2.0. If a copy of the MPL was not distributed with this |
| 6 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 7 |
* |
| 8 |
* This file incorporates work covered by the following license notice: |
| 9 |
* |
| 10 |
* Licensed to the Apache Software Foundation (ASF) under one or more |
| 11 |
* contributor license agreements. See the NOTICE file distributed |
| 12 |
* with this work for additional information regarding copyright |
| 13 |
* ownership. The ASF licenses this file to you under the Apache |
| 14 |
* License, Version 2.0 (the "License"); you may not use this file |
| 15 |
* except in compliance with the License. You may obtain a copy of |
| 16 |
* the License at http://www.apache.org/licenses/LICENSE-2.0 . |
| 17 |
--> |
| 18 |
|
| 19 |
<!-- ............................................................... --> |
| 20 |
<!-- Locale data specification DTD ................................. --> |
| 21 |
<!-- ............................................................... --> |
| 22 |
|
| 23 |
<!-- |
| 24 |
=========================================================================== |
| 25 |
ATTENTION! PLEASE! HEADS UP! IMPORTANT! |
| 26 |
=========================================================================== |
| 27 |
|
| 28 |
Please validate your locale data contribution. |
| 29 |
|
| 30 |
A quick validation check can be done if you have xmllint installed and the |
| 31 |
current locale.dtd file at hand, you can download the locale.dtd file from |
| 32 |
https://cgit.freedesktop.org/libreoffice/core/plain/i18npool/source/localedata/data/locale.dtd |
| 33 |
|
| 34 |
xmllint -dtdvalid locale.dtd -noout your_data.xml |
| 35 |
|
| 36 |
(Note that instead of one - hyphen minus two consecutive hyphen minus |
| 37 |
characters should be given to start an option, but a double hyphen in a XML |
| 38 |
comment technically ends a comment (though parsers look for a matching |
| 39 |
closing one with > as well) and let xmllint complain already about the .dtd |
| 40 |
itself. Some versions of xmllint also accept a single hyphen minus). |
| 41 |
|
| 42 |
|
| 43 |
Second, using a validating parser. A validating parser, for example, may be found at |
| 44 |
http://unicode.org/cldr/data/tools/java/org/unicode/cldr/util/XMLValidator.java |
| 45 |
Compile it into a class-jar and call it in the |
| 46 |
i18npool/source/localedata/data/ directory: |
| 47 |
java -cp <your_path>/XMLValidator.jar org.unicode.cldr.util.XMLValidator your_data.xml |
| 48 |
|
| 49 |
|
| 50 |
A third possibility is: |
| 51 |
|
| 52 |
- temporarily (!) change the DOCTYPE of your file to read (all on one line) |
| 53 |
<!DOCTYPE Locale SYSTEM "https://cgit.freedesktop.org/libreoffice/core/plain/i18npool/source/localedata/data/locale.dtd"> |
| 54 |
|
| 55 |
- upload it to the form available at http://www.validome.org/xml/ |
| 56 |
|
| 57 |
This will validate the file against the HEAD revision of locale.dtd |
| 58 |
|
| 59 |
|
| 60 |
Please test locale data files either in an enable-dbgutil build, which |
| 61 |
implements some checks and pops up assertion message boxes if the tests |
| 62 |
fail, or by setting the environment variable OOO_ENABLE_LOCALE_DATA_CHECKS |
| 63 |
to 'Y' or 'Yes' (or any other string starting with 'Y') or '1' before |
| 64 |
starting the application, which outputs the same messages to stderr and |
| 65 |
also works in a product build. |
| 66 |
|
| 67 |
Then follow this procedure: |
| 68 |
1. Create a new spreadsheet document. |
| 69 |
2. On a cell use context menu -> Format Cells -> Numbers. |
| 70 |
3. Select the locale in the Language list box => MUST be assertion free. |
| 71 |
3.a. Assertions are only shown at the very first time a number formatter |
| 72 |
is created, respectively the first time a specific locale data is |
| 73 |
used. To repeat steps 1.-3. you'd need to create another spreadsheet |
| 74 |
document. |
| 75 |
|
| 76 |
=========================================================================== |
| 77 |
NOTE the FormatElement comments further down. |
| 78 |
=========================================================================== |
| 79 |
|
| 80 |
--> |
| 81 |
|
| 82 |
<!-- ............................................................... --> |
| 83 |
<!-- Entities for characters and symbols ........................... --> |
| 84 |
|
| 85 |
<!ENTITY % UNOModule |
| 86 |
'unoid CDATA #IMPLIED'> |
| 87 |
|
| 88 |
<!ENTITY % MessageID |
| 89 |
'msgid CDATA #REQUIRED'> |
| 90 |
|
| 91 |
<!ENTITY % RefLocale |
| 92 |
'ref CDATA #IMPLIED'> |
| 93 |
<!-- Where given, an element can be inherited from another locale, e.g. |
| 94 |
ref="en_US" --> |
| 95 |
|
| 96 |
<!ENTITY % LIBModule |
| 97 |
'module CDATA #IMPLIED'> |
| 98 |
<!-- The locale referred to for the sub categories, implementation detail. --> |
| 99 |
|
| 100 |
<!ENTITY % replaceFrom 'replaceFrom CDATA #IMPLIED'> |
| 101 |
<!ENTITY % replaceTo 'replaceTo CDATA #IMPLIED'> |
| 102 |
<!-- See below for the LC_FORMAT element. --> |
| 103 |
|
| 104 |
<!ELEMENT DefaultName (#PCDATA)> |
| 105 |
|
| 106 |
<!-- Locale is made of different sub categories --> |
| 107 |
<!ELEMENT Locale (LC_INFO, LC_CTYPE, LC_FORMAT, LC_FORMAT_1?, LC_COLLATION, LC_SEARCH, LC_INDEX, LC_CALENDAR, LC_CURRENCY, LC_TRANSLITERATION, LC_MISC, LC_NumberingLevel, LC_OutLineNumberingLevel)> |
| 108 |
<!ATTLIST Locale versionDTD CDATA #FIXED "2.0.3"> |
| 109 |
<!-- Version identifier to prevent mismatching data files being submitted |
| 110 |
because of older files being copied as templates. The version should be |
| 111 |
less than or equal to the LibreOffice release, or the LibreOffice release |
| 112 |
number plus some extension, like "2.0.enhanced", to be able to easily |
| 113 |
determine the corresponding LibreOffice version. New versions of the DTD |
| 114 |
with new required elements SHOULD REALLY result in a new versionDTD here |
| 115 |
and LOCALE_VERSION_DTD in ../LocaleNode.cxx, and *.xml files MUST be |
| 116 |
adapted then, otherwise building the data or checking it with a validating |
| 117 |
parser will throw an error. |
| 118 |
--> |
| 119 |
<!ATTLIST Locale allowUpdateFromCLDR (yes|no) #REQUIRED> |
| 120 |
<!-- Whether some data elements may be (automatically) updated from the Common |
| 121 |
Locale Data Repository, see http://cldr.unicode.org/ |
| 122 |
Note: This mechanism currently (2010-02-21) is outdated. |
| 123 |
--> |
| 124 |
<!ATTLIST Locale version CDATA #REQUIRED> |
| 125 |
<!-- Valid number, may designate versioned data --> |
| 126 |
|
| 127 |
|
| 128 |
<!ELEMENT LC_INFO (Language, Country, Platform?, Variant?)> |
| 129 |
|
| 130 |
<!ELEMENT Language (LangID, DefaultName) > |
| 131 |
<!ELEMENT LangID (#PCDATA) > |
| 132 |
<!-- LangID must be a valid two or three letter language identifier defined by |
| 133 |
ISO 639. Use ISO 639-1 two letter code where available, else ISO 639-2 or |
| 134 |
639-3 three letter code. |
| 135 |
|
| 136 |
If the Variant element designates a BCP 47 language tag (because the |
| 137 |
locale is not expressible as a Language,Country pair, for example contains |
| 138 |
a script tag) then the LangID value MUST be the code 'qlt' (reserved by |
| 139 |
ISO 639-3 for private use) to tell the language tag processor that the |
| 140 |
actual language tag is in the Variant element. |
| 141 |
--> |
| 142 |
|
| 143 |
<!ELEMENT Country (CountryID, DefaultName) > |
| 144 |
<!ELEMENT CountryID (#PCDATA) > |
| 145 |
<!-- CountryID must be a valid two letter country identifier defined by ISO 3166. --> |
| 146 |
|
| 147 |
<!ELEMENT Platform (PlatformID) > |
| 148 |
<!ELEMENT PlatformID (#PCDATA) > |
| 149 |
<!-- Unused, deprecated, can be generic|unix|win32|macos, best Platform element |
| 150 |
be absent. |
| 151 |
--> |
| 152 |
|
| 153 |
<!ELEMENT Variant (#PCDATA) > |
| 154 |
<!-- If the LangID element contains the value 'qlt' then the Variant element |
| 155 |
MUST contain the valid BCP 47 language tag of the locale. If LangID is |
| 156 |
another ISO 639 code than 'qlt' then the Variant element must be empty or |
| 157 |
not present. |
| 158 |
--> |
| 159 |
|
| 160 |
|
| 161 |
<!-- The LC_FORMAT element contains number format codes and may actually appear |
| 162 |
twice (with the second occurrence named LC_FORMAT_1). One section is |
| 163 |
mandatory and MUST contain at least all required format codes |
| 164 |
formatindex="0" to formatindex="47" (except 10 and 11 MUST NOT be |
| 165 |
defined), MUST NOT contain formatindex 48 and 49, MUST contain formatindex |
| 166 |
50, and MAY contain other format codes. See below ATTLIST FormatElement |
| 167 |
formatindex. |
| 168 |
|
| 169 |
A second LC_FORMAT_1 section may follow containing other format codes. The |
| 170 |
difference between the two sections is that they are inherited |
| 171 |
independently if a locale uses the RefLocale mechanism (ref="..."). This |
| 172 |
may be used to not offer locale dependent format codes to other locales |
| 173 |
that otherwise inherit the format codes. |
| 174 |
|
| 175 |
--> |
| 176 |
<!ELEMENT LC_FORMAT (DateAcceptancePattern*, FormatElement*) > |
| 177 |
<!-- All FormatElement elements must be given if the RefLocale mechanism is not used! --> |
| 178 |
<!ATTLIST LC_FORMAT %RefLocale;> |
| 179 |
<!ATTLIST LC_FORMAT %replaceFrom;> |
| 180 |
<!-- Define placeholder for currency code, usually "[CURRENCY]" --> |
| 181 |
<!ATTLIST LC_FORMAT %replaceTo;> |
| 182 |
<!-- Currency code to be used to replace the placeholder, e.g. "[$R-1C09]". |
| 183 |
Note: The brackets and the leading $ character are mandatory, the |
| 184 |
hyphen-minus separates the currency symbol from the hexagesimal MS-LCID, |
| 185 |
letters contained in the LCID have to be in upper case, leading zeros are |
| 186 |
to be omitted. LCIDs are defined in include/i18nlangtag/lang.h ( |
| 187 |
https://opengrok.libreoffice.org/xref/core/include/i18nlangtag/lang.h ) |
| 188 |
--> |
| 189 |
|
| 190 |
<!ELEMENT DateAcceptancePattern (#PCDATA)> |
| 191 |
<!-- Pattern that defines an input sequence match to be accepted as |
| 192 |
(abbreviated) date. For example, in en_US locale "M/D" accepts an input of |
| 193 |
11/23 as CurrentYear-November-23 whereas 11/23/ would not be a date. In |
| 194 |
de_DE locale "D.M." accepts an input of 23.11. as CurrentYear-November-23 |
| 195 |
whereas 23.11 would not be a date. |
| 196 |
|
| 197 |
For each locale one pattern that matches a full date is automatically |
| 198 |
generated from FormatElement formatIndex="21" and does not need to be |
| 199 |
defined, for example "M/D/Y" or "D.M.Y". |
| 200 |
|
| 201 |
At least one pattern for abbreviated date input must be defined, i.e. |
| 202 |
contain D and M but not Y. |
| 203 |
|
| 204 |
NOTE: use only single letter D,M,Y. Multiple patterns can be defined. |
| 205 |
--> |
| 206 |
|
| 207 |
<!ELEMENT LC_FORMAT_1 (FormatElement*) > |
| 208 |
<!ATTLIST LC_FORMAT_1 %RefLocale;> |
| 209 |
<!ATTLIST LC_FORMAT_1 %replaceFrom;> |
| 210 |
<!ATTLIST LC_FORMAT_1 %replaceTo;> |
| 211 |
|
| 212 |
<!ELEMENT FormatElement ( FormatCode, DefaultName?)> |
| 213 |
<!ATTLIST FormatElement %MessageID;> |
| 214 |
<!ATTLIST FormatElement default (true|false) #REQUIRED > |
| 215 |
<!ATTLIST FormatElement type (short|medium|long) #REQUIRED > |
| 216 |
<!-- |
| 217 |
There may be up to three groups (type="short", type="medium", type="long") |
| 218 |
for each usage category defined. Each group, if defined, needs exactly one |
| 219 |
default. The type roughly determines the display string length, for example |
| 220 |
short, medium, and long date formats. |
| 221 |
|
| 222 |
The number formatter determines an ultimate default format of a specific |
| 223 |
usage category by looking at the medium, long, and short default formats, |
| 224 |
in that very particular order. |
| 225 |
--> |
| 226 |
<!ATTLIST FormatElement usage (FIXED_NUMBER|FRACTION_NUMBER|PERCENT_NUMBER|SCIENTIFIC_NUMBER|CURRENCY|DATE|TIME|DATE_TIME) #REQUIRED > |
| 227 |
<!ATTLIST FormatElement formatindex CDATA #REQUIRED> |
| 228 |
<!-- |
| 229 |
The following FormatElements must follow specific rules: |
| 230 |
|
| 231 |
All: |
| 232 |
The format indices 0..65 are reserved and, for backwards compatibility, |
| 233 |
indices 0..49 MUST be used as stated in |
| 234 |
offapi/com/sun/star/i18n/NumberFormatIndex.idl ( |
| 235 |
https://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/i18n/NumberFormatIndex.idl ) |
| 236 |
Note that indices 10 ("# ?/?"), 11 ("# ??/??"), 48 (BOOLEAN) and 49 (@ |
| 237 |
Text) are generated internally, as they aren't locale dependent, and |
| 238 |
must not be used in locale data XML files. All other formats have to be |
| 239 |
present. |
| 240 |
|
| 241 |
Note also that "must be used as stated" does not mean that the format |
| 242 |
codes must be identical, of course the meaning of a format code should |
| 243 |
match, for example en_US MM/DD/YY matches de_DE DD.MM.YY |
| 244 |
Just imagine the same index being used with another locale shouldn't |
| 245 |
change the meaning of representation significantly. |
| 246 |
|
| 247 |
You'll notice differences of non-matching format codes only if |
| 248 |
documents use the Default language in number formats and either are |
| 249 |
stored in old SO5 binary file format and loaded on another system where |
| 250 |
languages/locales aren't the same, or if the default locale is switched |
| 251 |
under menu Tools.Options.LanguageSettings.Languages.LocaleSetting |
| 252 |
dialog, which exchanges formats on the fly in the spreadsheet |
| 253 |
application. Please check it out! So far only very few locale data file |
| 254 |
we received got that right, especially not in date formats! |
| 255 |
|
| 256 |
For easier comparison between locales in future please sort the |
| 257 |
FormatElements by their formatindex="..." value within a usage group. |
| 258 |
This isn't necessary to be technically correct and isn't done in many |
| 259 |
locales yet, but will certainly help. |
| 260 |
|
| 261 |
If you want to define yet more formats than the preset and reserved |
| 262 |
0..49 range that's fine, only make sure those formatindex="..." values |
| 263 |
are each >=66 and all values are unique within one locale. |
| 264 |
|
| 265 |
Of usage="FIXED_NUMBER": |
| 266 |
formatindex="0" MUST be the format containing the 'General' keyword. |
| 267 |
The keyword itself may be localized, it is good practice though to |
| 268 |
stick with a wording known from another spreadsheet application for |
| 269 |
better user experience. Like other format codes it may be prepended |
| 270 |
with a [NatNum1] modifier if values are to be displayed using native |
| 271 |
numbering if no specific format was applied. The format must have the |
| 272 |
default="true" and type="medium" attributes. |
| 273 |
|
| 274 |
Of usage="DATE": |
| 275 |
formatindex="21" is used to edit already existing date data. In order |
| 276 |
to always edit the full century the long year YYYY code must be used. |
| 277 |
Furthermore, the format has to be of an editable type, of course, which |
| 278 |
means parseable. Therefore it should only contain DD, MM, YYYY and date |
| 279 |
separators, and the YMD default order is determined from the order |
| 280 |
encountered in this format. |
| 281 |
TODO: Future versions should make use of an edit="true" attribute |
| 282 |
instead of relying on this special index requirement. |
| 283 |
|
| 284 |
formatindex="33" must be ISO 8601 YYYY-MM-DD format code. |
| 285 |
|
| 286 |
Of usage="DATE_TIME": |
| 287 |
formatindex="46" should contain a short year YY code and only HH and MM |
| 288 |
without SS seconds. |
| 289 |
|
| 290 |
formatindex="47" is used to edit already existing combined date/time |
| 291 |
data. The requirements are the same as for formatindex="21" above, plus |
| 292 |
HH and MM and SS codes. |
| 293 |
|
| 294 |
formatindex="50" must contain a long year YYYY code and only HH and MM |
| 295 |
without SS seconds. |
| 296 |
|
| 297 |
Of usage="TIME": |
| 298 |
* The FormatElement with default="true" type="medium" is used to edit |
| 299 |
times and thus must contain all HH and MM and SS codes, e.g. HH:MM:SS |
| 300 |
* Formatindices 43, 44, 45 are special in the sense that they are |
| 301 |
programmatically used to automatically display values that meet |
| 302 |
certain criteria: |
| 303 |
* Formatindex="43" contains the [HH] format code that displays hour |
| 304 |
values greater than or equal to 24 (as opposed to a simple HH that |
| 305 |
displays modulo 24). |
| 306 |
* Formatindex="44" uses no hour code but 100th seconds and the |
| 307 |
Time100SecSeparator. |
| 308 |
* Formatindex="45" uses both [HH] hour code and 100th seconds to be |
| 309 |
able to edit such time values without losing information. |
| 310 |
|
| 311 |
Of usage="CURRENCY": |
| 312 |
formatindices 12, 13, 14, 15, 17 with [$xxx-yyy] notation must use the |
| 313 |
xxx currency symbol that has the attribute |
| 314 |
usedInCompatibleFormatCodes="true". The hexadecimal yyy LANGID must be |
| 315 |
properly set. It can be found in the file include/i18nlangtag/lang.h ( |
| 316 |
https://opengrok.libreoffice.org/xref/core/include/i18nlangtag/lang.h ) |
| 317 |
You may verify the proper use of the xxx currency symbol with the AWK |
| 318 |
script i18npool/source/localedata/data/currency-check.awk, it mustn't |
| 319 |
display any output. If it does, then there's something wrong. |
| 320 |
|
| 321 |
--> |
| 322 |
<!ELEMENT FormatCode (#PCDATA)> |
| 323 |
|
| 324 |
|
| 325 |
<!-- The LC_CALENDAR element defines calendars used with a locale. --> |
| 326 |
<!ELEMENT LC_CALENDAR (Calendar* ) > |
| 327 |
<!-- At least one Calendar element must be given if the RefLocale mechanism is not used! --> |
| 328 |
<!ATTLIST LC_CALENDAR %RefLocale;> |
| 329 |
|
| 330 |
<!ELEMENT Calendar (DaysOfWeek, MonthsOfYear, GenitiveMonths*, PartitiveMonths*, Eras, StartDayOfWeek, MinimalDaysInFirstWeek) > |
| 331 |
<!ATTLIST Calendar %UNOModule;> |
| 332 |
<!-- The unoid of a gregorian calendar MUST be lower case "gregorian", |
| 333 |
calendars MUST match the names defined in the OASIS OpenDocument Format |
| 334 |
(ODF) 1.2 or later specification. The implementation name registered with |
| 335 |
the LibreOffice service registry MUST match, e.g. |
| 336 |
com.sun.star.i18n.Calendar_gregorian |
| 337 |
--> |
| 338 |
<!ATTLIST Calendar default (true|false) #REQUIRED > |
| 339 |
<!-- Exactly one Calendar element has to be the default calendar. --> |
| 340 |
|
| 341 |
<!ELEMENT DaysOfWeek (Day*)> |
| 342 |
<!-- All Day elements of a Calendar must be given if the RefLocale mechanism is not used! --> |
| 343 |
<!ATTLIST DaysOfWeek %RefLocale;> |
| 344 |
<!-- Sequence of days is important, MUST start with Sunday. --> |
| 345 |
<!ELEMENT Day (DayID, DefaultAbbrvName, DefaultFullName, DefaultNarrowName*)> |
| 346 |
<!ELEMENT DayID (#PCDATA)> |
| 347 |
<!-- Preferably the lower case abbreviated English name like sun for Sunday. --> |
| 348 |
<!ELEMENT DefaultAbbrvName (#PCDATA)> |
| 349 |
<!-- The abbreviated day name, e.g. Sun for Sunday. --> |
| 350 |
<!ELEMENT DefaultFullName (#PCDATA)> |
| 351 |
<!-- The full day name, e.g. Sunday for Sunday. --> |
| 352 |
<!ELEMENT DefaultNarrowName (#PCDATA)> |
| 353 |
<!-- The narrow day name, e.g. S for Sunday. |
| 354 |
If not specified, the first letter of the corresponding DefaultFullName is taken. |
| 355 |
--> |
| 356 |
|
| 357 |
<!ELEMENT MonthsOfYear (Month*)> |
| 358 |
<!-- Nominative month names. |
| 359 |
All Month elements of a Calendar must be given if the RefLocale mechanism is not used! |
| 360 |
--> |
| 361 |
<!ATTLIST MonthsOfYear %RefLocale;> |
| 362 |
<!-- Sequence of months is important, MUST start with the first month of a |
| 363 |
year, e.g. January in a Gregorian calendar. |
| 364 |
--> |
| 365 |
|
| 366 |
<!ELEMENT GenitiveMonths (Month*)> |
| 367 |
<!-- Possessive genitive case month names, for example in Slavic locales. The |
| 368 |
element is optional, but if present all Month elements of a Calendar must |
| 369 |
be given if the RefLocale mechanism is not used! If not specified, |
| 370 |
the MonthsOfYear names will be used in the context of the number |
| 371 |
formatter's genitive case. --> |
| 372 |
<!ATTLIST GenitiveMonths %RefLocale;> |
| 373 |
<!-- Sequence of months is important, MUST start with the first month of a |
| 374 |
year, e.g. January in a Gregorian calendar. |
| 375 |
--> |
| 376 |
|
| 377 |
<!ELEMENT PartitiveMonths (Month*)> |
| 378 |
<!-- Partitive case month names, for example in Finnish locales. The |
| 379 |
element is optional, but if present all Month elements of a Calendar must |
| 380 |
be given if the RefLocale mechanism is not used! If not specified, |
| 381 |
GenitiveMonths names will be used, or if those are not specified then |
| 382 |
MonthsOfYear, in the context of the number formatter's partitive case. --> |
| 383 |
<!ATTLIST PartitiveMonths %RefLocale;> |
| 384 |
<!-- Sequence of months is important, MUST start with the first month of a |
| 385 |
year, e.g. January in a Gregorian calendar. |
| 386 |
--> |
| 387 |
|
| 388 |
<!-- Rules for use of nominative / genitive / partitive case month names in |
| 389 |
number formatter when encountering MMM or MMMM: |
| 390 |
|
| 391 |
* MMM or MMMM immediately preceded or followed by a literal character |
| 392 |
other than space => nominative month name (noun), for Excel and |
| 393 |
backwards compatibility such as Finnish MMMM"ta" |
| 394 |
* no day of month (D or DD) present in format code => nominative name |
| 395 |
* day of month (D or DD) after MMM or MMMM => genitive name |
| 396 |
* no genitive names defined => nominative name |
| 397 |
* day of month (D or DD) before MMM or MMMM => partitive name |
| 398 |
* no partitive names defined => genitive name |
| 399 |
* no genitive names defined => nominative name |
| 400 |
|
| 401 |
NOTE: |
| 402 |
|
| 403 |
If only <MonthsOfYear> and <PartitiveMonths> are specified but not |
| 404 |
<GenitiveMonths>, then for MMM(M) D(D) formats the <MonthsOfYear> |
| 405 |
nominative name is displayed. Only for D(D) MMM(M) formats the |
| 406 |
<PartitiveMonths> name is displayed. |
| 407 |
|
| 408 |
If only for MMM(M) D(D) formats the <GenitiveMonths> are to be displayed |
| 409 |
but nominative names for D(D) MMM(M), then specify <PartitiveMonths> |
| 410 |
identical to <MonthsOfYear>, do not omit it as otherwise it would inherit |
| 411 |
from <GenitiveMonths> again. |
| 412 |
|
| 413 |
--> |
| 414 |
|
| 415 |
<!ELEMENT Month (MonthID, DefaultAbbrvName, DefaultFullName, DefaultNarrowName*)> |
| 416 |
<!ELEMENT MonthID (#PCDATA)> |
| 417 |
<!-- Preferably the lower case abbreviated English name like jan for January. --> |
| 418 |
|
| 419 |
<!ELEMENT Eras (Era*)> |
| 420 |
<!-- All Era elements of a Calendar must be given if the RefLocale mechanism is not used! --> |
| 421 |
<!ATTLIST Eras %RefLocale;> |
| 422 |
<!-- The eras MUST be in chronological order, e.g. first BC then AC. --> |
| 423 |
<!ELEMENT Era (EraID, DefaultAbbrvName, DefaultFullName)> |
| 424 |
<!ELEMENT EraID (#PCDATA)> |
| 425 |
<!-- If a calendar has special eras (like zh_TW ROC or ja_JP Gengou calendar) |
| 426 |
and a date before those eras is undefined, a leading (first) dummy era |
| 427 |
with EraID="Dummy" has to be defined to enable the number formatter to |
| 428 |
fall back to a Gregorian calendar for those date values if the XCalendar |
| 429 |
implementation returns an era value of 0. |
| 430 |
--> |
| 431 |
|
| 432 |
<!ELEMENT StartDayOfWeek (DayID)> |
| 433 |
<!-- MUST exactly match (case significant!) one of the DayID of DaysOfWeek --> |
| 434 |
|
| 435 |
<!ELEMENT MinimalDaysInFirstWeek (#PCDATA)> |
| 436 |
<!-- The number of days of a week that must reside in the beginning of a year |
| 437 |
to make a week the first week of the year. For example, a value of 4 means |
| 438 |
that at least 4 days of a week must be in the new year. So if the week |
| 439 |
starts on Monday, the first week of a year will be the week where Thursday |
| 440 |
is in the new year. |
| 441 |
--> |
| 442 |
|
| 443 |
|
| 444 |
<!-- The LC_CURRENCY element defines currencies used with a locale. --> |
| 445 |
<!ELEMENT LC_CURRENCY (Currency* ) > |
| 446 |
<!-- At least one Currency element must be given if the RefLocale mechanism is not used! --> |
| 447 |
<!ATTLIST LC_CURRENCY %RefLocale;> |
| 448 |
<!ELEMENT Currency (CurrencyID, CurrencySymbol, BankSymbol, CurrencyName, DecimalPlaces)> |
| 449 |
<!ATTLIST Currency default (true|false) #REQUIRED > |
| 450 |
<!-- Exactly one Currency element has to be the default currency. --> |
| 451 |
<!ATTLIST Currency usedInCompatibleFormatCodes (true|false) #REQUIRED > |
| 452 |
<!-- If this currency is the one used in compatible number format codes with |
| 453 |
<member>FormatElement::formatIndex</member> values in the range 12..17. |
| 454 |
Those format codes are used to generate some old style currency format |
| 455 |
codes for compatibility with StarOffice5 and StarOffice4. |
| 456 |
Every locale data file MUST contain exactly one currency having this set to "true", |
| 457 |
and that currency MUST be used in format codes 12..17. |
| 458 |
For European countries using EUR it MUST be the old currency, for example, DM. |
| 459 |
--> |
| 460 |
<!ATTLIST Currency legacyOnly (true|false) #IMPLIED > |
| 461 |
<!-- If this Currency element exists only to be able to correctly load legacy |
| 462 |
documents and is not selectable in the UI otherwise. Defaults to "false" |
| 463 |
if not specified. If this attribute is "true", 'default' and |
| 464 |
'usedInCompatibleFormatCodes' must both be "false". |
| 465 |
|
| 466 |
Currency elements must not be changed to contain only a different |
| 467 |
CurrencySymbol element without changing the CurrencyID and BankSymbol |
| 468 |
elements, instead the entire Currency element must be duplicated, the old |
| 469 |
element needs this 'legacyOnly' attribute be added and 'default' and |
| 470 |
'usedInCompatibleFormatCodes' attributes must be set to "false", and only |
| 471 |
in the new duplicated Currency element the CurrencySymbol element be |
| 472 |
changed. |
| 473 |
--> |
| 474 |
<!ELEMENT CurrencyID (#PCDATA)> |
| 475 |
<!-- The ISO 4217 three letter currency code, e.g. USD or EUR. --> |
| 476 |
<!ELEMENT CurrencySymbol (#PCDATA)> |
| 477 |
<!-- The currency symbol, e.g. $ or €. --> |
| 478 |
<!ELEMENT BankSymbol (#PCDATA)> |
| 479 |
<!-- The ISO 4217 three letter currency code, e.g. USD or EUR. --> |
| 480 |
<!ELEMENT CurrencyName (#PCDATA)> |
| 481 |
<!-- The native currency name, e.g. Dollar or Euro. --> |
| 482 |
<!ELEMENT DecimalPlaces (#PCDATA)> |
| 483 |
<!-- Number of decimal places used with the currency, usually 2 or 0, e.g. 2 |
| 484 |
for cents. |
| 485 |
--> |
| 486 |
|
| 487 |
|
| 488 |
<!ELEMENT LC_CTYPE (Separators?, Markers?, TimeAM?, TimePM?, MeasurementSystem?)> |
| 489 |
<!-- All elements must be given if the RefLocale mechanism is not used! --> |
| 490 |
<!ATTLIST LC_CTYPE %RefLocale;> |
| 491 |
<!ATTLIST LC_CTYPE %UNOModule;> |
| 492 |
|
| 493 |
<!ELEMENT Separators (DateSeparator, ThousandSeparator, DecimalSeparator, DecimalSeparatorAlternative?, TimeSeparator, Time100SecSeparator, ListSeparator, LongDateDayOfWeekSeparator, LongDateDaySeparator, LongDateMonthSeparator, LongDateYearSeparator)> |
| 494 |
<!ELEMENT DateSeparator (#PCDATA)> |
| 495 |
<!ELEMENT ThousandSeparator (#PCDATA)> |
| 496 |
<!ELEMENT DecimalSeparator (#PCDATA)> |
| 497 |
<!ELEMENT DecimalSeparatorAlternative (#PCDATA)> |
| 498 |
<!ELEMENT TimeSeparator (#PCDATA)> |
| 499 |
<!ELEMENT Time100SecSeparator (#PCDATA)> |
| 500 |
<!ELEMENT ListSeparator (#PCDATA)> |
| 501 |
<!ELEMENT LongDateDayOfWeekSeparator (#PCDATA)> |
| 502 |
<!ELEMENT LongDateDaySeparator (#PCDATA)> |
| 503 |
<!ELEMENT LongDateMonthSeparator (#PCDATA)> |
| 504 |
<!ELEMENT LongDateYearSeparator (#PCDATA)> |
| 505 |
|
| 506 |
<!ELEMENT Markers (QuotationStart, QuotationEnd, DoubleQuotationStart, DoubleQuotationEnd)> |
| 507 |
<!ELEMENT QuotationStart (#PCDATA)> |
| 508 |
<!ELEMENT QuotationEnd (#PCDATA)> |
| 509 |
<!ELEMENT DoubleQuotationStart (#PCDATA)> |
| 510 |
<!ELEMENT DoubleQuotationEnd (#PCDATA)> |
| 511 |
|
| 512 |
<!ELEMENT TimeAM (#PCDATA)> |
| 513 |
<!ELEMENT TimePM (#PCDATA)> |
| 514 |
<!ELEMENT MeasurementSystem (#PCDATA)> |
| 515 |
|
| 516 |
|
| 517 |
<!ELEMENT LC_COLLATION (Collator*, CollationOptions?)> |
| 518 |
<!-- All elements must be given if the RefLocale mechanism is not used! --> |
| 519 |
<!ATTLIST LC_COLLATION %RefLocale;> |
| 520 |
<!-- |
| 521 |
Optional ICU tailoring. |
| 522 |
|
| 523 |
See Collation Customization in ICU User Guide for syntax, |
| 524 |
https://unicode-org.github.io/icu/userguide/collation/customization/ |
| 525 |
|
| 526 |
There are two ways to add language specific tailoring in LibreOffice. |
| 527 |
For small tailoring, you can directly add it in locale data here. For |
| 528 |
large tailoring, it is suggested to put the data under collator/data, so |
| 529 |
it will be compiled to a binary format in build time and improve performance |
| 530 |
in run time. |
| 531 |
|
| 532 |
--> |
| 533 |
<!ELEMENT Collator (#PCDATA)> |
| 534 |
<!ATTLIST Collator %UNOModule;> |
| 535 |
<!ATTLIST Collator default (true|false) #REQUIRED > |
| 536 |
<!ELEMENT CollationOptions (TransliterationModules+)> |
| 537 |
<!ELEMENT TransliterationModules (#PCDATA)> |
| 538 |
|
| 539 |
|
| 540 |
<!ELEMENT LC_SEARCH (SearchOptions?)> |
| 541 |
<!-- All elements must be given if the RefLocale mechanism is not used! --> |
| 542 |
<!ATTLIST LC_SEARCH %RefLocale;> |
| 543 |
<!ELEMENT SearchOptions (TransliterationModules+)> |
| 544 |
|
| 545 |
|
| 546 |
<!ELEMENT LC_INDEX (IndexKey*, UnicodeScript*, FollowPageWord*)> |
| 547 |
<!ATTLIST LC_INDEX %RefLocale;> |
| 548 |
|
| 549 |
<!-- |
| 550 |
The IndexKey element is optional, but should be given if the locale |
| 551 |
requires a specific sort order in Writer's index tables or entries are to |
| 552 |
be combined under keys. |
| 553 |
|
| 554 |
Index key for the algorithm and language, like >A-Z< for English => A, B, |
| 555 |
C, ..., Y, Z. The letters specify under which key an entry goes and the |
| 556 |
order the keys are sorted. Keys may be reordered or letters inserted to |
| 557 |
form a specific order, for example (ve_ZA) >A-D Ḓ E-L Ḽ M N Ṋ Ṅ O-T Ṱ U-Z< |
| 558 |
Entries that don't match a defined key are appended to the index list. Used |
| 559 |
in Writer textprocessor. |
| 560 |
|
| 561 |
The initial data was setup according to the ICU collation chart at |
| 562 |
http://oss.software.ibm.com/icu/charts/collation/ |
| 563 |
Note: ICU site was moved to https://icu.unicode.org/ and as ICU per |
| 564 |
default uses CLDR, collation charts are available at |
| 565 |
https://www.unicode.org/cldr/charts/latest/ |
| 566 |
|
| 567 |
Possible notations in the syntax of the IndexKey element are: |
| 568 |
|
| 569 |
'-' (dash): Ellipsis, all letters elided by the ellipsis are included as |
| 570 |
index keys in alphabetic order. For example, 'A-Z' includes all ASCII |
| 571 |
letters A to Z. |
| 572 |
|
| 573 |
'[]' (square brackets): all letters included in square brackets are |
| 574 |
skipping letters. It is used for CTL languages, for example in Thai |
| 575 |
(th_TH), to skip prefix vowels or signs. For example, if ["] double quote |
| 576 |
is defined as skipping letter, index item '"Index"' will be under 'I', not |
| 577 |
'"'. |
| 578 |
|
| 579 |
'{}' (curly brackets): define multiple letters index key, for example |
| 580 |
'{Cs}' is one of the index keys for Hungarian (hu_HU). |
| 581 |
|
| 582 |
'()' (parentheses): define optional description for index key. If defined, |
| 583 |
the description will be shown as index key title, instead of the index key |
| 584 |
itself. For example, 'E(E, É)' in Hungarian adds entries with 'E' to the |
| 585 |
description 'E, É'. |
| 586 |
|
| 587 |
--> |
| 588 |
<!ELEMENT IndexKey (#PCDATA)> |
| 589 |
<!ATTLIST IndexKey %UNOModule;> |
| 590 |
<!ATTLIST IndexKey %LIBModule;> |
| 591 |
<!ATTLIST IndexKey default (true|false) #REQUIRED > |
| 592 |
<!ATTLIST IndexKey phonetic (true|false) #REQUIRED > |
| 593 |
|
| 594 |
<!-- |
| 595 |
The Unicode script types are those of |
| 596 |
offapi/com/sun/star/i18n/UnicodeScript.idl, they define the code range for |
| 597 |
the language. |
| 598 |
--> |
| 599 |
<!ELEMENT UnicodeScript (#PCDATA)> |
| 600 |
|
| 601 |
<!-- |
| 602 |
The FollowPageWord entries were originally hard-coded in |
| 603 |
../../indexentry/indexentrysupplier.cxx, most locales used the English |
| 604 |
``p.'' and ``pp.'', valid data should be provided by native speakers. |
| 605 |
These words or abbreviations are used in the Writer's index table. The |
| 606 |
first FollowPageWord element is the abbreviation for "page" (p.), the |
| 607 |
second FollowPageWord element the abbreviation for "page and following |
| 608 |
pages" (pp.). |
| 609 |
--> |
| 610 |
<!ELEMENT FollowPageWord (#PCDATA)> |
| 611 |
|
| 612 |
|
| 613 |
<!ELEMENT LC_TRANSLITERATION (Transliteration*)> |
| 614 |
<!ATTLIST LC_TRANSLITERATION %RefLocale;> |
| 615 |
<!ELEMENT Transliteration EMPTY> |
| 616 |
<!ATTLIST Transliteration %UNOModule;> |
| 617 |
|
| 618 |
<!ELEMENT LC_MISC (ForbiddenCharacters?, BreakIteratorRules?, ReservedWords?)> |
| 619 |
<!ATTLIST LC_MISC %RefLocale;> |
| 620 |
<!ELEMENT ForbiddenCharacters (ForbiddenLineBeginCharacters, ForbiddenLineEndCharacters, LineBreakHangingCharacters)> |
| 621 |
<!ELEMENT ForbiddenLineBeginCharacters (#PCDATA)> |
| 622 |
<!ELEMENT ForbiddenLineEndCharacters (#PCDATA)> |
| 623 |
|
| 624 |
<!-- optional break iterator rules for the languages. |
| 625 |
if defined, 5 rules should be all listed, each of them can be blank and default will be used. |
| 626 |
order of the rules is significant! |
| 627 |
--> |
| 628 |
<!ELEMENT BreakIteratorRules (EditMode, DictionaryMode, WordCountMode, CharacterMode, LineMode)> |
| 629 |
<!ELEMENT EditMode (#PCDATA)> |
| 630 |
<!ELEMENT DictionaryMode (#PCDATA)> |
| 631 |
<!ELEMENT WordCountMode (#PCDATA)> |
| 632 |
<!ELEMENT CharacterMode (#PCDATA)> |
| 633 |
<!ELEMENT LineMode (#PCDATA)> |
| 634 |
|
| 635 |
<!ELEMENT ReservedWords (trueWord, falseWord, quarter1Word, quarter2Word, quarter3Word, quarter4Word, aboveWord, belowWord, quarter1Abbreviation, quarter2Abbreviation, quarter3Abbreviation, quarter4Abbreviation)> |
| 636 |
<!-- order is significant! --> |
| 637 |
<!-- trueWord and falseWord are displayed (uppercased) for the BOOLEAN number |
| 638 |
format keyword. "true", "false" --> |
| 639 |
<!ELEMENT trueWord (#PCDATA)> |
| 640 |
<!ELEMENT falseWord (#PCDATA)> |
| 641 |
<!-- quarter1Word,... are displayed for the QQ number format keyword. |
| 642 |
"1st quarter", "2nd quarter", ...; "1er trimestre", "2e trimestre", ... --> |
| 643 |
<!ELEMENT quarter1Word (#PCDATA)> |
| 644 |
<!ELEMENT quarter2Word (#PCDATA)> |
| 645 |
<!ELEMENT quarter3Word (#PCDATA)> |
| 646 |
<!ELEMENT quarter4Word (#PCDATA)> |
| 647 |
<!-- aboveWord and belowWord are used as reference field content in Writer, it |
| 648 |
is a "physical" object relative position, not "numerical" relative. |
| 649 |
Like section "above" and section "below". --> |
| 650 |
<!ELEMENT aboveWord (#PCDATA)> |
| 651 |
<!ELEMENT belowWord (#PCDATA)> |
| 652 |
<!-- quarter1Abbreviation,... are displayed for the Q number format keyword. |
| 653 |
"Q1" (quarter), "T1" (trimestre), ... --> |
| 654 |
<!ELEMENT quarter1Abbreviation (#PCDATA)> |
| 655 |
<!ELEMENT quarter2Abbreviation (#PCDATA)> |
| 656 |
<!ELEMENT quarter3Abbreviation (#PCDATA)> |
| 657 |
<!ELEMENT quarter4Abbreviation (#PCDATA)> |
| 658 |
|
| 659 |
|
| 660 |
<!-- |
| 661 |
In numbering levels, the NumType attribute is a value of the constants |
| 662 |
defined in offapi/com/sun/star/style/NumberingType.idl ( |
| 663 |
https://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/style/NumberingType.idl |
| 664 |
) |
| 665 |
--> |
| 666 |
|
| 667 |
<!ELEMENT LC_NumberingLevel (NumberingLevel* )> |
| 668 |
<!ATTLIST LC_NumberingLevel %RefLocale;> |
| 669 |
<!ELEMENT NumberingLevel EMPTY> |
| 670 |
<!ATTLIST NumberingLevel Prefix CDATA #REQUIRED> |
| 671 |
<!ATTLIST NumberingLevel NumType CDATA #REQUIRED> |
| 672 |
<!ATTLIST NumberingLevel Suffix CDATA #REQUIRED> |
| 673 |
<!ATTLIST NumberingLevel Transliteration CDATA #IMPLIED> |
| 674 |
<!ATTLIST NumberingLevel NatNum CDATA #IMPLIED> |
| 675 |
|
| 676 |
|
| 677 |
<!ELEMENT LC_OutLineNumberingLevel (OutlineStyle* )> |
| 678 |
<!ATTLIST LC_OutLineNumberingLevel %RefLocale;> |
| 679 |
<!ELEMENT OutlineStyle (OutLineNumberingLevel+)> |
| 680 |
<!ELEMENT OutLineNumberingLevel EMPTY> |
| 681 |
<!ATTLIST OutLineNumberingLevel Prefix CDATA #REQUIRED > |
| 682 |
<!ATTLIST OutLineNumberingLevel NumType CDATA #REQUIRED > |
| 683 |
<!ATTLIST OutLineNumberingLevel Suffix CDATA #REQUIRED > |
| 684 |
<!ATTLIST OutLineNumberingLevel BulletChar CDATA #REQUIRED > |
| 685 |
<!ATTLIST OutLineNumberingLevel BulletFontName CDATA #REQUIRED> |
| 686 |
<!ATTLIST OutLineNumberingLevel ParentNumbering CDATA #REQUIRED > |
| 687 |
<!ATTLIST OutLineNumberingLevel LeftMargin CDATA #REQUIRED> |
| 688 |
<!ATTLIST OutLineNumberingLevel SymbolTextDistance CDATA #REQUIRED > |
| 689 |
<!ATTLIST OutLineNumberingLevel FirstLineOffset CDATA #REQUIRED > |
| 690 |
<!ATTLIST OutLineNumberingLevel Adjust CDATA #IMPLIED > |
| 691 |
<!ATTLIST OutLineNumberingLevel Transliteration CDATA #IMPLIED > |
| 692 |
<!ATTLIST OutLineNumberingLevel NatNum CDATA #IMPLIED> |