feat(demo_data): use translation override to ensure consistent locale
wraps actions in a `with override("en")` block to enforce the use of the English locale during execution. This ensures consistent behavior and message formatting regardless of the server's default language settings.
This commit is contained in:
parent
a59c5f59dd
commit
79be6ed4e4
1 changed files with 8 additions and 6 deletions
|
|
@ -10,6 +10,7 @@ from django.core.files.base import ContentFile
|
|||
from django.core.management.base import BaseCommand
|
||||
from django.db import transaction
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import override
|
||||
|
||||
from engine.blog.models import Post, PostTag
|
||||
from engine.core.models import (
|
||||
|
|
@ -86,6 +87,7 @@ class Command(BaseCommand):
|
|||
|
||||
self._load_demo_data()
|
||||
|
||||
with override("en"):
|
||||
if action == "install":
|
||||
self._install(options)
|
||||
elif action == "remove":
|
||||
|
|
|
|||
Loading…
Reference in a new issue