Commit 440c598c0f3586d793e73cd9dcd133473b7cfe39
Committed by
Rafael Manzo
1 parent
1e513097
Exists in
colab
and in
4 other branches
Adding translations to controllers
Signed off by: Daniel Alves <danpaulalves@gmail.com>
Showing
8 changed files
with
14 additions
and
14 deletions
Show diff stats
app/controllers/compound_metric_configurations_controller.rb
... | ... | @@ -25,7 +25,7 @@ class CompoundMetricConfigurationsController < BaseMetricConfigurationsControlle |
25 | 25 | respond_to do |format| |
26 | 26 | edit |
27 | 27 | if @compound_metric_configuration.update(metric_configuration_params) |
28 | - format.html { redirect_to kalibro_configuration_path(@compound_metric_configuration.kalibro_configuration_id), notice: 'Compound Metric Configuration was successfully updated.' } | |
28 | + format.html { redirect_to kalibro_configuration_path(@compound_metric_configuration.kalibro_configuration_id), notice: t('successfully_updated', :record => t('Compound' + @compound_metric_configuration.class.name)) } | |
29 | 29 | format.json { head :no_content } |
30 | 30 | else |
31 | 31 | failed_action(format, 'edit') |
... | ... | @@ -59,7 +59,7 @@ class CompoundMetricConfigurationsController < BaseMetricConfigurationsControlle |
59 | 59 | #Code extracted from create action |
60 | 60 | def create_and_redir(format) |
61 | 61 | if @compound_metric_configuration.save |
62 | - format.html { redirect_to kalibro_configuration_path(@compound_metric_configuration.kalibro_configuration_id), notice: 'Compound Metric Configuration was successfully created.' } | |
62 | + format.html { redirect_to kalibro_configuration_path(@compound_metric_configuration.kalibro_configuration_id), notice: t('successfully_created', :record => t('Compound' + @compound_metric_configuration.class.name)) } | |
63 | 63 | else |
64 | 64 | failed_action(format, 'new') |
65 | 65 | end | ... | ... |
app/controllers/kalibro_configurations_controller.rb
... | ... | @@ -80,7 +80,7 @@ class KalibroConfigurationsController < ApplicationController |
80 | 80 | if @kalibro_configuration.save |
81 | 81 | current_user.kalibro_configuration_ownerships.create kalibro_configuration_id: @kalibro_configuration.id |
82 | 82 | |
83 | - format.html { redirect_to kalibro_configuration_path(@kalibro_configuration.id), notice: 'Configuration was successfully created.' } | |
83 | + format.html { redirect_to kalibro_configuration_path(@kalibro_configuration.id), notice: t('successfully_created', :record => t(@kalibro_configuration.class.name)) } | |
84 | 84 | format.json { render action: 'show', status: :created, location: @kalibro_configuration } |
85 | 85 | else |
86 | 86 | format.html { render action: 'new' } | ... | ... |
app/controllers/kalibro_ranges_controller.rb
... | ... | @@ -23,7 +23,7 @@ class KalibroRangesController < ApplicationController |
23 | 23 | def destroy |
24 | 24 | @kalibro_range.destroy |
25 | 25 | respond_to do |format| |
26 | - format_metric_configuration_path(format, "Range was successfully destroyed.") | |
26 | + format_metric_configuration_path(format, t('successfully_destroyed', :record => t(@kalibro_range.class))) | |
27 | 27 | format.json { head :no_content } |
28 | 28 | end |
29 | 29 | end |
... | ... | @@ -36,7 +36,7 @@ class KalibroRangesController < ApplicationController |
36 | 36 | respond_to do |format| |
37 | 37 | @kalibro_range.metric_configuration_id = @metric_configuration_id |
38 | 38 | if @kalibro_range.update(kalibro_range_params) |
39 | - format_metric_configuration_path(format, 'Range was successfully edited.') | |
39 | + format_metric_configuration_path(format, t('successfully_updated', :record => t(@kalibro_range.class))) | |
40 | 40 | format.json { head :no_content } |
41 | 41 | else |
42 | 42 | failed_action(format, 'edit') |
... | ... | @@ -53,7 +53,7 @@ class KalibroRangesController < ApplicationController |
53 | 53 | |
54 | 54 | def create_and_redir(format) |
55 | 55 | if @kalibro_range.save |
56 | - format_metric_configuration_path(format, 'Range was successfully created.') | |
56 | + format_metric_configuration_path(format, t('successfully_created', :record => t(@kalibro_range.class))) | |
57 | 57 | else |
58 | 58 | failed_action(format, 'new') |
59 | 59 | end | ... | ... |
app/controllers/metric_configurations_controller.rb
... | ... | @@ -29,7 +29,7 @@ class MetricConfigurationsController < BaseMetricConfigurationsController |
29 | 29 | respond_to do |format| |
30 | 30 | @metric_configuration.kalibro_configuration_id = params[:kalibro_configuration_id] |
31 | 31 | if @metric_configuration.update(metric_configuration_params) |
32 | - format.html { redirect_to(kalibro_configuration_path(@metric_configuration.kalibro_configuration_id), notice: 'Metric Configuration was successfully updated.') } | |
32 | + format.html { redirect_to(kalibro_configuration_path(@metric_configuration.kalibro_configuration_id), notice: t('successfully_updated', :record => t(metric_configuration.class))) } | |
33 | 33 | format.json { head :no_content } |
34 | 34 | Rails.cache.delete("#{@metric_configuration.kalibro_configuration_id}_metric_configurations") |
35 | 35 | else |
... | ... | @@ -71,7 +71,7 @@ class MetricConfigurationsController < BaseMetricConfigurationsController |
71 | 71 | #Code extracted from create action |
72 | 72 | def create_and_redir(format) |
73 | 73 | if @metric_configuration.save |
74 | - format.html { redirect_to kalibro_configuration_path(@metric_configuration.kalibro_configuration_id), notice: 'Metric Configuration was successfully created.' } | |
74 | + format.html { redirect_to kalibro_configuration_path(@metric_configuration.kalibro_configuration_id), notice: t('successfully_created', :record => t(metric_configuration.class)) } | |
75 | 75 | else |
76 | 76 | failed_action(format, 'new') |
77 | 77 | end | ... | ... |
app/controllers/projects_controller.rb
... | ... | @@ -79,7 +79,7 @@ class ProjectsController < ApplicationController |
79 | 79 | def create_and_redir(format) |
80 | 80 | if @project.save |
81 | 81 | current_user.project_attributes.create(project_id: @project.id) |
82 | - format.html { redirect_to project_path(@project.id), notice: 'Project was successfully created.' } | |
82 | + format.html { redirect_to project_path(@project.id), notice: t('successfully_created', :record => t(@project.class.name)) } | |
83 | 83 | format.json { render action: 'show', status: :created, location: @project } |
84 | 84 | else |
85 | 85 | format.html { render action: 'new' } | ... | ... |
app/controllers/reading_groups_controller.rb
... | ... | @@ -71,7 +71,7 @@ class ReadingGroupsController < ApplicationController |
71 | 71 | if @reading_group.save |
72 | 72 | current_user.reading_group_ownerships.create reading_group_id: @reading_group.id |
73 | 73 | |
74 | - format.html { redirect_to reading_group_path(@reading_group.id), notice: 'Reading Group was successfully created.' } | |
74 | + format.html { redirect_to reading_group_path(@reading_group.id), notice: t('successfully_created', :record => t(@reading_group.class)) } | |
75 | 75 | format.json { render action: 'show', status: :created, location: @reading_group } |
76 | 76 | else |
77 | 77 | format.html { render action: 'new' } | ... | ... |
app/controllers/readings_controller.rb
... | ... | @@ -28,7 +28,7 @@ class ReadingsController < ApplicationController |
28 | 28 | def update |
29 | 29 | respond_to do |format| |
30 | 30 | if @reading.update(reading_params) |
31 | - format.html { redirect_to(reading_group_path(@reading.reading_group_id), notice: 'Reading was successfully updated.') } | |
31 | + format.html { redirect_to(reading_group_path(@reading.reading_group_id), notice: t('successfully_updated', :record => t(@reading.class))) } | |
32 | 32 | format.json { head :no_content } |
33 | 33 | else |
34 | 34 | failed_action(format, 'edit') |
... | ... | @@ -63,7 +63,7 @@ class ReadingsController < ApplicationController |
63 | 63 | # Code extracted from create action |
64 | 64 | def create_and_redir(format) |
65 | 65 | if @reading.save |
66 | - format.html { redirect_to reading_group_path(@reading.reading_group_id), notice: 'Reading was successfully created.' } | |
66 | + format.html { redirect_to reading_group_path(@reading.reading_group_id), notice: t('successfully_created', :record => t(@reading.class)) } | |
67 | 67 | else |
68 | 68 | @reading_group_id = params[:reading_group_id] |
69 | 69 | failed_action(format, 'new') | ... | ... |
app/controllers/repositories_controller.rb
... | ... | @@ -43,7 +43,7 @@ class RepositoriesController < ApplicationController |
43 | 43 | def update |
44 | 44 | respond_to do |format| |
45 | 45 | if @repository.update(repository_params) |
46 | - format.html { redirect_to(project_repository_path(params[:project_id], @repository.id), notice: 'Repository was successfully updated.') } | |
46 | + format.html { redirect_to(project_repository_path(params[:project_id], @repository.id), notice: t('successfully_updated', :record => t(@repository.class))) } | |
47 | 47 | format.json { head :no_content } |
48 | 48 | else |
49 | 49 | failed_action(format, 'edit') |
... | ... | @@ -118,7 +118,7 @@ private |
118 | 118 | # Code extracted from create action |
119 | 119 | def create_and_redir(format) |
120 | 120 | if @repository.save |
121 | - format.html { redirect_to project_repository_process_path(@repository.project_id, @repository.id), notice: 'Repository was successfully created.' } | |
121 | + format.html { redirect_to project_repository_process_path(@repository.project_id, @repository.id), notice: t('successfully_created', :record => t(@repository.class)) } | |
122 | 122 | else |
123 | 123 | failed_action(format, 'new') |
124 | 124 | end | ... | ... |