trabajo-afectivo/app/controllers/translations_controller.rb

47 lines
1,013 B
Ruby
Raw Normal View History

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
2012-05-18 14:24:00 +00:00
class TranslationsController < ApplicationController
prepend_before_action -> { authentication_check && authorize! }, except: [:lang]
2012-05-18 14:24:00 +00:00
# GET /translations/lang/:locale
def lang
render json: Translation.lang(params[:locale])
2012-05-18 14:24:00 +00:00
end
2015-06-28 00:16:47 +00:00
# POST /translations/reset
def reset
Translation.reset(params[:locale])
render json: { message: 'ok' }, status: :ok
end
# GET /translations/admin/lang/:locale
def admin
render json: Translation.lang(params[:locale], true)
end
2012-05-18 14:24:00 +00:00
# GET /translations
def index
model_index_render(Translation, params)
2012-05-18 14:24:00 +00:00
end
# GET /translations/1
def show
model_show_render(Translation, params)
2012-05-18 14:24:00 +00:00
end
# POST /translations
def create
model_create_render(Translation, params)
2012-05-18 14:24:00 +00:00
end
# PUT /translations/1
def update
model_update_render(Translation, params)
2012-05-18 14:24:00 +00:00
end
# DELETE /translations/1
def destroy
model_destroy_render(Translation, params)
2012-05-18 14:24:00 +00:00
end
end