2012-05-18 14:24:00 +00:00
|
|
|
class TranslationsController < ApplicationController
|
|
|
|
before_filter :authentication_check, :except => [:load]
|
|
|
|
|
|
|
|
# GET /translations/:lang
|
|
|
|
def load
|
|
|
|
translations = Translation.where( :locale => params[:locale] )
|
|
|
|
|
|
|
|
list = []
|
|
|
|
translations.each { |item|
|
|
|
|
data = [
|
|
|
|
item.id,
|
|
|
|
item.source,
|
|
|
|
item.target,
|
|
|
|
]
|
|
|
|
list.push data
|
|
|
|
}
|
|
|
|
|
2012-09-25 06:20:52 +00:00
|
|
|
render :json => {
|
|
|
|
:list => list,
|
|
|
|
:timestampFormat => 'dd.mm.yyyy HH:MM',
|
|
|
|
}
|
2012-05-18 14:24:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# GET /translations
|
|
|
|
def index
|
2012-09-20 12:08:02 +00:00
|
|
|
model_index_render(Translation, params)
|
2012-05-18 14:24:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# GET /translations/1
|
|
|
|
def show
|
2012-09-20 12:08:02 +00:00
|
|
|
model_show_render(Translation, params)
|
2012-05-18 14:24:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# POST /translations
|
|
|
|
def create
|
2012-09-20 12:08:02 +00:00
|
|
|
model_create_render(Translation, params)
|
2012-05-18 14:24:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# PUT /translations/1
|
|
|
|
def update
|
2012-09-20 12:08:02 +00:00
|
|
|
model_update_render(Translation, params)
|
2012-05-18 14:24:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# DELETE /translations/1
|
|
|
|
def destroy
|
2012-09-20 12:08:02 +00:00
|
|
|
model_destory_render(Translation, params)
|
2012-05-18 14:24:00 +00:00
|
|
|
end
|
|
|
|
end
|