diff --git a/config/locales/en.yml b/config/locales/en.yml index 3ea88b281..a28ace25a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -36,6 +36,9 @@ en: errors: <<: *errors + apipie: + api_documentation: "API Documentation" + omniauth: # error messages when importing an account from a SSO email_already_linked_to_another_account_please_input_your_authentication_code: "E-mail address \"%{OLD_MAIL}\" is already linked to another account, please input your authentication code." @@ -225,4 +228,27 @@ en: your_invoice_is_ready_html: "Your invoice #%{REFERENCE}, of %{AMOUNT} is ready. Click here to download." undefined_notification: unknown_notification: "Unknown notification" - notification_ID_wrong_type_TYPE_unknown: "Notification %{ID} wrong (type %{TYPE} unknown)" \ No newline at end of file + notification_ID_wrong_type_TYPE_unknown: "Notification %{ID} wrong (type %{TYPE} unknown)" + + statistics: + # statistics tools for admins + subscriptions: "Subscriptions" + machines_hours: "Machines hours" + trainings: "Trainings" + events: "Events" + registrations: "Registrations" + projects: "Projects" + users: "Users" + training_id: "Training ID" + training_date: "Training Date" + event_id: "Event ID" + event_date: "Event Date" + event_name: "Event Name" + themes: "Themes" + components: "Components" + machines: "Machines" + user_id: "User ID" + bookings: "Bookings" + hours_number: "Hours number" + tickets_number: "Tickets number" + revenue: "Revenue" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 0d787fce2..03a2c8822 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -36,6 +36,9 @@ fr: errors: <<: *errors + apipie: + api_documentation: "Documentation de l'API" + omniauth: # messages d'erreur lors de l'import d'un compte depuis un SSO email_already_linked_to_another_account_please_input_your_authentication_code: "L'adresse de courriel \"%{OLD_MAIL}\" est déjà associée à un compte utilisateur, merci de saisir votre code d'authentification." @@ -225,4 +228,31 @@ fr: your_invoice_is_ready_html: "Votre facture n°%{REFERENCE}, d'un montant de %{AMOUNT}, est prête. Cliquez ici pour la télécharger." undefined_notification: unknown_notification: "Notification inconnue" - notification_ID_wrong_type_TYPE_unknown: "Notification {ID} erronée (type {TYPE} inconnu)." \ No newline at end of file + notification_ID_wrong_type_TYPE_unknown: "Notification {ID} erronée (type {TYPE} inconnu)." + + statistics: + # outil de statistiques pour les administrateurs + subscriptions: "Abonnements" + machines_hours: "Heures machines" + trainings: "Formations" + events: "Évènements" + registrations: "Inscriptions" + projects: "Projets" + users: "Utilisateurs" + training_id: "ID Formation" + training_date: "Date Formation" + event_id: "ID Évènement" + event_date: "Date Évènement" + event_name: "Nom Évènement" + themes: "Thèmes" + components: "Composants" + machines: "Machines" + user_id: "ID Utilisateur" + bookings: "Réservations" + hours_number: "Nombre d'heures" + tickets_number: "Nombre de places" + revenue: "Chiffre d'affaires" + course: "Stage" + workshop: "Atelier" + account_creation: "Création de compte" + project_publication: "Publication de projet" diff --git a/db/seeds.rb b/db/seeds.rb index f4a2c44d1..e52806b80 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -2,13 +2,13 @@ if StatisticIndex.count == 0 StatisticIndex.create!([ - {id:1, es_type_key:'subscription', label:'Abonnements'}, - {id:2, es_type_key:'machine', label:'Heures machines'}, - {id:3, es_type_key:'training', label:'Formations'}, - {id:4, es_type_key:'event', label:'Évènements'}, - {id:5, es_type_key:'account', label:'Inscriptions', ca: false}, - {id:6, es_type_key:'project', label:'Projets', ca: false}, - {id:7, es_type_key:'user', label:'Utilisateurs', table: false, ca: false} + {id:1, es_type_key:'subscription', label:I18n.t('statistics.subscriptions')}, + {id:2, es_type_key:'machine', label:I18n.t('statistics.machines_hours')}, + {id:3, es_type_key:'training', label:I18n.t('statistics.trainings')}, + {id:4, es_type_key:'event', label:I18n.t('statistics.events')}, + {id:5, es_type_key:'account', label:I18n.t('statistics.registrations'), ca: false}, + {id:6, es_type_key:'project', label:I18n.t('statistics.projects'), ca: false}, + {id:7, es_type_key:'user', label:I18n.t('statistics.users'), table: false, ca: false} ]) connection = ActiveRecord::Base.connection if connection.instance_values["config"][:adapter] == 'postgresql' @@ -19,15 +19,15 @@ end if StatisticField.count == 0 StatisticField.create!([ # available data_types : index, number, date, text, list - {key:'trainingId', label:'ID Formation', statistic_index_id: 3, data_type: 'index'}, - {key:'trainingDate', label:'Date Formation', statistic_index_id: 3, data_type: 'date'}, - {key:'eventId', label:'ID Évènement', statistic_index_id: 4, data_type: 'index'}, - {key:'eventDate', label:'Date Évènement', statistic_index_id: 4, data_type: 'date'}, - {key:'themes', label:'Thèmes', statistic_index_id: 6, data_type: 'list'}, - {key:'components', label:'Composants', statistic_index_id: 6, data_type: 'list'}, - {key:'machines', label:'Machines', statistic_index_id: 6, data_type: 'list'}, - {key:'name', label:'Nom Évènement', statistic_index_id: 4, data_type: 'text'}, - {key:'userId', label:'ID Utilisateur', statistic_index_id: 7, data_type: 'index'} + {key:'trainingId', label:I18n.t('statistics.training_id'), statistic_index_id: 3, data_type: 'index'}, + {key:'trainingDate', label:I18n.t('statistics.training_date'), statistic_index_id: 3, data_type: 'date'}, + {key:'eventId', label:I18n.t('statistics.event_id'), statistic_index_id: 4, data_type: 'index'}, + {key:'eventDate', label:I18n.t('statistics.event_date'), statistic_index_id: 4, data_type: 'date'}, + {key:'themes', label:I18n.t('statistics.themes'), statistic_index_id: 6, data_type: 'list'}, + {key:'components', label:I18n.t('statistics.components'), statistic_index_id: 6, data_type: 'list'}, + {key:'machines', label:I18n.t('statistics.machines'), statistic_index_id: 6, data_type: 'list'}, + {key:'name', label:I18n.t('statistics.event_name'), statistic_index_id: 4, data_type: 'text'}, + {key:'userId', label:I18n.t('statistics.user_id'), statistic_index_id: 7, data_type: 'index'} ]) end @@ -41,25 +41,25 @@ end if StatisticType.count == 0 StatisticType.create!([ - {statistic_index_id: 2, key: 'booking', label:'Réservations', graph: true, simple: true}, - {statistic_index_id: 2, key: 'hour', label:"Nombre d'heures", graph: true, simple: false}, - {statistic_index_id: 3, key: 'booking', label:'Réservations', graph: false, simple: true}, - {statistic_index_id: 3, key: 'hour', label:"Nombre d'heures", graph: false, simple: false}, - {statistic_index_id: 4, key: 'booking', label:'Nombre de places', graph: false, simple: false}, - {statistic_index_id: 4, key: 'hour', label:"Nombre d'heures", graph: false, simple: false}, - {statistic_index_id: 5, key: 'member', label:'Utilisateurs', graph: true, simple: true}, - {statistic_index_id: 6, key: 'project', label:'Projets', graph: false, simple: true}, - {statistic_index_id: 7, key: 'revenue', label:"Chiffre d'affaires", graph: false, simple: false} + {statistic_index_id: 2, key: 'booking', label:I18n.t('statistics.bookings'), graph: true, simple: true}, + {statistic_index_id: 2, key: 'hour', label:I18n.t('statistics.hours_number'), graph: true, simple: false}, + {statistic_index_id: 3, key: 'booking', label:I18n.t('statistics.bookings'), graph: false, simple: true}, + {statistic_index_id: 3, key: 'hour', label:I18n.t('statistics.hours_number'), graph: false, simple: false}, + {statistic_index_id: 4, key: 'booking', label:I18n.t('statistics.tickets_number'), graph: false, simple: false}, + {statistic_index_id: 4, key: 'hour', label:I18n.t('statistics.hours_number'), graph: false, simple: false}, + {statistic_index_id: 5, key: 'member', label:I18n.t('statistics.users'), graph: true, simple: true}, + {statistic_index_id: 6, key: 'project', label:I18n.t('statistics.projects'), graph: false, simple: true}, + {statistic_index_id: 7, key: 'revenue', label:I18n.t('statistics.revenue'), graph: false, simple: false} ]) end if StatisticSubType.count == 0 StatisticSubType.create!([ - {key: 'Stage', label:'Stage', statistic_types: StatisticIndex.find_by(es_type_key: 'event').statistic_types}, - {key: 'Atelier', label:'Atelier', statistic_types: StatisticIndex.find_by(es_type_key: 'event').statistic_types}, + {key: 'Stage', label:I18n.t('statistics.course'), statistic_types: StatisticIndex.find_by(es_type_key: 'event').statistic_types}, + {key: 'Atelier', label:I18n.t('statistics.workshop'), statistic_types: StatisticIndex.find_by(es_type_key: 'event').statistic_types}, - {key: 'created', label:'Création de compte', statistic_types: StatisticIndex.find_by(es_type_key: 'account').statistic_types}, - {key: 'published', label:'Publication de projet', statistic_types: StatisticIndex.find_by(es_type_key: 'project').statistic_types} + {key: 'created', label:I18n.t('statistics.account_creation'), statistic_types: StatisticIndex.find_by(es_type_key: 'account').statistic_types}, + {key: 'published', label:I18n.t('statistics.project_publication'), statistic_types: StatisticIndex.find_by(es_type_key: 'project').statistic_types} ]) end