update language codes

This commit is contained in:
Joel Falknau 2024-09-13 19:59:40 +10:00
parent ce8935e621
commit 0a17427169
No known key found for this signature in database
3 changed files with 43 additions and 19 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 4.2 on 2024-09-13 09:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authentication', '0023_alter_userprofile_language'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='language',
field=models.CharField(blank=True, choices=[('en', 'English'), ('cs-cz', 'Czech'), ('de', 'German'), ('es', 'Spanish'), ('it-it', 'Italian'), ('ja', 'Japanese'), ('ko-kr', 'Korean'), ('fr-fr', 'French'), ('ru', 'Russian'), ('nl-nl', 'Dutch'), ('pl-pl', 'Polish'), ('uk', 'Ukrainian'), ('zh-hans', 'Simplified Chinese')], default='', max_length=10, verbose_name='Language'),
),
]

View File

@ -67,18 +67,20 @@ class UserProfile(models.Model):
"""
Choices for UserProfile.language
"""
# Sorted by Language Code alphabetical order + English at top
ENGLISH = 'en', _('English')
CZECH = 'cs-cz', _("Czech") # Not yet at 50% translated
GERMAN = 'de', _('German')
SPANISH = 'es', _('Spanish')
CHINESE = 'zh-hans', _('Chinese Simplified')
RUSSIAN = 'ru', _('Russian')
KOREAN = 'ko', _('Korean')
FRENCH = 'fr', _('French')
ITALIAN = 'it-it', _('Italian')
JAPANESE = 'ja', _('Japanese')
ITALIAN = 'it', _('Italian')
KOREAN = 'ko-kr', _('Korean')
FRENCH = 'fr-fr', _('French')
RUSSIAN = 'ru', _('Russian')
DUTCH = 'nl-nl', _("Dutch")
POLISH = 'pl-pl', _("Polish")
UKRAINIAN = 'uk', _('Ukrainian')
POLISH = 'pl', _("Polish")
CHINESE = 'zh-hans', _('Simplified Chinese')
user = models.OneToOneField(
User,

View File

@ -12,6 +12,8 @@ from celery.schedules import crontab
from django.contrib import messages
from django.utils.translation import gettext_lazy as _
INSTALLED_APPS = [
'allianceauth', # needs to be on top of this list to support favicons in Django admin (see https://gitlab.com/allianceauth/allianceauth/-/issues/1301)
'django.contrib.admin',
@ -93,18 +95,20 @@ LOCALE_PATHS = (
os.path.join(BASE_DIR, 'locale/'),
)
LANGUAGES = (
("en", "English"),
("de", "German"),
("es", "Spanish"),
("zh-hans", "Chinese Simplified"),
("ru", "Russian"),
("ko", "Korean"),
("fr", "French"),
("ja", "Japanese"),
("it", "Italian"),
("uk", "Ukrainian"),
("pl", "Polish"),
LANGUAGES = ( # Sorted by Language Code alphabetical order + English at top
("en", _("English")),
# ("cs-cz", _("Czech")), #Not yet at 50% translated
("de", _("German")),
("es", _("Spanish")),
("it-it", _("Italian")),
("ja", _("Japanese")),
("ko-kr", _("Korean")),
("fr-fr", _("French")),
("nl-nl", _("Dutch")),
("pl-pl", _("Polish")),
("ru", _("Russian")),
("uk", _("Ukrainian")),
("zh-hans", _("Simplified Chinese")),
)
TEMPLATES = [