Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Chronos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Chronos
Commits
5400880f
Verified
Commit
5400880f
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Use choices function from python-calendarweek for i18n of weekday names
parent
5d161253
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!85
Resolve "Translate weekdays"
Pipeline
#3698
passed
4 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/chronos/models.py
+8
-4
8 additions, 4 deletions
aleksis/apps/chronos/models.py
with
8 additions
and
4 deletions
aleksis/apps/chronos/models.py
+
8
−
4
View file @
5400880f
...
@@ -17,7 +17,11 @@ from django.utils.formats import date_format
...
@@ -17,7 +17,11 @@ from django.utils.formats import date_format
from
django.utils.translation
import
gettext_lazy
as
_
from
django.utils.translation
import
gettext_lazy
as
_
from
cache_memoize
import
cache_memoize
from
cache_memoize
import
cache_memoize
from
calendarweek.django
import
CalendarWeek
,
i18n_day_abbrs_lazy
,
i18n_day_names_lazy
from
calendarweek.django
import
(
CalendarWeek
,
i18n_day_abbr_choices_lazy
,
i18n_day_name_choices_lazy
,
)
from
colorfield.fields
import
ColorField
from
colorfield.fields
import
ColorField
from
django_global_request.middleware
import
get_request
from
django_global_request.middleware
import
get_request
...
@@ -125,11 +129,11 @@ class ValidityRange(ExtensibleModel):
...
@@ -125,11 +129,11 @@ class ValidityRange(ExtensibleModel):
class
TimePeriod
(
ValidityRangeRelatedExtensibleModel
):
class
TimePeriod
(
ValidityRangeRelatedExtensibleModel
):
WEEKDAY_CHOICES
=
list
(
enumerate
(
i18n_day_names_lazy
()
))
WEEKDAY_CHOICES
=
i18n_day_name
_choice
s_lazy
()
WEEKDAY_CHOICES_SHORT
=
list
(
enumerate
(
i18n_day_abbrs_lazy
()
))
WEEKDAY_CHOICES_SHORT
=
i18n_day_abbr
_choice
s_lazy
()
weekday
=
models
.
PositiveSmallIntegerField
(
weekday
=
models
.
PositiveSmallIntegerField
(
verbose_name
=
_
(
"
Week day
"
),
choices
=
WEEKDAY_CHOICES
verbose_name
=
_
(
"
Week day
"
),
choices
=
i18n_day_name_choices_lazy
()
)
)
period
=
models
.
PositiveSmallIntegerField
(
verbose_name
=
_
(
"
Number of period
"
))
period
=
models
.
PositiveSmallIntegerField
(
verbose_name
=
_
(
"
Number of period
"
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment