From 1830cd856a7eba4083920ab3f1a9948c7c3eca6e Mon Sep 17 00:00:00 2001 From: Michel Weimerskirch Date: Thu, 17 Feb 2022 16:56:25 +0100 Subject: [PATCH] Sort language lists by locale --- src-ui/angular.json | 16 ++++++++-------- src-ui/src/app/services/settings.service.ts | 16 ++++++++-------- src/paperless/settings.py | 14 +++++++------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src-ui/angular.json b/src-ui/angular.json index b9659fd07..7c39f150c 100644 --- a/src-ui/angular.json +++ b/src-ui/angular.json @@ -17,19 +17,19 @@ "sourceLocale": "en-US", "locales": { "de-DE": "src/locale/messages.de_DE.xlf", - "nl-NL": "src/locale/messages.nl_NL.xlf", - "fr-FR": "src/locale/messages.fr_FR.xlf", "en-GB": "src/locale/messages.en_GB.xlf", + "es-ES": "src/locale/messages.es_ES.xlf", + "fr-FR": "src/locale/messages.fr_FR.xlf", + "it-IT": "src/locale/messages.it_IT.xlf", + "lb-LU": "src/locale/messages.lb_LU.xlf", + "nl-NL": "src/locale/messages.nl_NL.xlf", + "pl-PL": "src/locale/messages.pl_PL.xlf", "pt-BR": "src/locale/messages.pt_BR.xlf", "pt-PT": "src/locale/messages.pt_PT.xlf", - "it-IT": "src/locale/messages.it_IT.xlf", "ro-RO": "src/locale/messages.ro_RO.xlf", "ru-RU": "src/locale/messages.ru_RU.xlf", - "es-ES": "src/locale/messages.es_ES.xlf", - "pl-PL": "src/locale/messages.pl_PL.xlf", - "sv-SE": "src/locale/messages.sv_SE.xlf", - "lb-LU": "src/locale/messages.lb_LU.xlf" - } + "sv-SE": "src/locale/messages.sv_SE.xlf" + } }, "architect": { "build": { diff --git a/src-ui/src/app/services/settings.service.ts b/src-ui/src/app/services/settings.service.ts index 7b467f6ee..d91da8212 100644 --- a/src-ui/src/app/services/settings.service.ts +++ b/src-ui/src/app/services/settings.service.ts @@ -88,19 +88,19 @@ export class SettingsService { getLanguageOptions(): LanguageOption[] { return [ {code: "en-us", name: $localize`English (US)`, englishName: "English (US)", dateInputFormat: "mm/dd/yyyy"}, - {code: "en-gb", name: $localize`English (GB)`, englishName: "English (GB)", dateInputFormat: "dd/mm/yyyy"}, {code: "de-de", name: $localize`German`, englishName: "German", dateInputFormat: "dd.mm.yyyy"}, - {code: "nl-nl", name: $localize`Dutch`, englishName: "Dutch", dateInputFormat: "dd-mm-yyyy"}, + {code: "en-gb", name: $localize`English (GB)`, englishName: "English (GB)", dateInputFormat: "dd/mm/yyyy"}, + {code: "es-es", name: $localize`Spanish`, englishName: "Spanish", dateInputFormat: "dd/mm/yyyy"}, {code: "fr-fr", name: $localize`French`, englishName: "French", dateInputFormat: "dd/mm/yyyy"}, - {code: "pt-pt", name: $localize`Portuguese`, englishName: "Portuguese", dateInputFormat: "dd/mm/yyyy"}, - {code: "pt-br", name: $localize`Portuguese (Brazil)`, englishName: "Portuguese (Brazil)", dateInputFormat: "dd/mm/yyyy"}, {code: "it-it", name: $localize`Italian`, englishName: "Italian", dateInputFormat: "dd/mm/yyyy"}, + {code: "lb-lu", name: $localize`Luxembourgish`, englishName: "Luxembourgish", dateInputFormat: "dd.mm.yyyy"}, + {code: "nl-nl", name: $localize`Dutch`, englishName: "Dutch", dateInputFormat: "dd-mm-yyyy"}, + {code: "pl-pl", name: $localize`Polish`, englishName: "Polish", dateInputFormat: "dd.mm.yyyy"}, + {code: "pt-br", name: $localize`Portuguese (Brazil)`, englishName: "Portuguese (Brazil)", dateInputFormat: "dd/mm/yyyy"}, + {code: "pt-pt", name: $localize`Portuguese`, englishName: "Portuguese", dateInputFormat: "dd/mm/yyyy"}, {code: "ro-ro", name: $localize`Romanian`, englishName: "Romanian", dateInputFormat: "dd.mm.yyyy"}, {code: "ru-ru", name: $localize`Russian`, englishName: "Russian", dateInputFormat: "dd.mm.yyyy"}, - {code: "es-es", name: $localize`Spanish`, englishName: "Spanish", dateInputFormat: "dd/mm/yyyy"}, - {code: "pl-pl", name: $localize`Polish`, englishName: "Polish", dateInputFormat: "dd.mm.yyyy"}, - {code: "sv-se", name: $localize`Swedish`, englishName: "Swedish", dateInputFormat: "yyyy-mm-dd"}, - {code: "lb-lu", name: $localize`Luxembourgish`, englishName: "Luxembourgish", dateInputFormat: "dd.mm.yyyy"} + {code: "sv-se", name: $localize`Swedish`, englishName: "Swedish", dateInputFormat: "yyyy-mm-dd"} ] } diff --git a/src/paperless/settings.py b/src/paperless/settings.py index 5241c8c98..09c2415d8 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -301,20 +301,20 @@ DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' LANGUAGE_CODE = 'en-us' LANGUAGES = [ - ("en-us", _("English (US)")), - ("en-gb", _("English (GB)")), + ("en-us", _("English (US)")), # needs to be first to act as fallback language ("de-de", _("German")), - ("nl-nl", _("Dutch")), + ("en-gb", _("English (GB)")), + ("es-es", _("Spanish")), ("fr-fr", _("French")), + ("it-it", _("Italian")), + ("lb-lu", _("Luxembourgish")), + ("nl-nl", _("Dutch")), + ("pl-pl", _("Polish")), ("pt-br", _("Portuguese (Brazil)")), ("pt-pt", _("Portuguese")), - ("it-it", _("Italian")), ("ro-ro", _("Romanian")), ("ru-ru", _("Russian")), - ("es-es", _("Spanish")), - ("pl-pl", _("Polish")), ("sv-se", _("Swedish")), - ("lb-lu", _("Luxembourgish")), ] LOCALE_PATHS = [