diff --git a/allianceauth/authentication/migrations/0024_alter_userprofile_language.py b/allianceauth/authentication/migrations/0024_alter_userprofile_language.py new file mode 100644 index 00000000..b41fc36e --- /dev/null +++ b/allianceauth/authentication/migrations/0024_alter_userprofile_language.py @@ -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'), + ), + ] diff --git a/allianceauth/authentication/models.py b/allianceauth/authentication/models.py index 898dd177..714f1934 100644 --- a/allianceauth/authentication/models.py +++ b/allianceauth/authentication/models.py @@ -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, diff --git a/allianceauth/project_template/project_name/settings/base.py b/allianceauth/project_template/project_name/settings/base.py index cf26fe4a..fb18e4de 100644 --- a/allianceauth/project_template/project_name/settings/base.py +++ b/allianceauth/project_template/project_name/settings/base.py @@ -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 = [