Skip to content

Commit

Permalink
Update models.py
Browse files Browse the repository at this point in the history
  • Loading branch information
catgirlinspace authored Jul 29, 2023
1 parent 0b88973 commit eb18ca3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions splatnet_assets/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.db import models
from django.utils.translation import get_language
from django.utils.translation import get_language, to_locale

from splatnet_assets.fields import ColorField

Expand Down Expand Up @@ -73,7 +73,7 @@ class Type(models.TextChoices):
@property
def string(self, locale: str = None):
if locale is None:
locale = get_language()
locale = to_locale(get_language())
# Handle locales that don't exist
exists = hasattr(self, f'string_{locale.lower().replace("-", "_")}')
if not exists:
Expand Down

0 comments on commit eb18ca3

Please sign in to comment.