From 45bd436ea786d8a44dcd589f705721bb8c6066ff Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Thu, 26 Sep 2024 23:01:09 +0200 Subject: [PATCH] feat(i18n): Add an english translation --- default.nix | 3 +- src/app/settings.py | 14 +- src/app/urls.py | 1 + src/shared/locale/en/LC_MESSAGES/django.mo | Bin 0 -> 5262 bytes src/shared/locale/en/LC_MESSAGES/django.po | 269 +++++++++++++++++++++ src/shared/static/bulma/bulma.scss | 6 + src/shared/templates/_footer.html | 4 +- src/shared/templates/_hero.html | 80 ++++-- 8 files changed, 348 insertions(+), 29 deletions(-) create mode 100644 src/shared/locale/en/LC_MESSAGES/django.mo create mode 100644 src/shared/locale/en/LC_MESSAGES/django.po diff --git a/default.nix b/default.nix index 6598c74..0210594 100644 --- a/default.nix +++ b/default.nix @@ -48,8 +48,9 @@ in name = "dgsi.dev"; packages = [ - pkgs.jq pkgs.dart-sass + pkgs.gettext + pkgs.jq # Python dependencies (python.withPackages (ps: [ diff --git a/src/app/settings.py b/src/app/settings.py index 1192bda..98e7808 100644 --- a/src/app/settings.py +++ b/src/app/settings.py @@ -55,6 +55,7 @@ INSTALLED_APPS = [ MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.locale.LocaleMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", @@ -187,9 +188,18 @@ AUTH_USER_MODEL = "dgsi.User" # Internationalization configuration # -> https://docs.djangoproject.com/en/4.2/topics/i18n/ -LANGUAGE_CODE = "fr-fr" +LANGUAGE_CODE = "fr" -TIME_ZONE = "UTC" +LANGUAGES = [ + ("en", "English"), + ("fr", "Français"), +] + +LOCALE_PATHS = [ + (BASE_DIR / "shared" / "locale"), +] + +TIME_ZONE = "Europe/Paris" USE_I18N = True USE_TZ = True diff --git a/src/app/urls.py b/src/app/urls.py index 0e5a90a..c33a36f 100644 --- a/src/app/urls.py +++ b/src/app/urls.py @@ -24,6 +24,7 @@ urlpatterns = [ path("", include("dgsi.urls")), path("accounts/", include("allauth.urls")), path("admin/", admin.site.urls), + path("i18n/", include("django.conf.urls.i18n")), path("__reload__/", include("django_browser_reload.urls")), ] diff --git a/src/shared/locale/en/LC_MESSAGES/django.mo b/src/shared/locale/en/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..6b1f9befecf2385570989679def79d9c2949933e GIT binary patch literal 5262 zcmbuCTWlOx8OKi{P%tf&1SsWFPE&$&@va?{hGgqlNqh+=abjX80R@DPch2rkGCQ-K zGh=6~O0AIKi5FD$CRMb3K`|gC1iV!UX{nHa2P7mU#7z_-R0*{&AQcq>zwgZK#U{MK zXpjFhXXc#m_W!=~`FFc_J)yX2j1MvXa+^{Yz!%@lAFkJTDRmC~J6Hu5-=frgU=F?q zdF8e(Io(3<0sH~m_KMFn%{sMdnyaqml&>3(S zN`4wV1zx>PsmH-9Jim6QQv1O(1WEkU0Y&dGf|#P7ET5kP#n0ab`Kh1qN9_0&DDiv+ zlz89CIo2Ps%Jsb`vp+!_(u8s15o_;V^H*b1r)je0EJh3Q0^=^0gAjEp!oUA zAg)wj2SwlSfD->7f)dYPgYx~KLCKrHfnvvQgovI8LHT|a6g}e-b5Qho1QgzU4Lk+D z2#Wsy1V#Ss7;zIE2QPp>2PZ%cDNlmSAmQ}B2E1(1M`BQA$hUHdujCRNL=UlDczuZR zF^1S8{E_PzLv-$6xJZ41v9FxC7ZjfzW{B=`9c2g)L}$4^&X9PBEpkmW-sJC;s(|7f z%@FSPuW@d0pTER6Q{}z*b&`SUo)a>CgmHi&<>??pa^*Oq#voPvg$oCl-|}Nto&=*LACdq@K5JoN3FCC7n*1p*s2U1B=5&Y^OyolQ5wx*bf} zO523djz?Wna|V&k1fjA^sp`V{RgEq-4Z_S;)m$qHZ^-M&@Qa(dRdb^@)zjWqZwsf{ zx^{WJ-n;3xf6z(tRPWm#gsu~rZfx52fY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+"Last-Translator: Tom Hubrecht \n" +"Language-Team: French\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1)\n" +"X-Generator: Gtranslator 46.1\n" + +#: app/settings.py:276 +msgid "Administration de DGSI" +msgstr "DGSI Administration" + +#: dgsi/forms.py:16 +msgid "Identifiant déjà présent dans la base de données." +msgstr "Username already in the database." + +#: dgsi/forms.py:22 +msgid "Identifiant" +msgstr "Username" + +#: dgsi/forms.py:23 +msgid "De préférence identique au login ENS de la personne concernée" +msgstr "Preferably identical to the ENS login of the person concerned" + +#: dgsi/forms.py:26 dgsi/forms.py:39 +msgid "Nom d'usage" +msgstr "Name in use" + +#: dgsi/forms.py:28 dgsi/forms.py:41 +msgid "Adresse e-mail" +msgstr "E-mail address" + +#: dgsi/forms.py:29 dgsi/forms.py:42 +msgid "De préférence l'adresse '@ens.psl.eu'" +msgstr "Preferably the ‘@ens.psl.eu’ address" + +#: dgsi/forms.py:32 +msgid "Membre actif" +msgstr "Active member" + +#: dgsi/forms.py:33 +msgid "Si selectionné, la personne sera ajoutée au groupe dgnum_members" +msgstr "If selected, the person will be added to the dgnum_members group." + +#: dgsi/models.py:22 +msgid "Nom du service proposé" +msgstr "Name of the proposed service" + +#: dgsi/models.py:23 +msgid "Adresse du service" +msgstr "Address of the service" + +#: dgsi/models.py:24 +msgid "Icône du service" +msgstr "Icon of the service" + +#: dgsi/models.py:34 +msgid "Date du document" +msgstr "Document date" + +#: dgsi/models.py:35 +msgid "Nom du document" +msgstr "Document name" + +#: dgsi/models.py:36 +msgid "Fichier PDF" +msgstr "PDF file" + +#: dgsi/models.py:58 dgsi/models.py:59 +#: dgsi/templates/dgsi/legal_documents.html:26 +msgid "Statuts" +msgstr "Statutes" + +#: dgsi/models.py:71 dgsi/templates/dgsi/legal_documents.html:30 +msgid "Règlement Intérieur" +msgstr "Bylaws" + +#: dgsi/models.py:72 +msgid "Règlements Intérieurs" +msgstr "Bylaws" + +#: dgsi/models.py:114 +msgid "Correspondance de login" +msgstr "Login mapping" + +#: dgsi/models.py:115 +msgid "Correspondances de login" +msgstr "Login mappings" + +#: dgsi/templates/_legal_document.html:9 +msgid "" +" En acceptant, vous assurez avoir lu ce document et en approuver le contenu." +msgstr "" +" By accepting, you confirm that you have read this document and agree with " +"its content." + +#: dgsi/templates/_legal_document.html:15 +msgid "Accepté" +msgstr "Accepted" + +#: dgsi/templates/dgsi/create_kanidm_account.html:6 +msgid "Création de compte Kanidm" +msgstr "Kanidm account creation" + +#: dgsi/templates/dgsi/create_kanidm_account.html:14 +#: dgsi/templates/dgsi/create_self_account.html:14 +msgid "Enregistrer" +msgstr "Save" + +#: dgsi/templates/dgsi/create_self_account.html:6 +msgid "Création d'un compte DGNum" +msgstr "DGNum account creation" + +#: dgsi/templates/dgsi/legal_documents.html:12 +msgid "" +"Vous devez accepter les Statuts et le Règlement Intérieur de la DGNum avant " +"de pouvoir créer un compte." +msgstr "" +"You must accept the DGNum Statutes and Bylaws before you can create an " +"account." + +#: dgsi/templates/dgsi/legal_documents.html:16 +msgid "" +"Vous n'avez pas encore de compte DGNum, mais vous pouvez désormais en créer " +"un." +msgstr "You do not yet have a DGNum account, but you can now create one." + +#: dgsi/templates/dgsi/legal_documents.html:19 +msgid "Poursuivre la création d'un compte DGNum" +msgstr "Continue the creation of a DGNum account" + +#: dgsi/templates/dgsi/legal_documents.html:26 +msgid "Accepter les statuts" +msgstr "Accept the statutes" + +#: dgsi/templates/dgsi/legal_documents.html:30 +msgid "Accepter le règlement intérieur" +msgstr "Accept the bylaws" + +#: dgsi/templates/dgsi/profile.html:7 +#, python-format +msgid "Profil de %(displayname)s" +msgstr "Profile of %(displayname)s" + +#: dgsi/templates/dgsi/profile.html:13 +msgid "Mot de passe WiFi :" +msgstr "WiFi password:" + +#: dgsi/templates/dgsi/profile.html:23 +msgid "Adresse e-mail :" +msgstr "E-mail address:" + +#: dgsi/templates/dgsi/profile.html:28 +msgid "Informations techniques" +msgstr "Technical informations" + +#: dgsi/templates/dgsi/profile.html:31 +msgid "Identifiant unique :" +msgstr "Unique identifier:" + +#: dgsi/templates/dgsi/profile.html:40 +msgid "Membre des groupes suivants :" +msgstr "Member of the following groups:" + +#: dgsi/templates/dgsi/profile.html:51 +msgid "Pas de compte DGNum répertorié." +msgstr "No DGNum account found." + +#: dgsi/templates/dgsi/profile.html:54 +msgid "Créer un compte DGNum" +msgstr "Create a DGNum account" + +#: dgsi/templates/dgsi/service_list.html:6 +msgid "Services accessibles via la DGNum" +msgstr "Services accessible via the DGNum" + +#: dgsi/views.py:30 +msgid "Mon profil" +msgstr "My profile" + +#: dgsi/views.py:31 +msgid "Documents Légaux" +msgstr "Legal Documents" + +#: dgsi/views.py:35 +msgid "Services proposés par la DGNum" +msgstr "Services offered by the DGNum" + +#: dgsi/views.py:44 +msgid "Créer un nouveau compte Kanidm" +msgstr "Create a new Kanidm account" + +#: dgsi/views.py:48 +msgid "Interface d'administration" +msgstr "Administration interface" + +#: dgsi/views.py:83 +msgid "Compte DGNum créé avec succès" +msgstr "DGNum account successfully created" + +#: dgsi/views.py:99 +msgid "Vous possédez déjà un compte DGNum !" +msgstr "You already have a DGNum account!" + +#: dgsi/views.py:111 +msgid "Vous devez accepter les Statuts et le Règlement Intérieur." +msgstr "You must accept the Statutes and the Bylaws." + +#: dgsi/views.py:190 +#, python-format +msgid "Type de document invalide : %(kind)s" +msgstr "Invalid document type: %(kind)s" + +#: dgsi/views.py:220 +#, python-format +msgid "Compte DGNum pour %(displayname)s [%(name)s] créé." +msgstr "DGNum account for %(displayname)s [%(name)s] created." + +#: shared/account.py:37 +msgid "Catégorie de compte ENS interdite." +msgstr "ENS account category not permitted." + +#: shared/account.py:53 +msgid "Méthode de connexion invalide." +msgstr "Invalid connection method." + +#: shared/templates/_footer.html:4 +msgid "" +"Logiciel développé pour et par la DGNum." +msgstr "" +"Software developed for and by the DGNum." + +#: shared/templates/_hero.html:18 +msgid "Déconnexion" +msgstr "Logout" + +#: shared/templates/_hero.html:27 +msgid "Connexion" +msgstr "Login" + +#: shared/templates/_hero.html:41 +msgid "Choix de la langue" +msgstr "Language selection" + +#: shared/templates/accounts/forbidden_category.html:6 +msgid "Connexion impossible" +msgstr "Unable to connect" + +#: shared/templates/accounts/forbidden_category.html:10 +msgid "" +"Vos informations ne permettent pas de vous identifier auprès de la DGNum." +"
Si vous pensez qu'il s'agit une erreur, merci de nous contacter à " +"l'adresse : contact@dgnum.eu" +msgstr "" +"Your details do not allow the DGNum to authenticate you.
If you think " +"this is a mistake, please contact us at: contact@dgnum.eu" diff --git a/src/shared/static/bulma/bulma.scss b/src/shared/static/bulma/bulma.scss index 65676da..1cf47fc 100644 --- a/src/shared/static/bulma/bulma.scss +++ b/src/shared/static/bulma/bulma.scss @@ -62,3 +62,9 @@ body { .notification { margin-bottom: var(--bulma-block-spacing); } + +.dropdown.is-fullwidth, +.dropdown.is-fullwidth > .dropdown-trigger, +.dropdown.is-fullwidth > .dropdown-menu { + width: 100%; +} diff --git a/src/shared/templates/_footer.html b/src/shared/templates/_footer.html index f58de5e..af91d07 100644 --- a/src/shared/templates/_footer.html +++ b/src/shared/templates/_footer.html @@ -1,6 +1,6 @@ -{% load django_browser_reload %} +{% load i18n django_browser_reload %}
- Logiciel développé pour et par la DGNum. + {%blocktrans %}Logiciel développé pour et par la DGNum.{% endblocktrans %} {% django_browser_reload_script %}
diff --git a/src/shared/templates/_hero.html b/src/shared/templates/_hero.html index 9267783..78ba4b7 100644 --- a/src/shared/templates/_hero.html +++ b/src/shared/templates/_hero.html @@ -1,35 +1,67 @@ {% load i18n %}
-
-
-
-
-

- Dossier Général des Services Informagiques -

-

Système d'information de la DGNum

-
-
+
+
+
+

+ Dossier Général des Services Informagiques +

+

Système d'information de la DGNum

+
+
+
{% if user.is_authenticated %} - - - {% trans "Déconnexion" %} - - + + + {% trans "Déconnexion" %} + + + - - + {% else %} - - - {% trans "Connexion" %} - - + + + {% trans "Connexion" %} + + + - - + {% endif %} +