Changeset ac3af33 in OpenWorkouts-current for ow/utilities.py
- Timestamp:
- Feb 26, 2019, 11:54:11 PM (5 years ago)
- Branches:
- current, feature/docs, master
- Children:
- 68d00f5
- Parents:
- e171dc2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/utilities.py
re171dc2 rac3af33 282 282 283 283 284 def get_month_names(): 285 """ 286 Return a list with the names of the months, marked for translation. 287 288 This should be done automatically by the calendar module: 289 290 >>> import calendar 291 >>> calendar.month_name[1] 292 'January' 293 >>> 294 295 But even trying setting the proper locale (using locale.setlocale()), 296 in some operating systems the names are not translated (OpenBSD). 297 298 So, for now, we use this dirty trick 299 """ 300 return [ 301 '', 302 _('January'), 303 _('February'), 304 _('March'), 305 _('April'), 306 _('May'), 307 _('June'), 308 _('July'), 309 _('August'), 310 _('September'), 311 _('October'), 312 _('November'), 313 _('December') 314 ] 315 316 317 def get_week_day_names(): 318 """ 319 Return a list with the names of the week days, marked for translation. 320 321 As with get_month_names(), this is a dirty workaround for some locale 322 problem in some operating systems 323 """ 324 return [ 325 _('Monday'), 326 _('Tuesday'), 327 _('Wednesday'), 328 _('Thursday'), 329 _('Friday'), 330 _('Saturday'), 331 _('Sunday'), 332 ] 333 334 284 335 def part_of_day(dt): 285 336 """
Note: See TracChangeset
for help on using the changeset viewer.