mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
add tolk to Tracks for easy management of translations. Limited to development
environment only. Need migration. Signed-off-by: Reinier Balt <lrbalt@gmail.com>
This commit is contained in:
parent
a37d10f57a
commit
702c89e754
11 changed files with 5731 additions and 5711 deletions
20
Gemfile
20
Gemfile
|
|
@ -24,19 +24,19 @@ gem "rails_autolink"
|
|||
# Gems used only for assets and not required
|
||||
# in production environments by default.
|
||||
group :assets do
|
||||
gem 'sass-rails', '~> 3.2.3'
|
||||
gem 'coffee-rails', '~> 3.2.1'
|
||||
gem 'sass-rails'
|
||||
gem 'coffee-rails'
|
||||
|
||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||
gem 'therubyracer', :platform => :ruby
|
||||
|
||||
gem 'uglifier', '>= 1.0.3'
|
||||
gem 'uglifier'
|
||||
end
|
||||
|
||||
gem 'jquery-rails'
|
||||
|
||||
# To use ActiveModel has_secure_password
|
||||
gem 'bcrypt-ruby', '~> 3.0.0'
|
||||
gem 'bcrypt-ruby'
|
||||
|
||||
# To use Jbuilder templates for JSON
|
||||
# gem 'jbuilder'
|
||||
|
|
@ -50,22 +50,16 @@ gem 'bcrypt-ruby', '~> 3.0.0'
|
|||
group :development do
|
||||
if RUBY_VERSION.to_f >= 1.9
|
||||
# gem "ruby-debug19", :require => 'ruby-debug'
|
||||
gem "mongrel", "1.2.0.pre2"
|
||||
gem "mongrel", ">=1.2.0.pre2"
|
||||
else
|
||||
gem "ruby-debug"
|
||||
gem "mongrel"
|
||||
end
|
||||
gem "yard"
|
||||
gem "tolk"
|
||||
end
|
||||
|
||||
group :test do
|
||||
# gem "test-unit", "1.2.3"
|
||||
# gem "flexmock"
|
||||
# gem "ZenTest", ">=4.0.0"
|
||||
# gem "hpricot"
|
||||
# gem "hoe"
|
||||
# gem "rspec-rails", "~>1.3.3"
|
||||
# gem 'memory_test_fix', '~>0.1.3'
|
||||
gem "factory_girl_rails"
|
||||
gem "capybara"
|
||||
gem "selenium-webdriver" # Note that > 2.14 has problems: https://code.google.com/p/selenium/issues/detail?id=3075
|
||||
|
|
@ -79,4 +73,4 @@ group :test do
|
|||
# uncomment to be able to make screenshots from scenarios
|
||||
#gem "capybara-screenshot"
|
||||
#gem "launchy"
|
||||
end
|
||||
end
|
||||
37
Gemfile.lock
37
Gemfile.lock
|
|
@ -94,7 +94,7 @@ GEM
|
|||
thor (~> 0.14)
|
||||
json (1.7.3)
|
||||
libv8 (3.3.10.4)
|
||||
libwebsocket (0.1.3)
|
||||
libwebsocket (0.1.4)
|
||||
addressable
|
||||
mail (2.4.4)
|
||||
i18n (>= 0.4.0)
|
||||
|
|
@ -135,18 +135,18 @@ GEM
|
|||
rake (0.9.2.2)
|
||||
rdoc (3.12)
|
||||
json (~> 1.4)
|
||||
rspec (2.10.0)
|
||||
rspec-core (~> 2.10.0)
|
||||
rspec-expectations (~> 2.10.0)
|
||||
rspec-mocks (~> 2.10.0)
|
||||
rspec-core (2.10.1)
|
||||
rspec-expectations (2.10.0)
|
||||
rspec (2.11.0)
|
||||
rspec-core (~> 2.11.0)
|
||||
rspec-expectations (~> 2.11.0)
|
||||
rspec-mocks (~> 2.11.0)
|
||||
rspec-core (2.11.0)
|
||||
rspec-expectations (2.11.1)
|
||||
diff-lcs (~> 1.1.3)
|
||||
rspec-mocks (2.10.1)
|
||||
rspec-mocks (2.11.1)
|
||||
rubyzip (0.9.9)
|
||||
sanitize (2.0.3)
|
||||
nokogiri (>= 1.4.4, < 1.6)
|
||||
sass (3.1.19)
|
||||
sass (3.1.20)
|
||||
sass-rails (3.2.5)
|
||||
railties (~> 3.2.0)
|
||||
sass (>= 3.1.10)
|
||||
|
|
@ -166,18 +166,22 @@ GEM
|
|||
rails (>= 3.1)
|
||||
therubyracer (0.10.1)
|
||||
libv8 (~> 3.3.10)
|
||||
thor (0.15.3)
|
||||
thor (0.15.4)
|
||||
tilt (1.3.3)
|
||||
tolk (1.3.1)
|
||||
will_paginate
|
||||
ya2yaml (~> 0.26)
|
||||
treetop (1.4.10)
|
||||
polyglot
|
||||
polyglot (>= 0.3.1)
|
||||
tzinfo (0.3.33)
|
||||
uglifier (1.2.5)
|
||||
uglifier (1.2.6)
|
||||
execjs (>= 0.3.0)
|
||||
multi_json (~> 1.3)
|
||||
will_paginate (3.0.3)
|
||||
xpath (0.1.4)
|
||||
nokogiri (~> 1.3)
|
||||
ya2yaml (0.31)
|
||||
yard (0.8.2.1)
|
||||
|
||||
PLATFORMS
|
||||
|
|
@ -188,25 +192,26 @@ DEPENDENCIES
|
|||
aasm
|
||||
acts_as_list
|
||||
aruba
|
||||
bcrypt-ruby (~> 3.0.0)
|
||||
bcrypt-ruby
|
||||
capybara
|
||||
coffee-rails (~> 3.2.1)
|
||||
coffee-rails
|
||||
cucumber-rails
|
||||
database_cleaner
|
||||
factory_girl_rails
|
||||
formatize
|
||||
htmlentities
|
||||
jquery-rails
|
||||
mongrel (= 1.2.0.pre2)
|
||||
mongrel (>= 1.2.0.pre2)
|
||||
mysql2
|
||||
rails
|
||||
rails_autolink
|
||||
sanitize
|
||||
sass-rails (~> 3.2.3)
|
||||
sass-rails
|
||||
selenium-webdriver
|
||||
sqlite3
|
||||
swf_fu
|
||||
therubyracer
|
||||
uglifier (>= 1.0.3)
|
||||
tolk
|
||||
uglifier
|
||||
will_paginate
|
||||
yard
|
||||
|
|
|
|||
14
config/initializers/tolk.rb
Normal file
14
config/initializers/tolk.rb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# encoding: utf-8
|
||||
|
||||
# Tolk config file. Generated on July 18, 2012 13:01
|
||||
# See github.com/tolk/tolk for more informations
|
||||
|
||||
if Rails.env==:development
|
||||
Tolk.config do |config|
|
||||
|
||||
# If you need to add a mapping do it like this :
|
||||
# May we suggest you use http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
|
||||
# config.mapping["fr-ES"] = 'Frañol !'
|
||||
|
||||
end
|
||||
end
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,4 +1,6 @@
|
|||
Tracksapp::Application.routes.draw do
|
||||
mount Tolk::Engine => '/tolk', :as => 'tolk' if Rails.env=='development'
|
||||
|
||||
root :to => 'todos#index'
|
||||
|
||||
match 'login' => 'login#login'
|
||||
|
|
|
|||
38
db/migrate/20120718110127_create_tolk_tables.rb
Normal file
38
db/migrate/20120718110127_create_tolk_tables.rb
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
class CreateTolkTables < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :tolk_locales do |t|
|
||||
t.string :name
|
||||
t.datetime :created_at
|
||||
t.datetime :updated_at
|
||||
end
|
||||
|
||||
add_index :tolk_locales, :name, :unique => true
|
||||
|
||||
create_table :tolk_phrases do |t|
|
||||
t.text :key
|
||||
t.datetime :created_at
|
||||
t.datetime :updated_at
|
||||
end
|
||||
|
||||
create_table :tolk_translations do |t|
|
||||
t.integer :phrase_id
|
||||
t.integer :locale_id
|
||||
t.text :text
|
||||
t.text :previous_text
|
||||
t.boolean :primary_updated, :default => false
|
||||
t.datetime :created_at
|
||||
t.datetime :updated_at
|
||||
end
|
||||
|
||||
add_index :tolk_translations, [:phrase_id, :locale_id], :unique => true
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_index :tolk_translations, :column => [:phrase_id, :locale_id]
|
||||
remove_index :tolk_locales, :column => :name
|
||||
|
||||
drop_table :tolk_translations
|
||||
drop_table :tolk_phrases
|
||||
drop_table :tolk_locales
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue