Skip to content

Commit

Permalink
localized messages
Browse files Browse the repository at this point in the history
  • Loading branch information
nutso committed Dec 21, 2013
1 parent 242dd05 commit e97b6bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/recurring_tasks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def new
def create
@recurring_task = RecurringTask.new(params[:recurring_task])
if @recurring_task.save
flash[:notice] = "Created recurring task" # TODO localize
flash[:notice] = l(:recurring_task_created)
redirect_to :action => :show, :id => @recurring_task.id
else
logger.debug "Could not create recurring task from #{params[:post]}"
Expand All @@ -36,7 +36,7 @@ def edit
# saves the task and redirects to show
def update
if @recurring_task.update_attributes(params[:recurring_task])
flash[:notice] = 'Recurring task saved.' # TODO localize
flash[:notice] = l(:recurring_task_saved)
redirect_to :action => :show
else
logger.debug "Could not save recurring task #{@recurring_task}"
Expand All @@ -46,10 +46,10 @@ def update

def destroy
if @recurring_task.destroy
flash[:notice] = 'Recurrence removed.' # TODO localize
flash[:notice] = l(:recurring_task_removed)
redirect_to :action => :index
else
flash[:notice] = 'Could not remove recurrence.' # TODO localize
flash[:notice] = l(:error_recurring_task_could_not_remove)
redirect_to :action => :show, :id => @recurring_task
end
end
Expand Down
5 changes: 5 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ en:

error_invalid_interval: "Interval provided is invalid."
error_recurring_task_not_found: "Could not find recurring task. "
error_recurring_task_could_not_remove: "Could not remove recurrence from task. "

field_interval_unit: "Interval Unit(s)"
field_fixed_schedule: "Fixed Schedule?"
Expand All @@ -24,3 +25,7 @@ en:
interval_week: "week"
interval_month: "month"
interval_year: "year"

recurring_task_created: "Created recurring task. "
recurring_task_saved: "Recurring task saved. "
recurring_task_removed: "Removed recurring task. "

0 comments on commit e97b6bb

Please sign in to comment.