forked from edgewall/trac
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jprefs_localization.html
233 lines (207 loc) · 7.48 KB
/
jprefs_localization.html
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
{# Copyright (C) 2006-2014 Edgewall Software
This software is licensed as described in the file COPYING, which
you should have received as part of this distribution. The terms
are also available at http://trac.edgewall.com/license.html.
This software consists of voluntary contributions made by many
individuals. For the exact contribution history, see the revision
history and logs, available at http://trac.edgewall.org/.
#}
# extends "jprefs.html"
<!DOCTYPE html>
<html>
<head>
<title>
# block preftitle
${_("Localization")}
# endblock preftitle
</title>
</head>
<body>
# block prefpanel
# set session_tzname = session.get('tz')
# set selected_tz = timezone(session_tzname) or utc
<table>
<tr class="field">
<th><label for="language">${_("Language:")}</label></th>
<td>
# set session_language = session.get('language', '').replace('-', '_')
<select id="language" name="language"${
{'disabled': not languages,
'title': _('Translations are currently unavailable')
if not languages
}|htmlattr}>
<option value="">${_("Default language")}</option>
# for locale, language in languages:
<option${{'value': locale,
'selected': session_language == locale
}|htmlattr}>${language}</option>
# endfor
</select>
# if 'TRAC_ADMIN' in req.perm:
# if not has_babel:
<span class="hint">
${_("Install Babel for extended language support.")}
</span>
# endif
# if has_babel and not languages:
<span class="hint">
${_("Message catalogs have not been compiled.")}
</span>
# endif
# endif
</td>
</tr>
<tr>
<th></th>
<td>
# if languages:
<p class="hint">
# trans
Configuring your language will result in all text
displayed on this site to use your language instead of
that of the server.
# endtrans
</p>
<p class="hint">
# trans
The <strong>Default language</strong> option uses the
browser's language negotiation feature to select the
appropriate language.
# endtrans
</p>
# else:
<p class="hint" xml:lang="en">
# if 'TRAC_ADMIN' in req.perm:
# trans href = href.wiki('TracInstall')
Trac has been localized to more than a dozen of languages
but in order to be able to use them,
the <a href="http://babel.edgewall.org">Babel</a> package
needs to be present when installing Trac. See
<a href="${href}">TracInstall</a> for details.
# endtrans
# else:
# set trac_admin = _("Trac administrator")
# set project_admin
# if project.admin:
<a href="mailto:${project.admin}">${trac_admin}</a>
# else:
${trac_admin}
# endif
# endset
# trans project_admin = project_admin
Please contact your ${project_admin} to enable existing
translations.
# endtrans
# endif
</p>
# endif
</td>
</tr>
<tr class="field">
<th><label for="tz">${_("Time zone:")}</label></th>
<td><select id="tz" name="tz">
<option value="">${_("Default time zone")}</option>
# for tzname in timezones:
<option${{'value': tzname,
'selected': session_tzname is not none and
session_tzname.startswith('Etc/') and
selected_tz == timezone(tzname) or
session_tzname == tzname
}|htmlattr}>${tzname}</option>
# endfor
</select></td>
</tr>
<tr>
<th></th>
<td>
<p class="hint">
# trans
Configuring your time zone will result in all dates and
times displayed on this site to use your time zone instead
of that of the server.
# endtrans
</p>
<p class="hint">
# set now = datetime.now(utc)
# set nowtz = selected_tz.normalize(now.astimezone(selected_tz))
# set formatted = format_time(now, 'iso8601', tzinfo=req.tz)
# trans time = format_time(now, 'iso8601', tzinfo=utc)
Example: The current time is <strong>${time}</strong> (UTC).
# endtrans
<br />
# if session_tzname:
# trans tz = nowtz.tzname(), formatted
In your time zone ${tz}, this would be displayed as
<strong>${formatted}</strong>.
# endtrans
# else:
# trans formatted
In the default time zone, this would be displayed
as <strong>${formatted}</strong>.
# endtrans
# endif
</p>
<p class="hint">
# trans
Note: Universal Co-ordinated Time (UTC) is also known as
Greenwich Mean Time (GMT).<br />A positive offset is used
to indicate a timezone at the east of Greenwich,
i.e. ahead of Universal Time.
# endtrans
</p>
</td>
</tr>
<tr class="field">
# set session_lc_time = session.get('lc_time')
<th><label for="lc_time">${_("Date format:")}</label></th>
<td><select id="lc_time" name="lc_time">
<option value="">${_("Default date format")}</option>
# if locales and languages:
<option value="locale"${
{'selected': session_lc_time == 'locale'
}|htmlattr}>${_("Your language setting")}</option>
# endif
<option value="iso8601"${
{'selected': session_lc_time == 'iso8601'
}|htmlattr}>${_("ISO 8601 format")}</option>
</select></td>
</tr>
<tr>
<th></th>
<td><p class="hint">
# trans
Configuring your date format will result in formatting and
parsing datetime displayed on this site to use your date
format instead of that of the server.
# endtrans
</p>
</td>
</tr>
<tr class="field">
# set session_dateinfo = session.get('dateinfo')
<th><label for="dateinfo">${_("Time format:")}</label></th>
<td><select id="dateinfo" name="dateinfo">
<option value="">${_("Default format")}</option>
<option value="relative"${
{'selected': session_dateinfo == 'relative'
}|htmlattr}>${_("Relative format")}</option>
<option value="absolute"${
{'selected': session_dateinfo == 'absolute'
}|htmlattr}>${_("Absolute format")}</option>
</select></td>
</tr>
<tr>
<th></th>
<td><p class="hint">
# trans
Configuring your relative/absolute
format will result in formatting datetime displayed on this
site to use your format instead of that of the server.
# endtrans
</p>
</td>
</tr>
</table>
# endblock prefpanel
</body>
</html>