diff --git a/config/config.exs b/config/config.exs index 37f6a25d..d833be2f 100644 --- a/config/config.exs +++ b/config/config.exs @@ -18,6 +18,7 @@ config :mobilizon, :instance, hostname: "localhost", registrations_open: false, registration_email_allowlist: [], + languages: [], demo: false, repository: Mix.Project.config()[:source_url], allow_relay: true, diff --git a/js/src/graphql/admin.ts b/js/src/graphql/admin.ts index 742a2939..b135a001 100644 --- a/js/src/graphql/admin.ts +++ b/js/src/graphql/admin.ts @@ -104,6 +104,15 @@ export const REJECT_RELAY = gql` ${RELAY_FRAGMENT} `; +export const LANGUAGES = gql` + query { + languages { + code + name + } + } +`; + export const ADMIN_SETTINGS_FRAGMENT = gql` fragment adminSettingsFragment on AdminSettings { instanceName @@ -118,6 +127,7 @@ export const ADMIN_SETTINGS_FRAGMENT = gql` instancePrivacyPolicyUrl instanceRules registrationsOpen + instanceLanguages } `; @@ -144,6 +154,7 @@ export const SAVE_ADMIN_SETTINGS = gql` $instancePrivacyPolicyUrl: String $instanceRules: String $registrationsOpen: Boolean + $instanceLanguages: [String] ) { saveAdminSettings( instanceName: $instanceName @@ -158,6 +169,7 @@ export const SAVE_ADMIN_SETTINGS = gql` instancePrivacyPolicyUrl: $instancePrivacyPolicyUrl instanceRules: $instanceRules registrationsOpen: $registrationsOpen + instanceLanguages: $instanceLanguages ) { ...adminSettingsFragment } diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 683513bf..84554377 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -789,5 +789,9 @@ "Congratulations, your account is now created!": "Congratulations, your account is now created!", "Now, create your first profile:": "Now, create your first profile:", "If you have opted for manual validation of participants, Mobilizon will send you an email to inform you of new participations to be processed. You can choose the frequency of these notifications below.": "If you have opted for manual validation of participants, Mobilizon will send you an email to inform you of new participations to be processed. You can choose the frequency of these notifications below.", - "You will be able to add an avatar and set other options in your account settings.": "You will be able to add an avatar and set other options in your account settings." + "You will be able to add an avatar and set other options in your account settings.": "You will be able to add an avatar and set other options in your account settings.", + "Instance languages": "Instance languages", + "Main languages you/your moderators speak": "Main languages you/your moderators speak", + "Select languages": "Select languages", + "No languages found": "No languages found" } diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 882e5db3..2b79d4db 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -388,7 +388,7 @@ "My events": "Mes évènements", "My groups": "Mes groupes", "My identities": "Mes identités", - "NOTE! The default terms have not been checked over by a lawyer and thus are unlikely to provide full legal protection for all situations for an instance admin using them. They are also not specific to all countries and jurisdictions. If you are unsure, please check with a lawyer.": "REMARQUE : les conditions par défaut n'ont pas été vérifiées par un juriste et ne sont donc susceptibles de ne pas offrir une protection juridique complète dans toutes les situations pour un·e administrateur·ice d'instance qui les utilise. Elles ne sont pas non plus spécifiques à tous les pays et juridictions. Si vous n'êtes pas sûr, veuillez consulter un juriste.", + "NOTE! The default terms have not been checked over by a lawyer and thus are unlikely to provide full legal protection for all situations for an instance admin using them. They are also not specific to all countries and jurisdictions. If you are unsure, please check with a lawyer.": "REMARQUE : les conditions par défaut n'ont pas été vérifiées par un·e juriste et ne sont donc susceptibles de ne pas offrir une protection juridique complète dans toutes les situations pour un·e administrateur·ice d'instance qui les utilise. Elles ne sont pas non plus spécifiques à tous les pays et juridictions. Si vous n'êtes pas sûr, veuillez consulter un·e juriste.", "Name": "Nom", "New discussion": "Nouvelle discussion", "New email": "Nouvelle adresse e-mail", @@ -831,5 +831,9 @@ "Congratulations, your account is now created!": "Bravo, votre compte est dorénavant créé !", "Now, create your first profile:": "Maintenant, créez votre premier profil :", "If you have opted for manual validation of participants, Mobilizon will send you an email to inform you of new participations to be processed. You can choose the frequency of these notifications below.": "Si vous avez opté pour la validation manuelle des participantes, Mobilizon vous enverra un email pour vous informer des nouvelles participations à traiter. Vous pouvez choisir la fréquence de ces notifications ci-dessous.", - "You will be able to add an avatar and set other options in your account settings.": "Vous pourrez ajouter un avatar et définir d'autres options dans les paramètres de votre compte." + "You will be able to add an avatar and set other options in your account settings.": "Vous pourrez ajouter un avatar et définir d'autres options dans les paramètres de votre compte.", + "Instance languages": "Langues de l'instance", + "Main languages you/your moderators speak": "Principales langues parlées par vous / vos modérateurs", + "Select languages": "Choisissez une langue", + "No languages found": "Aucune langue trouvée" } diff --git a/js/src/types/admin.model.ts b/js/src/types/admin.model.ts index 6791ec12..cf50a4f3 100644 --- a/js/src/types/admin.model.ts +++ b/js/src/types/admin.model.ts @@ -20,6 +20,11 @@ export enum InstancePrivacyType { CUSTOM = "CUSTOM", } +export interface ILanguage { + code: string; + name: string; +} + export interface IAdminSettings { instanceName: string; instanceDescription: string; @@ -33,4 +38,5 @@ export interface IAdminSettings { instancePrivacyPolicyUrl: string | null; instanceRules: string; registrationsOpen: boolean; + instanceLanguages: string[]; } diff --git a/js/src/views/Admin/Settings.vue b/js/src/views/Admin/Settings.vue index 923782bb..214faa8c 100644 --- a/js/src/views/Admin/Settings.vue +++ b/js/src/views/Admin/Settings.vue @@ -43,6 +43,24 @@
{{ $t("Registration is closed.") }}
+