-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2613148
commit a585ac8
Showing
10 changed files
with
41 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 16 additions & 2 deletions
18
app/views/go_translate_yourself/site_translations/edit.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
<% @keys.each do |key| %> | ||
<%= key %> | ||
<%= form_tag update_site_translations_path, :method => :post do %> | ||
<table> | ||
<% @keys.each do |key| %> | ||
<tr> | ||
<td> | ||
<%= key %> | ||
</td> | ||
<% @locales.each do |locale| %> | ||
<td> | ||
<%= text_field_tag "translations[#{locale}.#{key}]", GoTranslateYourself.current_store["#{locale}.#{key}"] %> | ||
</td> | ||
<% end %> | ||
</tr> | ||
<% end %> | ||
</table> | ||
<%= submit_tag "Save" %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
Rails.application.routes.draw do | ||
match 'site_translations' => 'GoTranslateYourself::SiteTranslations#edit', :as => :site_translations | ||
match 'site_translations' => 'GoTranslateYourself::SiteTranslations#edit', :as => :site_translations, :method => :get | ||
match 'site_translations/save' => 'GoTranslateYourself::SiteTranslations#update', :as => :update_site_translations, :method => :post | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
class ApplicationController < ActionController::Base | ||
before_filter :set_locale | ||
protect_from_forgery | ||
|
||
def set_locale | ||
I18n.locale = params[:locale] || :en | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
GoTranslateYourself.current_store = GoTranslateYourself::MongoStore.new(Mongo::Connection.new.db("go_translate_yourself_test").collection("translations")) | ||
GoTranslateYourself.locales = [:pl, :de] | ||
|
||
I18n.backend = I18n::Backend::KeyValue.new GoTranslateYourself.current_store |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.