summaryrefslogtreecommitdiffstats
path: root/util/locale_database/qlocalexml.rnc
blob: 5ed59c47b58dcd15d1a51842aaa57c7ce0e165e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# Copyright (C) 2021 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
# This is RelaxNG compact schema for qLocaleXML interemediate locale data
# representation format produced and consumed by the qlocalexml module.
#
# To validate an xml file run:
#
#      jing -c qlocalexml.rnc <your-file.xml>
#
# You can download jing from https://relaxng.org/jclark/jing.html if your
# package manager lacks the jing package.

start = element localeDatabase {
  attribute versionCldr { text },
  attribute versionQt { text },
  element languageList { Naming+ },
  element scriptList { Naming+ },
  element territoryList { Naming+ },
  element likelySubtags { LikelySubtag+ },
  element zoneAliases { ZoneAlias+ },
  element windowsZone { MsLandZones+, MsZoneIana+ },
  element landZones { LandZone+ },
  element metaZones { MetaZone+ },
  element zoneStories { ZoneStory+ },
  element localeList { Locale+ }
}

Naming = element naming {
  attribute id { xsd:nonNegativeInteger },
  attribute code { text },
  text
}

LikelySubtag = element likelySubtag {
  element from { LocaleTriplet },
  element to { LocaleTriplet }
}

LocaleTriplet = (
  attribute language { xsd:nonNegativeInteger },
  attribute script { xsd:nonNegativeInteger },
  attribute territory { xsd:nonNegativeInteger }
)

# TODO: xsd patterns for IANA IDs and space-joined lists of them
ZoneAlias = element zoneAlias {
  attribute alias { text },
  attribute iana { text }
}

MsLandZones = element msLandZones {
  attribute territory { text },
  element msid { text },
  element ianaids { text }
}

MsZoneIana = element msZoneIana {
  attribute iana { text },
  element msid { text }
}

LandZone = element landZone {
  attribute territory { text },
  text
}

MetaZone = element metaZone {
  attribute metakey { xsd:positiveInteger },
  element metaname { text },
  LandZone+
}

ZoneStory = element zoneStory {
  attribute iana { text },
  MetaInterval+
}

MetaInterval = element metaInterval {
  attribute start { xsd:nonNegativeInteger },
  attribute stop { xsd:nonNegativeInteger },
  attribute metakey { xsd:positiveInteger }
}

WeekDay = ("sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat")
Digit = xsd:string { pattern = "\d" }
Punctuation = xsd:string { pattern = "\p{P}" }
GroupSizes = xsd:string { pattern = "\d;\d;\d" }

ZoneForms = element zoneForms {
  attribute name { text }, # 'regionFormats', 'short' or 'long'
  element generic { text }?,
  element standard { text }?,
  element daylightSaving { text }?
}

ZoneNames = element zoneNames {
  attribute name { text }, # IANA ID of zone, or CLDR metazone name
  element exemplar { text }?, # metaZoneNaming omits exemplar
  ZoneForms* # for name in {'short', 'long'}
}

Locale = element locale {
  element language { text },
  element script { text },
  element territory { text },
  element decimal { Punctuation },
  element group { text },
  element zero { Digit },
  element list { Punctuation },
  element percent { text },
  element minus { text },
  element plus { text },
  element exp { text },
  element languageEndonym { text },
  element territoryEndonym { text },
  element quotationStart { Punctuation },
  element quotationEnd { Punctuation },
  element alternateQuotationStart { Punctuation },
  element alternateQuotationEnd { Punctuation },
  element listPatternPartStart { text },
  element listPatternPartMiddle { text },
  element listPatternPartEnd { text },
  element listPatternPartTwo { text },
  element byte_unit { text },
  element byte_si_quantified { text },
  element byte_iec_quantified { text },
  element am { text },
  element pm { text },
  element firstDayOfWeek { text },
  element weekendStart { WeekDay },
  element weekendEnd { WeekDay },
  element longDateFormat { text },
  element shortDateFormat { text },
  element longTimeFormat { text },
  element shortTimeFormat { text },
  element currencyIsoCode { text },
  element currencySymbol { text },
  element currencyDisplayName { text },
  element currencyFormat { text },
  element currencyNegativeFormat { text },

  # Timezone (and metazone) format data
  element positiveOffsetFormat { text },
  element negativeOffsetFormat { text },
  element gmtOffsetFormat { text },
  element fallbackZoneFormat { text },

  # Day names
  element longDays { text },
  element standaloneLongDays { text },
  element shortDays { text },
  element standaloneShortDays { text },
  element narrowDays { text },
  element standaloneNarrowDays { text },

  # Some of these entries may be absent depending on command line arguments
  element longMonths_gregorian { text }?,
  element longMonths_persian { text }?,
  element longMonths_islamic { text }?,
  element standaloneLongMonths_gregorian { text }?,
  element standaloneLongMonths_persian { text }?,
  element standaloneLongMonths_islamic { text }?,
  element shortMonths_gregorian { text }?,
  element shortMonths_persian { text }?,
  element shortMonths_islamic { text }?,
  element standaloneShortMonths_gregorian { text }?,
  element standaloneShortMonths_persian { text }?,
  element standaloneShortMonths_islamic { text }?,
  element narrowMonths_gregorian { text }?,
  element narrowMonths_persian { text }?,
  element narrowMonths_islamic { text }?,
  element standaloneNarrowMonths_gregorian { text }?,
  element standaloneNarrowMonths_persian { text }?,
  element standaloneNarrowMonths_islamic { text }?,

  element groupSizes { GroupSizes },
  element currencyDigits { xsd:nonNegativeInteger },
  element currencyRounding { xsd:nonNegativeInteger },

  # Timezone (and metazone) naming data
  ZoneForms?, # name is 'regionFormats'
  element zoneNaming { ZoneNames+ }?,
  element metaZoneNaming { ZoneNames+ }?
}