Class: Tolk::LocalesController
Instance Method Summary
collapse
#authenticate, #ensure_no_primary_locale
Instance Method Details
#all ⇒ Object
26
27
28
|
# File 'app/controllers/tolk/locales_controller.rb', line 26
def all
@phrases = @locale.phrases_with_translation(params[:page])
end
|
#create ⇒ Object
35
36
37
38
|
# File 'app/controllers/tolk/locales_controller.rb', line 35
def create
Tolk::Locale.create!(params[:tolk_locale])
redirect_to :action => :index
end
|
#index ⇒ Object
6
7
8
|
# File 'app/controllers/tolk/locales_controller.rb', line 6
def index
@locales = Tolk::Locale.secondary_locales.sort_by(&:language_name)
end
|
#show ⇒ Object
10
11
12
13
14
15
16
17
18
|
# File 'app/controllers/tolk/locales_controller.rb', line 10
def show
respond_to do |format|
format.html do
@phrases = @locale.phrases_without_translation(params[:page])
end
format.atom { @phrases = @locale.phrases_without_translation(params[:page], :per_page => 50) }
format.yaml { render :text => @locale.to_hash.ya2yaml(:syck_compatible => true) }
end
end
|
#update ⇒ Object
20
21
22
23
24
|
# File 'app/controllers/tolk/locales_controller.rb', line 20
def update
@locale.translations_attributes = params[:translations]
@locale.save
redirect_to request.referrer
end
|
#updated ⇒ Object
30
31
32
33
|
# File 'app/controllers/tolk/locales_controller.rb', line 30
def updated
@phrases = @locale.phrases_with_updated_translation(params[:page])
render :all
end
|