From a7b423b151b2930fd04ad04ac3c47b384096e2e5 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 17 Dec 2019 18:06:56 +0100 Subject: [PATCH] refactoring i18n keys - admin --- .../controllers/admin/events.js.erb | 42 +-- .../javascripts/controllers/admin/graphs.js | 10 +- .../controllers/admin/open_api_clients.js | 16 +- .../controllers/admin/settings.js.erb | 10 +- .../controllers/admin/statistics.js.erb | 29 +- .../javascripts/controllers/events.js.erb | 26 +- .../javascripts/controllers/machines.js.erb | 38 +- .../javascripts/controllers/spaces.js.erb | 10 +- app/assets/templates/admin/abuses/index.html | 14 +- .../admin/calendar/deleteRecurrent.html | 4 +- .../templates/admin/events/filters.html.erb | 28 +- .../templates/admin/events/index.html.erb | 16 +- .../admin/events/monitoring.html.erb | 38 +- .../templates/admin/events/price_form.html | 14 +- .../templates/admin/events/prices.html.erb | 12 +- .../admin/events/reservations.html.erb | 18 +- .../admin/open_api_clients/index.html.erb | 24 +- .../templates/admin/plans/_form.html.erb | 2 +- .../admin/project_elements/index.html.erb | 18 +- .../admin/project_elements/licences.html.erb | 10 +- .../admin/project_elements/materials.html.erb | 8 +- .../admin/project_elements/themes.html.erb | 8 +- .../templates/admin/settings/about.html | 20 +- .../templates/admin/settings/general.html | 116 +++---- .../templates/admin/settings/home_page.html | 16 +- .../templates/admin/settings/index.html.erb | 22 +- .../templates/admin/settings/privacy.html | 14 +- .../admin/settings/reservations.html | 80 ++--- .../templates/admin/settings/save_policy.html | 12 +- .../admin/statistics/graphs.html.erb | 32 +- .../templates/admin/statistics/index.html.erb | 74 ++-- app/assets/templates/events/_form.html.erb | 54 +-- app/assets/templates/events/edit.html.erb | 4 +- .../modify_event_reservation_modal.html.erb | 8 +- app/assets/templates/events/new.html.erb | 4 +- app/assets/templates/events/show.html.erb | 70 ++-- app/assets/templates/machines/_form.html.erb | 39 +-- app/assets/templates/machines/edit.html.erb | 4 +- app/assets/templates/machines/new.html.erb | 12 +- .../machines/request_training_modal.html.erb | 6 +- .../templates/machines/reserve.html.erb | 4 +- .../training_reservation_modal.html.erb | 8 +- app/assets/templates/shared/_cart.html.erb | 80 ++--- app/assets/templates/shared/leftnav.html.erb | 24 +- app/assets/templates/spaces/_form.html | 36 +- app/assets/templates/spaces/edit.html.erb | 6 +- app/assets/templates/spaces/new.html.erb | 8 +- app/assets/templates/spaces/reserve.html.erb | 4 +- config/locales/app.admin.fr.yml | 324 ++++++++++-------- config/locales/app.logged.fr.yml | 9 +- config/locales/app.public.fr.yml | 15 + config/locales/app.shared.fr.yml | 154 ++++----- 52 files changed, 842 insertions(+), 812 deletions(-) diff --git a/app/assets/javascripts/controllers/admin/events.js.erb b/app/assets/javascripts/controllers/admin/events.js.erb index e2706ce85..303c9c589 100644 --- a/app/assets/javascripts/controllers/admin/events.js.erb +++ b/app/assets/javascripts/controllers/admin/events.js.erb @@ -228,26 +228,26 @@ Application.Controllers.controller('AdminEventsController', ['$scope', '$state', */ $scope.removeElement = function (model, index) { if ((model === 'category') && (getModel(model)[1].length === 1)) { - growl.error(_t('at_least_one_category_is_required') + ' ' + _t('unable_to_delete_the_last_one')); + growl.error(_t('app.admin.events.at_least_one_category_is_required') + ' ' + _t('app.admin.events.unable_to_delete_the_last_one')); return false; } if (getModel(model)[1][index].related_to > 0) { - growl.error(_t('unable_to_delete_ELEMENT_already_in_use_NUMBER_times', { ELEMENT: model, NUMBER: getModel(model)[1][index].related_to })); + growl.error(_t('app.admin.events.unable_to_delete_ELEMENT_already_in_use_NUMBER_times', { ELEMENT: model, NUMBER: getModel(model)[1][index].related_to })); return false; } return dialogs.confirm({ resolve: { object () { return { - title: _t('confirmation_required'), - msg: _t('do_you_really_want_to_delete_this_ELEMENT', { ELEMENT: model }) + title: _t('app.admin.events.confirmation_required'), + msg: _t('app.admin.events.do_you_really_want_to_delete_this_ELEMENT', { ELEMENT: model }) }; } } } , function () { // delete confirmed getModel(model)[0].delete(getModel(model)[1][index], null, function () { getModel(model)[1].splice(index, 1); } - , function () { growl.error(_t('unable_to_delete_an_error_occured')); }); + , function () { growl.error(_t('app.admin.events.unable_to_delete_an_error_occured')); }); }); }; @@ -292,10 +292,10 @@ Application.Controllers.controller('AdminEventsController', ['$scope', '$state', // save the price category to the API PriceCategory.save(p_cat, function (cat) { $scope.priceCategories.push(cat); - return growl.success(_t('price_category_successfully_created')); + return growl.success(_t('app.admin.events.price_category_successfully_created')); } , function (err) { - growl.error(_t('unable_to_add_the_price_category_check_name_already_used')); + growl.error(_t('app.admin.events.unable_to_add_the_price_category_check_name_already_used')); return console.error(err); }); }); @@ -308,7 +308,7 @@ Application.Controllers.controller('AdminEventsController', ['$scope', '$state', */ $scope.editPriceCategory = function (id, index) { if ($scope.priceCategories[index].id !== id) { - return growl.error(_t('unexpected_error_occurred_please_refresh')); + return growl.error(_t('app.admin.events.unexpected_error_occurred_please_refresh')); } else { return $uibModal.open({ templateUrl: '<%= asset_path "admin/events/price_form.html" %>', @@ -320,10 +320,10 @@ Application.Controllers.controller('AdminEventsController', ['$scope', '$state', // update the price category to the API PriceCategory.update({ id }, { price_category: p_cat }, function (cat) { $scope.priceCategories[index] = cat; - return growl.success(_t('price_category_successfully_updated')); + return growl.success(_t('app.admin.events.price_category_successfully_updated')); } , function (err) { - growl.error(_t('unable_to_update_the_price_category')); + growl.error(_t('app.admin.events.unable_to_update_the_price_category')); return console.error(err); }); }); @@ -337,17 +337,17 @@ Application.Controllers.controller('AdminEventsController', ['$scope', '$state', */ $scope.removePriceCategory = function (id, index) { if ($scope.priceCategories[index].id !== id) { - return growl.error(_t('unexpected_error_occurred_please_refresh')); + return growl.error(_t('app.admin.events.unexpected_error_occurred_please_refresh')); } else if ($scope.priceCategories[index].events > 0) { - return growl.error(_t('unable_to_delete_this_price_category_because_it_is_already_used')); + return growl.error(_t('app.admin.events.unable_to_delete_this_price_category_because_it_is_already_used')); } else { return dialogs.confirm( { resolve: { object () { return { - title: _t('confirmation_required'), - msg: _t('do_you_really_want_to_delete_this_price_category') + title: _t('app.admin.events.confirmation_required'), + msg: _t('app.admin.events.do_you_really_want_to_delete_this_price_category') }; } } @@ -356,10 +356,10 @@ Application.Controllers.controller('AdminEventsController', ['$scope', '$state', PriceCategory.remove( { id }, function () { // successfully deleted - growl.success(_t('price_category_successfully_deleted')); + growl.success(_t('app.admin.events.price_category_successfully_deleted')); $scope.priceCategories.splice(index, 1); }, - function () { growl.error(_t('price_category_deletion_failed')); } + function () { growl.error(_t('app.admin.events.price_category_deletion_failed')); } ); } ); @@ -483,11 +483,11 @@ Application.Controllers.controller('NewEventController', ['$scope', '$state', 'C // Possible types of recurrences for an event $scope.recurrenceTypes = [ - { label: _t('none'), value: 'none' }, - { label: _t('every_days'), value: 'day' }, - { label: _t('every_week'), value: 'week' }, - { label: _t('every_month'), value: 'month' }, - { label: _t('every_year'), value: 'year' } + { label: _t('app.admin.events_new.none'), value: 'none' }, + { label: _t('app.admin.events_new.every_days'), value: 'day' }, + { label: _t('app.admin.events_new.every_week'), value: 'week' }, + { label: _t('app.admin.events_new.every_month'), value: 'month' }, + { label: _t('app.admin.events_new.every_year'), value: 'year' } ]; // Using the EventsController diff --git a/app/assets/javascripts/controllers/admin/graphs.js b/app/assets/javascripts/controllers/admin/graphs.js index e0448f35f..3883405e0 100644 --- a/app/assets/javascripts/controllers/admin/graphs.js +++ b/app/assets/javascripts/controllers/admin/graphs.js @@ -25,10 +25,10 @@ Application.Controllers.controller('GraphsController', ['$scope', '$state', '$ro const CHART_HEIGHT = 500; // Label of the charts' horizontal axes - const X_AXIS_LABEL = _t('date'); + const X_AXIS_LABEL = _t('app.admin.stats_graphs.date'); // Label of the charts' vertical axes - const Y_AXIS_LABEL = _t('number'); + const Y_AXIS_LABEL = _t('app.admin.stats_graphs.number'); // Colors for the line charts. Each new line uses the next color in this array const CHART_COLORS = ['#b35a94', '#1c5794', '#00b49e', '#6fac48', '#ebcf4a', '#fd7e33', '#ca3436', '#a26e3a']; @@ -193,9 +193,9 @@ Application.Controllers.controller('GraphsController', ['$scope', '$state', '$ro } } else if ($scope.display.interval === 'week') { if ((typeof x === 'number') || d instanceof Date) { - return d3.time.format(_t('week_short') + ' %U')(moment(d).toDate()); + return d3.time.format(_t('app.admin.stats_graphs.week_short') + ' %U')(moment(d).toDate()); } else if (typeof d === 'number') { - return _t('week_of_START_to_END', { START: moment(d).format('L'), END: moment(d).add(6, 'days').format('L') }); + return _t('app.admin.stats_graphs.week_of_START_to_END', { START: moment(d).format('L'), END: moment(d).add(6, 'days').format('L') }); } else { // typeof d == 'string' return d; } @@ -653,7 +653,7 @@ Application.Controllers.controller('GraphsController', ['$scope', '$state', '$ro // common for each charts chart.margin({ left: 100, right: 100 }); - chart.noData(_t('no_data_for_this_period')); + chart.noData(_t('app.admin.stats_graphs.no_data_for_this_period')); chart.height(CHART_HEIGHT); // add new chart to the page diff --git a/app/assets/javascripts/controllers/admin/open_api_clients.js b/app/assets/javascripts/controllers/admin/open_api_clients.js index 3ded18d15..7a9ef8187 100644 --- a/app/assets/javascripts/controllers/admin/open_api_clients.js +++ b/app/assets/javascripts/controllers/admin/open_api_clients.js @@ -37,12 +37,12 @@ Application.Controllers.controller('OpenAPIClientsController', ['$scope', 'clien if (client.id != null) { OpenAPIClient.update({ id: client.id }, { open_api_client: client }, function (clientResp) { client = clientResp; - return growl.success(_t('client_successfully_updated')); + return growl.success(_t('app.admin.open_api_clients.client_successfully_updated')); }); } else { OpenAPIClient.save({ open_api_client: client }, function (client) { $scope.clients.push(client); - return growl.success(_t('client_successfully_created')); + return growl.success(_t('app.admin.open_api_clients.client_successfully_created')); }); } @@ -61,8 +61,8 @@ Application.Controllers.controller('OpenAPIClientsController', ['$scope', 'clien resolve: { object () { return { - title: _t('confirmation_required'), - msg: _t('do_you_really_want_to_delete_this_open_api_client') + title: _t('app.admin.open_api_clients.confirmation_required'), + msg: _t('app.admin.open_api_clients.do_you_really_want_to_delete_this_open_api_client') }; } } @@ -70,7 +70,7 @@ Application.Controllers.controller('OpenAPIClientsController', ['$scope', 'clien , () => OpenAPIClient.delete({ id: $scope.clients[index].id }, function () { $scope.clients.splice(index, 1); - return growl.success(_t('client_successfully_deleted')); + return growl.success(_t('app.admin.open_api_clients.client_successfully_deleted')); }) ); @@ -79,8 +79,8 @@ Application.Controllers.controller('OpenAPIClientsController', ['$scope', 'clien resolve: { object () { return { - title: _t('confirmation_required'), - msg: _t('do_you_really_want_to_revoke_this_open_api_access') + title: _t('app.admin.open_api_clients.confirmation_required'), + msg: _t('app.admin.open_api_clients.do_you_really_want_to_revoke_this_open_api_access') }; } } @@ -88,7 +88,7 @@ Application.Controllers.controller('OpenAPIClientsController', ['$scope', 'clien , () => OpenAPIClient.resetToken({ id: client.id }, {}, function (clientResp) { client.token = clientResp.token; - return growl.success(_t('access_successfully_revoked')); + return growl.success(_t('app.admin.open_api_clients.access_successfully_revoked')); }) ); } diff --git a/app/assets/javascripts/controllers/admin/settings.js.erb b/app/assets/javascripts/controllers/admin/settings.js.erb index 9be82acea..d16907986 100644 --- a/app/assets/javascripts/controllers/admin/settings.js.erb +++ b/app/assets/javascripts/controllers/admin/settings.js.erb @@ -166,7 +166,7 @@ Application.Controllers.controller('SettingsController', ['$scope', '$filter', ' Setting.update( { name: setting.name }, { value }, - function () { growl.success(_t('settings.customization_of_SETTING_successfully_saved', { SETTING: _t(`settings.${setting.name}`) })); }, + function () { growl.success(_t('app.admin.settings.customization_of_SETTING_successfully_saved', { SETTING: _t(`settings.${setting.name}`) })); }, function (error) { console.log(error); } ); }; @@ -191,7 +191,7 @@ Application.Controllers.controller('SettingsController', ['$scope', '$filter', ' // reset history $scope.privacyDraftsHistory = []; data.setting.history.forEach(function (draft) { - $scope.privacyDraftsHistory.push({ id: draft.id, name: _t('settings.privacy.draft_from_USER_DATE', { USER: draft.user.name, DATE: draft.created_at }), content: draft.value }); + $scope.privacyDraftsHistory.push({ id: draft.id, name: _t('app.admin.settings.privacy.draft_from_USER_DATE', { USER: draft.user.name, DATE: draft.created_at }), content: draft.value }); }); if (type === 'privacy_draft') { const orderedHistory = $filter('orderBy')(data.setting.history, 'created_at'); @@ -219,7 +219,7 @@ Application.Controllers.controller('SettingsController', ['$scope', '$filter', ' angular.forEach(v, function(err) { growl.error(err); }) }); } else { - growl.success(_t('settings.file_successfully_updated')); + growl.success(_t('app.admin.settings.file_successfully_updated')); if (content.custom_asset.name === 'cgu-file') { $scope.cguFile = content.custom_asset; $scope.methods.cgu = 'put'; @@ -316,7 +316,7 @@ Application.Controllers.controller('SettingsController', ['$scope', '$filter', ' } privacyDraftsPromise.setting.history.forEach(function (draft) { - $scope.privacyDraftsHistory.push({ id: draft.id, name: _t('settings.privacy.draft_from_USER_DATE', { USER: draft.user.name, DATE: moment(draft.created_at).format('L LT') }), content: draft.value }); + $scope.privacyDraftsHistory.push({ id: draft.id, name: _t('app.admin.settings.privacy.draft_from_USER_DATE', { USER: draft.user.name, DATE: moment(draft.created_at).format('L LT') }), content: draft.value }); }); }; @@ -347,7 +347,7 @@ Application.Controllers.controller('SavePolicyController', ['$scope', '$uibModal */ $scope.publish = function () { saveCb({ name: 'privacy_body', value: privacyPolicy.bodyTemp }); - growl.info(_t('settings.privacy.users_notified')); + growl.info(_t('app.admin.settings.privacy.users_notified')); $uibModalInstance.close('privacy_body'); }; /** diff --git a/app/assets/javascripts/controllers/admin/statistics.js.erb b/app/assets/javascripts/controllers/admin/statistics.js.erb index d72ff1fca..cb929004b 100644 --- a/app/assets/javascripts/controllers/admin/statistics.js.erb +++ b/app/assets/javascripts/controllers/admin/statistics.js.erb @@ -130,6 +130,13 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state', } }; + /** + * Return a localized name for the given field + */ + $scope.customFieldName = function (field) { + return _t(`app.admin.statistics.${field}`); + } + /** * Callback to open the datepicker (interval start) * @param $event {Object} jQuery event object @@ -215,10 +222,10 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state', */ $scope.formatSex = function (sex) { if (sex === 'male') { - return _t('man'); + return _t('app.admin.statistics.man'); } if (sex === 'female') { - return _t('woman'); + return _t('app.admin.statistics.woman'); } }; @@ -397,7 +404,7 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state', }; /** - * Run the elasticSearch query to retreive the /stats/type aggregations + * Run the elasticSearch query to retrieve the /stats/type aggregations * @param index {String} elasticSearch document type (account|event|machine|project|subscription|training) * @param type {String} statistics type (month|year|booking|hour|user|project) * @param custom {{key:{string}, value:{string}}|null} custom filter property or null to disable this filter @@ -552,17 +559,17 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state', }; /** - * Fullfil the list of available options in the custom filter panel. The list will be based on common + * Fulfill the list of available options in the custom filter panel. The list will be based on common * properties and on index-specific properties (additional_fields) */ var buildCustomFiltersList = function () { $scope.filters = [ - { key: 'date', label: _t('date'), values: ['input_date'] }, - { key: 'userId', label: _t('user_id'), values: ['input_number'] }, - { key: 'gender', label: _t('gender'), values: [{ key: 'male', label: _t('man') }, { key: 'female', label: _t('woman') }] }, - { key: 'age', label: _t('age'), values: ['input_number'] }, - { key: 'subType', label: _t('type'), values: $scope.type.active.subtypes }, - { key: 'ca', label: _t('revenue'), values: ['input_number'] } + { key: 'date', label: _t('app.admin.statistics.date'), values: ['input_date'] }, + { key: 'userId', label: _t('app.admin.statistics.user_id'), values: ['input_number'] }, + { key: 'gender', label: _t('app.admin.statistics.gender'), values: [{ key: 'male', label: _t('app.admin.statistics.man') }, { key: 'female', label: _t('app.admin.statistics.woman') }] }, + { key: 'age', label: _t('app.admin.statistics.age'), values: ['input_number'] }, + { key: 'subType', label: _t('app.admin.statistics.type'), values: $scope.type.active.subtypes }, + { key: 'ca', label: _t('app.admin.statistics.revenue'), values: ['input_number'] } ]; if (!$scope.type.active.simple) { @@ -709,7 +716,7 @@ Application.Controllers.controller('ExportStatisticsController', [ '$scope', '$u Export.status(statusQry).then(function (res) { if (!res.data.exists) { - return growl.success(_t('export_is_running_you_ll_be_notified_when_its_ready')); + return growl.success(_t('app.admin.statistics.export_is_running_you_ll_be_notified_when_its_ready')); } }); diff --git a/app/assets/javascripts/controllers/events.js.erb b/app/assets/javascripts/controllers/events.js.erb index fa70501b1..4844499d1 100644 --- a/app/assets/javascripts/controllers/events.js.erb +++ b/app/assets/javascripts/controllers/events.js.erb @@ -187,8 +187,8 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' resolve: { object () { return { - title: _t('confirmation_required'), - msg: _t('do_you_really_want_to_delete_this_event') + title: _t('app.public.events_show.confirmation_required'), + msg: _t('app.public.events_show.do_you_really_want_to_delete_this_event') }; } } @@ -196,10 +196,10 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' // the admin has confirmed, delete event.$delete(function () { $state.go('app.public.events_list'); - return growl.info(_t('event_successfully_deleted')); + return growl.info(_t('app.public.events_show.event_successfully_deleted')); }, function (error) { console.error(error); - growl.error(_t('unable_to_delete_the_event_because_some_users_alredy_booked_it')); + growl.error(_t('app.public.events_show.unable_to_delete_the_event_because_some_users_alredy_booked_it')); }); } ); @@ -288,7 +288,7 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' const amountToPay = helpers.getAmountToPay($scope.reserve.amountTotal, wallet.amount); if (($scope.currentUser.role !== 'admin') && (amountToPay > 0)) { if ($rootScope.fablabWithoutOnlinePayment) { - growl.error(_t('online_payment_disabled')); + growl.error(_t('app.public.events_show.online_payment_disabled')); } else { return payByStripe(reservation); } @@ -300,7 +300,7 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' }); } else { // otherwise we alert, this error musn't occur when the current user is not admin - return growl.error(_t('please_select_a_member_first')); + return growl.error(_t('app.public.events_show.please_select_a_member_first')); } }; @@ -359,8 +359,8 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' resolve: { object: function() { return { - title: _t('cancel_the_reservation'), - msg: _t('do_you_really_want_to_cancel_this_reservation_this_apply_to_all_booked_tickets') + title: _t('app.public.events_show.cancel_the_reservation'), + msg: _t('app.public.events_show.do_you_really_want_to_cancel_this_reservation_this_apply_to_all_booked_tickets') }; } } @@ -369,12 +369,12 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' id: reservation.slots[0].id }, function() { // successfully canceled let index; - growl.success(_t('reservation_was_successfully_cancelled')); + growl.success(_t('app.public.events_show.reservation_was_successfully_cancelled')); index = $scope.reservations.indexOf(reservation); $scope.event.nb_free_places = $scope.event.nb_free_places + reservation.total_booked_seats; $scope.reservations[index].slots[0].canceled_at = new Date(); }, function(error) { - growl.warning(_t('cancellation_failed')); + growl.warning(_t('app.public.events_show.cancellation_failed')); }); }); }; @@ -750,12 +750,12 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' // Button label if ($scope.amount > 0) { - $scope.validButtonName = _t('confirm_payment_of_html', { ROLE: $scope.currentUser.role, AMOUNT: $filter('currency')($scope.amount) }); + $scope.validButtonName = _t('app.public.events_show.confirm_payment_of_html', { ROLE: $scope.currentUser.role, AMOUNT: $filter('currency')($scope.amount) }); } else { if ((price.price > 0) && ($scope.walletAmount === 0)) { - $scope.validButtonName = _t('confirm_payment_of_html', { ROLE: $scope.currentUser.role, AMOUNT: $filter('currency')(price.price) }); + $scope.validButtonName = _t('app.public.events_show.confirm_payment_of_html', { ROLE: $scope.currentUser.role, AMOUNT: $filter('currency')(price.price) }); } else { - $scope.validButtonName = _t('confirm'); + $scope.validButtonName = _t('app.shared.buttons.confirm'); } } diff --git a/app/assets/javascripts/controllers/machines.js.erb b/app/assets/javascripts/controllers/machines.js.erb index d673ce6a8..733b1dca1 100644 --- a/app/assets/javascripts/controllers/machines.js.erb +++ b/app/assets/javascripts/controllers/machines.js.erb @@ -146,7 +146,7 @@ const _reserveMachine = function (machine, e) { let text = ''; angular.forEach($scope.machine.trainings, function (training) { if (text.length > 0) { - text += _this._t('machines_list._or_the_'); + text += _this._t('app.public.machines_list._or_the_'); } return text += training.name.substr(0, 1).toLowerCase() + training.name.substr(1); }); @@ -281,14 +281,14 @@ Application.Controllers.controller('ShowMachineController', ['$scope', '$state', $scope.delete = function (machine) { // check the permissions if ($scope.currentUser.role !== 'admin') { - console.error(_t('unauthorized_operation')); + console.error(_t('app.public.machines_show.unauthorized_operation')); } else { dialogs.confirm({ resolve: { object () { return { - title: _t('confirmation_required'), - msg: _t('do_you_really_want_to_delete_this_machine') + title: _t('app.public.machines_show.confirmation_required'), + msg: _t('app.public.machines_show.do_you_really_want_to_delete_this_machine') }; } } @@ -297,7 +297,7 @@ Application.Controllers.controller('ShowMachineController', ['$scope', '$state', // delete the machine then redirect to the machines listing machine.$delete( function () { $state.go('app.public.machines_list'); }, - function (error) { growl.warning(_t('the_machine_cant_be_deleted_because_it_is_already_reserved_by_some_users')); console.error(error); } + function (error) { growl.warning(_t('app.public.machines_show.the_machine_cant_be_deleted_because_it_is_already_reserved_by_some_users')); console.error(error); } ); }); } @@ -402,16 +402,16 @@ Application.Controllers.controller('ReserveMachineController', ['$scope', '$stat $scope.machineExplicationsAlert = settingsPromise.machine_explications_alert; /** - * Change the last selected slot's appearence to looks like 'added to cart' + * Change the last selected slot's appearance to looks like 'added to cart' */ $scope.markSlotAsAdded = function () { $scope.selectedEvent.backgroundColor = FREE_SLOT_BORDER_COLOR; - $scope.selectedEvent.title = _t('i_reserve'); + $scope.selectedEvent.title = _t('app.logged.machines_reserve.i_reserve'); return updateCalendar(); }; /** - * Change the last selected slot's appearence to looks like 'never added to cart' + * Change the last selected slot's appearance to looks like 'never added to cart' */ $scope.markSlotAsRemoved = function (slot) { slot.backgroundColor = 'white'; @@ -431,16 +431,16 @@ Application.Controllers.controller('ReserveMachineController', ['$scope', '$stat $scope.slotCancelled = function () { $scope.markSlotAsRemoved($scope.selectedEvent); }; /** - * Change the last selected slot's appearence to looks like 'currently looking for a new destination to exchange' + * Change the last selected slot's appearance to looks like 'currently looking for a new destination to exchange' */ $scope.markSlotAsModifying = function () { $scope.selectedEvent.backgroundColor = '#eee'; - $scope.selectedEvent.title = _t('i_change'); + $scope.selectedEvent.title = _t('app.logged.machines_reserve.i_change'); return updateCalendar(); }; /** - * Change the last selected slot's appearence to looks like 'the slot being exchanged will take this place' + * Change the last selected slot's appearance to looks like 'the slot being exchanged will take this place' */ $scope.changeModifyMachineSlot = function () { if ($scope.events.placable) { @@ -449,7 +449,7 @@ Application.Controllers.controller('ReserveMachineController', ['$scope', '$stat } if (!$scope.events.placable || ($scope.events.placable._id !== $scope.selectedEvent._id)) { $scope.selectedEvent.backgroundColor = '#bbb'; - $scope.selectedEvent.title = _t('i_shift'); + $scope.selectedEvent.title = _t('app.logged.machines_reserve.i_shift'); } return updateCalendar(); }; @@ -458,7 +458,7 @@ Application.Controllers.controller('ReserveMachineController', ['$scope', '$stat * When modifying an already booked reservation, callback when the modification was successfully done. */ $scope.modifyMachineSlot = function () { - $scope.events.placable.title = $scope.currentUser.role !== 'admin' ? _t('i_ve_reserved') : _t('not_available'); + $scope.events.placable.title = $scope.currentUser.role !== 'admin' ? _t('app.logged.machines_reserve.i_ve_reserved') : _t('app.logged.machines_reserve.not_available'); $scope.events.placable.backgroundColor = 'white'; $scope.events.placable.borderColor = $scope.events.modifiable.borderColor; $scope.events.placable.id = $scope.events.modifiable.id; @@ -476,14 +476,14 @@ Application.Controllers.controller('ReserveMachineController', ['$scope', '$stat }; /** - * Cancel the current booking modification, reseting the whole process + * Cancel the current booking modification, resetting the whole process */ $scope.cancelModifyMachineSlot = function () { if ($scope.events.placable) { $scope.events.placable.backgroundColor = 'white'; $scope.events.placable.title = ''; } - $scope.events.modifiable.title = $scope.currentUser.role !== 'admin' ? _t('i_ve_reserved') : _t('not_available'); + $scope.events.modifiable.title = $scope.currentUser.role !== 'admin' ? _t('app.logged.machines_reserve.i_ve_reserved') : _t('app.logged.machines_reserve.not_available'); $scope.events.modifiable.backgroundColor = 'white'; return updateCalendar(); @@ -500,7 +500,7 @@ Application.Controllers.controller('ReserveMachineController', ['$scope', '$stat }; /** - * Changes the user current view from the plan subsription screen to the machine reservation agenda + * Changes the user current view from the plan subscription screen to the machine reservation agenda * @param e {Object} see https://docs.angularjs.org/guide/expression#-event- */ $scope.doNotSubscribePlan = function (e) { @@ -539,11 +539,11 @@ Application.Controllers.controller('ReserveMachineController', ['$scope', '$stat machineSlot.is_reserved = true; machineSlot.can_modify = true; if ($scope.currentUser.role !== 'admin') { - machineSlot.title = _t('i_ve_reserved'); + machineSlot.title = _t('app.logged.machines_reserve.i_ve_reserved'); machineSlot.borderColor = BOOKED_SLOT_BORDER_COLOR; updateMachineSlot(machineSlot, reservation, $scope.currentUser); } else { - machineSlot.title = _t('not_available'); + machineSlot.title = _t('app.logged.machines_reserve.not_available'); machineSlot.borderColor = UNAVAILABLE_SLOT_BORDER_COLOR; updateMachineSlot(machineSlot, reservation, $scope.ctrl.member); } @@ -595,7 +595,7 @@ Application.Controllers.controller('ReserveMachineController', ['$scope', '$stat }; /** - * Triggered when fullCalendar tries to graphicaly render an event block. + * Triggered when fullCalendar tries to graphically render an event block. * Append the event tag into the block, just after the event title. * @see http://fullcalendar.io/docs/event_rendering/eventRender/ */ diff --git a/app/assets/javascripts/controllers/spaces.js.erb b/app/assets/javascripts/controllers/spaces.js.erb index bbbca898b..20db9ea8d 100644 --- a/app/assets/javascripts/controllers/spaces.js.erb +++ b/app/assets/javascripts/controllers/spaces.js.erb @@ -333,7 +333,7 @@ Application.Controllers.controller('ReserveSpaceController', ['$scope', '$stateP */ $scope.markSlotAsModifying = function () { $scope.selectedEvent.backgroundColor = '#eee'; - $scope.selectedEvent.title = _t('space_reserve.i_change'); + $scope.selectedEvent.title = _t('app.logged.space_reserve.i_change'); return updateCalendar(); }; @@ -347,7 +347,7 @@ Application.Controllers.controller('ReserveSpaceController', ['$scope', '$stateP } if (!$scope.events.placable || ($scope.events.placable._id !== $scope.selectedEvent._id)) { $scope.selectedEvent.backgroundColor = '#bbb'; - $scope.selectedEvent.title = _t('space_reserve.i_shift'); + $scope.selectedEvent.title = _t('app.logged.space_reserve.i_shift'); } return updateCalendar(); }; @@ -356,7 +356,7 @@ Application.Controllers.controller('ReserveSpaceController', ['$scope', '$stateP * When modifying an already booked reservation, callback when the modification was successfully done. */ $scope.modifyTrainingSlot = function () { - $scope.events.placable.title = _t('space_reserve.i_ve_reserved'); + $scope.events.placable.title = _t('app.logged.space_reserve.i_ve_reserved'); $scope.events.placable.backgroundColor = 'white'; $scope.events.placable.borderColor = $scope.events.modifiable.borderColor; $scope.events.placable.id = $scope.events.modifiable.id; @@ -382,7 +382,7 @@ Application.Controllers.controller('ReserveSpaceController', ['$scope', '$stateP $scope.events.placable.backgroundColor = 'white'; $scope.events.placable.title = ''; } - $scope.events.modifiable.title = _t('space_reserve.i_ve_reserved'); + $scope.events.modifiable.title = _t('app.logged.space_reserve.i_ve_reserved'); $scope.events.modifiable.backgroundColor = 'white'; return updateCalendar(); @@ -451,7 +451,7 @@ Application.Controllers.controller('ReserveSpaceController', ['$scope', '$stateP angular.forEach($scope.events.paid, function (spaceSlot, key) { spaceSlot.is_reserved = true; spaceSlot.can_modify = true; - spaceSlot.title = _t('space_reserve.i_ve_reserved'); + spaceSlot.title = _t('app.logged.space_reserve.i_ve_reserved'); spaceSlot.backgroundColor = 'white'; spaceSlot.borderColor = RESERVED_SLOT_BORDER_COLOR; return updateSpaceSlotId(spaceSlot, reservation); diff --git a/app/assets/templates/admin/abuses/index.html b/app/assets/templates/admin/abuses/index.html index 05be2c867..7335971c3 100644 --- a/app/assets/templates/admin/abuses/index.html +++ b/app/assets/templates/admin/abuses/index.html @@ -7,7 +7,7 @@
-

{{ 'manage_abuses.abuses_list' }}

+

{{ 'app.admin.manage_abuses.abuses_list' }}

@@ -15,27 +15,27 @@
- {{ 'manage_abuses.no_reports' }} + {{ 'app.admin.manage_abuses.no_reports' }}
  • {{abuse.signaled.name}}, - {{ 'manage_abuses.published_by' }} + {{ 'app.admin.manage_abuses.published_by' }} {{abuse.signaled.author.full_name}}, - {{ 'manage_abuses.at_date' }} + {{ 'app.admin.manage_abuses.at_date' }} {{abuse.signaled.published_at | amDateFormat:'L' }}
    - {{ 'manage_abuses.at_date' }} + {{ 'app.admin.manage_abuses.at_date' }} {{abuse.created_at | amDateFormat:'L' }}, {{abuse.first_name}} {{abuse.last_name}} - {{ 'manage_abuses.has_reported' }} + {{ 'app.admin.manage_abuses.has_reported' }} {{ abuse.message }}
-
\ No newline at end of file + diff --git a/app/assets/templates/admin/calendar/deleteRecurrent.html b/app/assets/templates/admin/calendar/deleteRecurrent.html index 9bc537c43..6d26fe67a 100644 --- a/app/assets/templates/admin/calendar/deleteRecurrent.html +++ b/app/assets/templates/admin/calendar/deleteRecurrent.html @@ -21,6 +21,6 @@ diff --git a/app/assets/templates/admin/events/filters.html.erb b/app/assets/templates/admin/events/filters.html.erb index 7a2e5d130..d5ce9b344 100644 --- a/app/assets/templates/admin/events/filters.html.erb +++ b/app/assets/templates/admin/events/filters.html.erb @@ -1,11 +1,11 @@
-

{{ 'categories' }}

-

{{ 'at_least_one_category_is_required' }}

- +

{{ 'app.admin.events.categories' }}

+

{{ 'app.admin.events.at_least_one_category_is_required' }}

+ - + @@ -28,7 +28,7 @@
{{ 'name' }}{{ 'app.admin.events.name' }}
-

{{ 'themes' }}

- +

{{ 'app.admin.events.themes' }}

+ - + @@ -67,7 +67,7 @@
{{ 'name' }}{{ 'app.admin.events.name' }}
-

{{ 'age_ranges' }}

- +

{{ 'app.admin.events.age_ranges' }}

+ - + @@ -106,7 +106,7 @@
{{ 'name' }}{{ 'app.admin.events.name' }}
-
\ No newline at end of file + diff --git a/app/assets/templates/admin/events/index.html.erb b/app/assets/templates/admin/events/index.html.erb index d4647980b..6632c76ae 100644 --- a/app/assets/templates/admin/events/index.html.erb +++ b/app/assets/templates/admin/events/index.html.erb @@ -7,13 +7,13 @@
-

{{ 'fablab_events' }}

+

{{ 'app.admin.events.fablab_events' }}

- {{ 'add_an_event' }} + {{ 'app.admin.events.add_an_event' }}
@@ -22,16 +22,16 @@
- - + + '"> - - + + '"> - - + + '">
diff --git a/app/assets/templates/admin/events/monitoring.html.erb b/app/assets/templates/admin/events/monitoring.html.erb index f8e094d8b..9fd2d109e 100644 --- a/app/assets/templates/admin/events/monitoring.html.erb +++ b/app/assets/templates/admin/events/monitoring.html.erb @@ -1,18 +1,18 @@
- - - + + + @@ -27,22 +27,22 @@ - {{ 'on_DATE' | translate:{DATE:(event.start_date | amDateFormat:'LL')} }} + {{ 'app.admin.events.on_DATE' | translate:{DATE:(event.start_date | amDateFormat:'LL')} }} - {{ 'from_TIME' | translate:{TIME:(event.start_date | amDateFormat:'LT')} }} - {{ 'to_time' }} + {{ 'app.admin.events.from_TIME' | translate:{TIME:(event.start_date | amDateFormat:'LT')} }} + {{ 'app.admin.events.to_time' }} {{event.end_date | amDateFormat:'LT'}} - {{'from_DATE' | translate:{DATE:(event.start_date | amDateFormat:'LL')} }} - {{'to_date' | translate}} {{event.end_date | amDateFormat:'LL'}} + {{'app.admin.events.from_DATE' | translate:{DATE:(event.start_date | amDateFormat:'LL')} }} + {{'app.admin.events.to_date' | translate}} {{event.end_date | amDateFormat:'LL'}}
- {{ 'from_TIME' | translate:{TIME:(event.start_date | amDateFormat:'LT')} }} - {{ 'to_time' }} + {{ 'app.admin.events.from_TIME' | translate:{TIME:(event.start_date | amDateFormat:'LT')} }} + {{ 'app.admin.events.to_time' }} {{event.end_date | amDateFormat:'LT'}}
@@ -50,17 +50,17 @@ @@ -70,6 +70,6 @@ diff --git a/app/assets/templates/admin/events/price_form.html b/app/assets/templates/admin/events/price_form.html index 2aa84572d..2c1dcb145 100644 --- a/app/assets/templates/admin/events/price_form.html +++ b/app/assets/templates/admin/events/price_form.html @@ -1,6 +1,6 @@ - {{ 'category_name_is_required' }} + {{ 'app.admin.events.category_name_is_required' }} @@ -25,16 +25,16 @@ rows="10" class="form-control" id="conditions" - placeholder="{{ 'enter_here_the_conditions_under_which_this_price_is_applicable' | translate }}" + placeholder="{{ 'app.admin.events.enter_here_the_conditions_under_which_this_price_is_applicable' | translate }}" name="conditions" required> - {{ 'conditions_are_required' }} + {{ 'app.admin.events.conditions_are_required' }} diff --git a/app/assets/templates/admin/events/prices.html.erb b/app/assets/templates/admin/events/prices.html.erb index fcca1229b..bcf00aca2 100644 --- a/app/assets/templates/admin/events/prices.html.erb +++ b/app/assets/templates/admin/events/prices.html.erb @@ -1,12 +1,12 @@
-

{{ 'prices_categories' }}

+

{{ 'app.admin.events.prices_categories' }}

- +
{{ 'title' }}{{ 'dates' }}{{ 'booking' }}{{ 'app.admin.events.title' }}{{ 'app.admin.events.dates' }}{{ 'app.admin.events.booking' }}
{{ event.nb_total_places - event.nb_free_places }} / {{ event.nb_total_places }} - {{ 'cancelled' }} - {{ 'free_entry' }} + {{ 'app.admin.events.cancelled' }} + {{ 'app.admin.events.free_entry' }}
- - + + @@ -17,7 +17,7 @@
{{ 'name' }}{{ 'usages_count' }}{{ 'app.admin.events.name' }}{{ 'app.admin.events.usages_count' }}
-
\ No newline at end of file + diff --git a/app/assets/templates/admin/events/reservations.html.erb b/app/assets/templates/admin/events/reservations.html.erb index 954e23d11..105cd7c72 100644 --- a/app/assets/templates/admin/events/reservations.html.erb +++ b/app/assets/templates/admin/events/reservations.html.erb @@ -7,7 +7,7 @@
-

{{ 'the_reservations' | translate }} {{event.title}}

+

{{ 'app.admin.event_reservations.the_reservations' | translate }} {{event.title}}

@@ -20,9 +20,9 @@ - - - + + + @@ -33,23 +33,23 @@
{{ 'user' }}{{ 'payment_date' }}{{ 'reserved_tickets' }}{{ 'app.admin.event_reservations.user' }}{{ 'app.admin.event_reservations.payment_date' }}{{ 'app.admin.event_reservations.reserved_tickets' }}
{{ reservation.created_at | amDateFormat:'LL LTS' }} - {{ 'full_price_' | translate }} {{reservation.nb_reserve_places}}
+ {{ 'app.admin.event_reservations.full_price_' | translate }} {{reservation.nb_reserve_places}}
{{ticket.event_price_category.price_category.name}} : {{ticket.booked}} -
{{ 'canceled' }}
+
{{ 'app.admin.event_reservations.canceled' }}
-

{{ 'no_reservations_for_now' }}

+

{{ 'app.admin.event_reservations.no_reservations_for_now' }}

- + diff --git a/app/assets/templates/admin/open_api_clients/index.html.erb b/app/assets/templates/admin/open_api_clients/index.html.erb index 8f4e3bf70..4866d812d 100644 --- a/app/assets/templates/admin/open_api_clients/index.html.erb +++ b/app/assets/templates/admin/open_api_clients/index.html.erb @@ -7,7 +7,7 @@
-

{{ 'open_api_clients' }}

+

{{ 'app.admin.open_api_clients.open_api_clients' }}

@@ -15,7 +15,7 @@
  - {{ 'api_documentation' }}  + {{ 'app.admin.open_api_clients.api_documentation' }} 
@@ -28,27 +28,27 @@
- +
- +
- - + +
- + - + - + - + @@ -62,11 +62,11 @@
{{ 'name' | translate }} {{ 'app.admin.open_api_clients.name' | translate }} {{ 'calls_count' | translate }} {{ 'app.admin.open_api_clients.calls_count' | translate }} {{ 'token' | translate }}{{ 'app.admin.open_api_clients.token' | translate }}{{ 'created_at' | translate }} {{ 'app.admin.open_api_clients.created_at' | translate }}
{{ 'app.shared.plan.attach_an_information_sheet' }} - {{ 'change' }}{{ 'app.shared.buttons.change' }} diff --git a/app/assets/templates/admin/project_elements/index.html.erb b/app/assets/templates/admin/project_elements/index.html.erb index 4b9ce21e5..a18d94310 100644 --- a/app/assets/templates/admin/project_elements/index.html.erb +++ b/app/assets/templates/admin/project_elements/index.html.erb @@ -7,12 +7,12 @@
-

{{ 'project_elements.projects_elements_management' }}

+

{{ 'app.admin.project_elements.projects_elements_management' }}

@@ -24,17 +24,17 @@
- - + + '"> - - + + '"> - - + + '">
- \ No newline at end of file + diff --git a/app/assets/templates/admin/project_elements/licences.html.erb b/app/assets/templates/admin/project_elements/licences.html.erb index ac0352d92..afa0f94cf 100644 --- a/app/assets/templates/admin/project_elements/licences.html.erb +++ b/app/assets/templates/admin/project_elements/licences.html.erb @@ -1,10 +1,10 @@ - + - - + + @@ -32,7 +32,7 @@
{{ 'name' }}{{ 'app.admin.project_elements.name' }}
\ No newline at end of file +
diff --git a/app/assets/templates/admin/project_elements/materials.html.erb b/app/assets/templates/admin/project_elements/materials.html.erb index 6ea552964..fb96dc881 100644 --- a/app/assets/templates/admin/project_elements/materials.html.erb +++ b/app/assets/templates/admin/project_elements/materials.html.erb @@ -1,9 +1,9 @@ - + - + @@ -26,7 +26,7 @@
{{ 'name' }}{{ 'app.admin.project_elements.name' }}
\ No newline at end of file + diff --git a/app/assets/templates/admin/project_elements/themes.html.erb b/app/assets/templates/admin/project_elements/themes.html.erb index 0650bb470..0583accb1 100644 --- a/app/assets/templates/admin/project_elements/themes.html.erb +++ b/app/assets/templates/admin/project_elements/themes.html.erb @@ -1,9 +1,9 @@ - + - + @@ -26,7 +26,7 @@
{{ 'name' }}{{ 'app.admin.project_elements.name' }}
\ No newline at end of file + diff --git a/app/assets/templates/admin/settings/about.html b/app/assets/templates/admin/settings/about.html index c58a5c440..b190fa9ff 100644 --- a/app/assets/templates/admin/settings/about.html +++ b/app/assets/templates/admin/settings/about.html @@ -3,34 +3,34 @@
-

- {{ 'settings.shift_enter_to_force_carriage_return' | translate }} - +

+ {{ 'app.admin.settings.shift_enter_to_force_carriage_return' | translate }} +
-
- {{ 'settings.drag_and_drop_to_insert_images' | translate }} - + {{ 'app.admin.settings.drag_and_drop_to_insert_images' | translate }} +
-
- {{ 'settings.shift_enter_to_force_carriage_return' | translate }} - + {{ 'app.admin.settings.shift_enter_to_force_carriage_return' | translate }} +
-
\ No newline at end of file + diff --git a/app/assets/templates/admin/settings/general.html b/app/assets/templates/admin/settings/general.html index f4f9c0514..7fdc8b997 100644 --- a/app/assets/templates/admin/settings/general.html +++ b/app/assets/templates/admin/settings/general.html @@ -1,42 +1,42 @@
- {{ 'settings.title' }} + {{ 'app.admin.settings.title' }}
- +
- +
- +
-

{{ 'settings.title_concordance' }}

+

{{ 'app.admin.settings.title_concordance' }}



- +
@@ -45,62 +45,62 @@
- {{ 'settings.customize_information_messages' }} + {{ 'app.admin.settings.customize_information_messages' }}
-

{{ 'settings.message_of_the_machine_booking_page' }}

+

{{ 'app.admin.settings.message_of_the_machine_booking_page' }}

- +
-

{{ 'settings.warning_message_of_the_training_booking_page'}}

+

{{ 'app.admin.settings.warning_message_of_the_training_booking_page'}}

- +
-

{{ 'settings.information_message_of_the_training_reservation_page'}}

+

{{ 'app.admin.settings.information_message_of_the_training_reservation_page'}}

- +
-

{{ 'settings.message_of_the_subscriptions_page' }}

+

{{ 'app.admin.settings.message_of_the_subscriptions_page' }}

- +
-

{{ 'settings.message_of_the_events_page' }}

+

{{ 'app.admin.settings.message_of_the_events_page' }}

- +
-

{{ 'settings.message_of_the_spaces_page' }}

+

{{ 'app.admin.settings.message_of_the_spaces_page' }}

- +
@@ -108,17 +108,17 @@
- {{ 'settings.legal_documents'}} + {{ 'app.admin.settings.legal_documents'}}
- {{ 'settings.if_these_documents_are_not_filled_no_consent_about_them_will_be_asked_to_the_user' }} + {{ 'app.admin.settings.if_these_documents_are_not_filled_no_consent_about_them_will_be_asked_to_the_user' }}
- +
@@ -135,14 +135,14 @@
- +
- +
@@ -159,7 +159,7 @@
- +
@@ -167,21 +167,21 @@
- {{ 'settings.customize_the_graphics' }} + {{ 'app.admin.settings.customize_the_graphics' }}
- {{ 'settings.for_an_optimal_rendering_the_logo_image_must_be_at_the_PNG_format_with_a_transparent_background_and_with_an_aspect_ratio_3.5_times_wider_than_the_height' }}
- {{ 'settings.concerning_the_favicon_it_must_be_at_ICO_format_with_a_size_of_16x16_pixels' }}
+ {{ 'app.admin.settings.for_an_optimal_rendering_the_logo_image_must_be_at_the_PNG_format_with_a_transparent_background_and_with_an_aspect_ratio_3.5_times_wider_than_the_height' }}
+ {{ 'app.admin.settings.concerning_the_favicon_it_must_be_at_ICO_format_with_a_size_of_16x16_pixels' }}

- {{ 'settings.remember_to_refresh_the_page_for_the_changes_to_take_effect' }} + {{ 'app.admin.settings.remember_to_refresh_the_page_for_the_changes_to_take_effect' }}
-

{{ 'settings.logo_white_background' }}

+

{{ 'app.admin.settings.logo_white_background' }}