translation_center 1.7.2 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +38 -2
- data/Rakefile +8 -13
- data/app/assets/javascripts/translation_center/application.js +1 -1
- data/app/assets/stylesheets/translation_center/application.css +1 -1
- data/app/assets/stylesheets/translation_center/translation_keys.css +3 -1
- data/app/controllers/translation_center/application_controller.rb +2 -2
- data/app/controllers/translation_center/translation_keys_controller.rb +4 -4
- data/app/models/translation_center/activity_query.rb +2 -3
- data/app/models/translation_center/category.rb +7 -2
- data/app/models/translation_center/translation.rb +54 -32
- data/app/models/translation_center/translation_key.rb +29 -18
- data/app/views/layouts/translation_center/application.html.haml +0 -2
- data/app/views/translation_center/translation_keys/_translation_keys.html.haml +3 -1
- data/app/views/translation_center/translations/_show.html.haml +3 -3
- data/config/routes.rb +3 -3
- data/db/development.sqlite3 +0 -0
- data/{test/dummy/db/migrate/20130410082611_devise_create_users.rb → db/migrate/20130410082600_devise_create_users.rb} +0 -0
- data/{test/dummy/db/migrate/20130410082701_create_articles.rb → db/migrate/20130410082601_create_articles.rb} +0 -0
- data/{test/dummy/db/migrate/20130410084711234392_create_translation_center_categories.rb → db/migrate/20130410084602_create_translation_center_categories.rb} +0 -0
- data/{test/dummy/db/migrate/20130410084711235054_create_translation_center_translation_keys.rb → db/migrate/20130410084603_create_translation_center_translation_keys.rb} +0 -0
- data/{test/dummy/db/migrate/20130410084711235601_create_translation_center_translations.rb → db/migrate/20130410084604_create_translation_center_translations.rb} +0 -0
- data/{test/dummy/db/migrate/20130410084711_acts_as_votable_migration.rb → db/migrate/20130410084605_acts_as_votable_migration.rb} +1 -0
- data/{test/dummy/db/migrate/20130410084711235602_install_audited.rb → db/migrate/20130410084606_install_audited.rb} +0 -0
- data/{test/dummy/db/migrate/20130410113111070575_add_de_status_translation_center_translation_keys.rb → db/migrate/20130410113607_add_de_status_translation_center_translation_keys.rb} +0 -0
- data/{test/dummy/db/migrate/20130417134539377014_add_ar_status_translation_center_translation_keys.rb → db/migrate/20130417134608_add_ar_status_translation_center_translation_keys.rb} +0 -0
- data/{test/dummy/db/migrate/20130506103956_fix_translation_user_relation.rb → db/migrate/20130506103609_fix_translation_user_relation.rb} +0 -0
- data/{test/dummy/db/migrate/20130801102022_add_indicies.rb → db/migrate/20130801102610_add_indicies.rb} +0 -0
- data/{test/dummy/db → db}/schema.rb +13 -13
- data/{test/dummy/public/favicon.ico → db/test.sqlite3} +0 -0
- data/lib/generators/translation_center/add_lang/add_lang_generator.rb +5 -2
- data/lib/generators/translation_center/install/install_generator.rb +4 -4
- data/lib/translation_center/acts_as_translator.rb +1 -1
- data/lib/translation_center/engine.rb +7 -0
- data/lib/translation_center/translation_helpers.rb +1 -1
- data/lib/translation_center/translations_transfer.rb +6 -5
- data/lib/translation_center/version.rb +1 -1
- data/spec/controllers/categories_controller_spec.rb +47 -0
- data/spec/controllers/center_controller_spec.rb +77 -0
- data/spec/controllers/translation_keys_controller_spec.rb +87 -0
- data/spec/controllers/translations_controller_spec.rb +70 -0
- data/{test → spec}/dummy/README.rdoc +0 -0
- data/{test → spec}/dummy/Rakefile +0 -0
- data/{test → spec}/dummy/app/assets/javascripts/application.js +0 -1
- data/{test → spec}/dummy/app/assets/stylesheets/application.css +0 -1
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/{test → spec}/dummy/app/helpers/application_helper.rb +0 -0
- data/{test → spec}/dummy/app/models/user.rb +2 -5
- data/{test → spec}/dummy/app/views/layouts/application.html.erb +0 -1
- data/{test → spec}/dummy/config.ru +0 -0
- data/{test → spec}/dummy/config/application.rb +10 -5
- data/{test → spec}/dummy/config/boot.rb +0 -0
- data/spec/dummy/config/database.yml +25 -0
- data/{test → spec}/dummy/config/environment.rb +2 -0
- data/{test → spec}/dummy/config/environments/development.rb +0 -0
- data/{test → spec}/dummy/config/environments/production.rb +0 -0
- data/{test → spec}/dummy/config/environments/test.rb +2 -2
- data/{test → spec}/dummy/config/initializers/backtrace_silencers.rb +0 -0
- data/{test → spec}/dummy/config/initializers/devise.rb +3 -1
- data/{test → spec}/dummy/config/initializers/inflections.rb +0 -0
- data/{test → spec}/dummy/config/initializers/mime_types.rb +0 -0
- data/{test → spec}/dummy/config/initializers/secret_token.rb +1 -1
- data/{test → spec}/dummy/config/initializers/session_store.rb +1 -1
- data/{test → spec}/dummy/config/initializers/wrap_parameters.rb +1 -1
- data/{test → spec}/dummy/config/locales/devise.en.yml +0 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +7 -0
- data/{test → spec}/dummy/config/translation_center.yml +23 -6
- data/spec/dummy/db/migrate/20130410082611_devise_create_users.translation_center.rb +46 -0
- data/spec/dummy/db/migrate/20130410082701_create_articles.translation_center.rb +10 -0
- data/spec/dummy/db/migrate/20130410084702_create_translation_center_categories.translation_center.rb +9 -0
- data/spec/dummy/db/migrate/20130410084703_create_translation_center_translation_keys.translation_center.rb +14 -0
- data/spec/dummy/db/migrate/20130410084704_create_translation_center_translations.translation_center.rb +13 -0
- data/spec/dummy/db/migrate/20130410084711_acts_as_votable_migration.translation_center.rb +24 -0
- data/spec/dummy/db/migrate/20130410084712_install_audited.translation_center.rb +28 -0
- data/spec/dummy/db/migrate/20130410113113_add_de_status_translation_center_translation_keys.translation_center.rb +5 -0
- data/spec/dummy/db/migrate/20130417134534_add_ar_status_translation_center_translation_keys.rb +5 -0
- data/spec/dummy/db/migrate/20130506103956_fix_translation_user_relation.translation_center.rb +12 -0
- data/spec/dummy/db/migrate/20130801102021_add_indicies.translation_center.rb +8 -0
- data/spec/dummy/db/schema.rb +111 -0
- data/{test → spec}/dummy/public/404.html +0 -0
- data/{test → spec}/dummy/public/422.html +0 -0
- data/{test → spec}/dummy/public/500.html +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/{test → spec}/dummy/script/rails +0 -0
- data/spec/factories/category_factory.rb +5 -0
- data/spec/factories/translation_factory.rb +8 -0
- data/spec/factories/translation_key_factory.rb +5 -0
- data/spec/factories/user_factory.rb +6 -0
- data/spec/factories/vote_factory.rb +13 -0
- data/spec/lib/generators/translation_center/add_lang/add_lang_generator_spec.rb +26 -0
- data/spec/models/translation_center/category_spec.rb +39 -0
- data/spec/models/translation_center/translation_key_spec.rb +145 -0
- data/spec/models/translation_center/translation_spec.rb +117 -0
- data/spec/schema.rb +112 -0
- data/spec/spec_helper.rb +52 -0
- data/spec/support/devise.rb +3 -0
- metadata +360 -208
- data/test/dummy/app/assets/images/translation_center_logo.png +0 -0
- data/test/dummy/app/assets/javascripts/articles.js +0 -2
- data/test/dummy/app/assets/stylesheets/articles.css +0 -4
- data/test/dummy/app/assets/stylesheets/scaffold.css +0 -56
- data/test/dummy/app/controllers/application_controller.rb +0 -6
- data/test/dummy/app/controllers/articles_controller.rb +0 -85
- data/test/dummy/app/helpers/articles_helper.rb +0 -2
- data/test/dummy/app/models/article.rb +0 -7
- data/test/dummy/app/views/articles/_form.html.haml +0 -16
- data/test/dummy/app/views/articles/edit.html.haml +0 -7
- data/test/dummy/app/views/articles/index.html.haml +0 -32
- data/test/dummy/app/views/articles/new.html.haml +0 -5
- data/test/dummy/app/views/articles/show.html.haml +0 -14
- data/test/dummy/config/database.yml +0 -42
- data/test/dummy/config/locales/ar.yml +0 -6
- data/test/dummy/config/locales/de.yml +0 -2
- data/test/dummy/config/locales/en.yml +0 -361
- data/test/dummy/config/routes.rb +0 -10
- data/test/dummy/spec/spec_helper.rb +0 -38
- data/test/dummy/test/fixtures/articles.yml +0 -9
- data/test/dummy/test/fixtures/posts.yml +0 -9
- data/test/dummy/test/fixtures/users.yml +0 -11
- data/test/dummy/test/functional/articles_controller_test.rb +0 -49
- data/test/dummy/test/functional/posts_controller_test.rb +0 -49
- data/test/dummy/test/unit/article_test.rb +0 -7
- data/test/dummy/test/unit/helpers/articles_helper_test.rb +0 -4
- data/test/dummy/test/unit/helpers/posts_helper_test.rb +0 -4
- data/test/dummy/test/unit/post_test.rb +0 -7
- data/test/dummy/test/unit/user_test.rb +0 -7
- data/test/fixtures/translation_center/categories.yml +0 -7
- data/test/fixtures/translation_center/translation_keys.yml +0 -11
- data/test/fixtures/translation_center/translations.yml +0 -15
- data/test/functional/translation_center/categories_controller_test.rb +0 -51
- data/test/functional/translation_center/center_controller_test.rb +0 -9
- data/test/functional/translation_center/translation_keys_controller_test.rb +0 -51
- data/test/functional/translation_center/translations_controller_test.rb +0 -51
- data/test/integration/navigation_test.rb +0 -10
- data/test/test_helper.rb +0 -15
- data/test/translation_center_test.rb +0 -7
- data/test/unit/helpers/translation_center/categories_helper_test.rb +0 -6
- data/test/unit/helpers/translation_center/center_helper_test.rb +0 -6
- data/test/unit/helpers/translation_center/translation_keys_helper_test.rb +0 -6
- data/test/unit/helpers/translation_center/translations_helper_test.rb +0 -6
- data/test/unit/translation_center/category_test.rb +0 -9
- data/test/unit/translation_center/translation_key_test.rb +0 -9
- data/test/unit/translation_center/translation_test.rb +0 -9
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module TranslationCenter
|
3
|
+
describe TranslationsController, :type => :controller do
|
4
|
+
let(:user) {FactoryGirl.create(:user)}
|
5
|
+
let(:translation) {FactoryGirl.create(:translation)}
|
6
|
+
before(:each) do
|
7
|
+
sign_in user
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "POST vote" do
|
11
|
+
it "should assign translation & render vote.js" do
|
12
|
+
post :vote, translation_id: translation.id, format: :js, use_route: "trancelaion_center"
|
13
|
+
expect(assigns(:translation)).to eq translation
|
14
|
+
expect(response).to render_template(:vote)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "POST unvote" do
|
19
|
+
it "should assign translation & render unvote.js" do
|
20
|
+
post :unvote, translation_id: translation.id, format: :js, use_route: "trancelaion_center"
|
21
|
+
expect(assigns(:translation)).to eq translation
|
22
|
+
expect(response).to render_template(:unvote)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "POST accept" do
|
27
|
+
it "should assign translation & render accepted.js" do
|
28
|
+
post :accept, translation_id: translation.id, format: :js, use_route: "trancelaion_center"
|
29
|
+
expect(assigns(:translation)).to eq translation
|
30
|
+
expect(assigns(:translation_already_accepted)).to be_falsey
|
31
|
+
translation.reload
|
32
|
+
expect(translation.status).to eq "accepted"
|
33
|
+
expect(response).to render_template(:accept)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe "POST unaccept" do
|
38
|
+
it "should assign translation & render unaccept.js" do
|
39
|
+
post :unaccept, translation_id: translation.id, format: :js, use_route: "trancelaion_center"
|
40
|
+
expect(assigns(:translation)).to eq translation
|
41
|
+
translation.reload
|
42
|
+
expect(translation.status).to eq "pending"
|
43
|
+
expect(response).to render_template(:unaccept)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe "POST destroy" do
|
48
|
+
it "should assign translation & render destroy.js" do
|
49
|
+
delete :destroy, id: translation.id, format: :js, use_route: "trancelaion_center"
|
50
|
+
expect(assigns(:translation)).to eq translation
|
51
|
+
expect(Translation.where(id: translation.id)).to be_empty
|
52
|
+
expect(response).to render_template(:destroy)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe "GET search" do
|
57
|
+
it "should assign translations & render search" do
|
58
|
+
get :search, translation_value: "a", use_route: "trancelaion_center"
|
59
|
+
expect(assigns(:translations).class.name).to eq "ActiveRecord::Relation"
|
60
|
+
expect(assigns(:total_pages).class.name).to eq "Fixnum"
|
61
|
+
expect(response).to render_template(:search)
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should render search.js" do
|
65
|
+
get :search, translation_value: "a",format: :js, use_route: "trancelaion_center"
|
66
|
+
expect(response).to render_template(:search)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -6,11 +6,8 @@ class User < ActiveRecord::Base
|
|
6
6
|
:recoverable, :rememberable, :trackable, :validatable
|
7
7
|
|
8
8
|
# Setup accessible (or protected) attributes for your model
|
9
|
-
attr_accessible :email, :password, :password_confirmation, :remember_me
|
9
|
+
# attr_accessible :email, :password, :password_confirmation, :remember_me
|
10
|
+
# attr_accessible :title, :body
|
10
11
|
|
11
12
|
acts_as_translator
|
12
|
-
|
13
|
-
def can_admin_translations?
|
14
|
-
self.id == User.first.id
|
15
|
-
end
|
16
13
|
end
|
File without changes
|
@@ -1,13 +1,18 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
|
-
|
3
|
+
# Pick the frameworks you want:
|
4
|
+
require "active_record/railtie"
|
5
|
+
require "action_controller/railtie"
|
6
|
+
require "action_mailer/railtie"
|
7
|
+
require "active_resource/railtie"
|
8
|
+
require "sprockets/railtie"
|
9
|
+
# require "rails/test_unit/railtie"
|
4
10
|
|
5
11
|
Bundler.require
|
6
12
|
require "translation_center"
|
7
13
|
|
8
14
|
module Dummy
|
9
15
|
class Application < Rails::Application
|
10
|
-
|
11
16
|
# Settings in config/environments/* take precedence over those specified here.
|
12
17
|
# Application configuration should go into files in config/initializers
|
13
18
|
# -- all .rb files in that directory are automatically loaded.
|
@@ -27,12 +32,12 @@ module Dummy
|
|
27
32
|
# config.time_zone = 'Central Time (US & Canada)'
|
28
33
|
|
29
34
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
30
|
-
|
35
|
+
config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
31
36
|
# config.i18n.default_locale = :de
|
32
37
|
|
33
38
|
# Configure the default encoding used in templates for Ruby 1.9.
|
34
39
|
config.encoding = "utf-8"
|
35
|
-
|
40
|
+
I18n.config.enforce_available_locales = true
|
36
41
|
# Configure sensitive parameters which will be filtered from the log file.
|
37
42
|
config.filter_parameters += [:password]
|
38
43
|
|
@@ -48,7 +53,7 @@ module Dummy
|
|
48
53
|
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
49
54
|
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
50
55
|
# parameters by using an attr_accessible or attr_protected declaration.
|
51
|
-
config.active_record.whitelist_attributes = true
|
56
|
+
# config.active_record.whitelist_attributes = true
|
52
57
|
|
53
58
|
# Enable the asset pipeline
|
54
59
|
config.assets.enabled = true
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
development:
|
7
|
+
adapter: sqlite3
|
8
|
+
database: db/development.sqlite3
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
# Warning: The database defined as "test" will be erased and
|
13
|
+
# re-generated from your development database when you run "rake".
|
14
|
+
# Do not set this db to the same as development or production.
|
15
|
+
test:
|
16
|
+
adapter: sqlite3
|
17
|
+
database: db/test.sqlite3
|
18
|
+
pool: 5
|
19
|
+
timeout: 5000
|
20
|
+
|
21
|
+
production:
|
22
|
+
adapter: sqlite3
|
23
|
+
database: db/production.sqlite3
|
24
|
+
pool: 5
|
25
|
+
timeout: 5000
|
File without changes
|
File without changes
|
@@ -8,7 +8,7 @@ Dummy::Application.configure do
|
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
10
|
# Configure static asset server for tests with Cache-Control for performance
|
11
|
-
config.serve_static_assets = true
|
11
|
+
# config.serve_static_assets = true
|
12
12
|
config.static_cache_control = "public, max-age=3600"
|
13
13
|
|
14
14
|
# Log error messages when you accidentally call methods on nil
|
@@ -30,7 +30,7 @@ Dummy::Application.configure do
|
|
30
30
|
config.action_mailer.delivery_method = :test
|
31
31
|
|
32
32
|
# Raise exception on mass assignment protection for Active Record models
|
33
|
-
config.active_record.mass_assignment_sanitizer = :strict
|
33
|
+
# config.active_record.mass_assignment_sanitizer = :strict
|
34
34
|
|
35
35
|
# Print deprecation notices to the stderr
|
36
36
|
config.active_support.deprecation = :stderr
|
File without changes
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require "devise"
|
1
2
|
# Use this hook to configure devise mailer, warden hooks and so forth.
|
2
3
|
# Many of these configuration options can be set straight in your model.
|
3
4
|
Devise.setup do |config|
|
@@ -82,7 +83,7 @@ Devise.setup do |config|
|
|
82
83
|
config.stretches = Rails.env.test? ? 1 : 10
|
83
84
|
|
84
85
|
# Setup a pepper to generate the encrypted password.
|
85
|
-
# config.pepper = "
|
86
|
+
# config.pepper = "775fa92c427f2a2f3c48e6c52d3d98745acae331fd85a57643a6357da3e2b415857d9516f54ea2906c91f33cb2dfd975a72967b0a1f6a59dac96017a877b4ae8"
|
86
87
|
|
87
88
|
# ==> Configuration for :confirmable
|
88
89
|
# A period that the user is allowed to access the website even without
|
@@ -210,6 +211,7 @@ Devise.setup do |config|
|
|
210
211
|
# The default HTTP method used to sign out a resource. Default is :delete.
|
211
212
|
config.sign_out_via = :delete
|
212
213
|
|
214
|
+
config.secret_key = '04d5a22f877c4424de01da12cf0af2c1682a1d272ac39c54fd73d16270b85bed033ffb1f6dc0b7ef51e24745b3e682c2459d45701f2bafc3de028c26e40a400b'
|
213
215
|
# ==> OmniAuth
|
214
216
|
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
215
217
|
# up on your models and hooks.
|
File without changes
|
File without changes
|
@@ -4,4 +4,4 @@
|
|
4
4
|
# If you change this key, all old signed cookies will become invalid!
|
5
5
|
# Make sure the secret is at least 30 characters and all random,
|
6
6
|
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
Dummy::Application.config.secret_token = '
|
7
|
+
Dummy::Application.config.secret_token = '0528aeb47dfc51cbe0722cd0c3c7ef009bc50ed4895776616a78a80769f81c76b15a9e38e267e1f01c00436fd9eccfff4c696d6e167be9d0f616a8fc48607011'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
Dummy::Application.config.session_store :cookie_store, key
|
3
|
+
Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
|
4
4
|
|
5
5
|
# Use the database for sessions instead of the cookie-based default,
|
6
6
|
# which shouldn't be used to store highly confidential information
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
7
|
ActiveSupport.on_load(:action_controller) do
|
8
|
-
wrap_parameters format
|
8
|
+
wrap_parameters :format => [:json]
|
9
9
|
end
|
10
10
|
|
11
11
|
# Disable root element in JSON by default.
|
File without changes
|
@@ -11,14 +11,14 @@ common_atts: &common_atts
|
|
11
11
|
name: 'Arabic'
|
12
12
|
direction: 'rtl'
|
13
13
|
|
14
|
-
# yaml imported translations created by translator email, usually User email
|
15
|
-
yaml_translator_identifier: '
|
14
|
+
# yaml imported translations created by translator email, usually User email
|
15
|
+
yaml_translator_identifier: 'user@example.com'
|
16
16
|
|
17
17
|
# when import translation from yaml to db set it to accepted by default
|
18
18
|
yaml2db_translations_accepted: true # default is false
|
19
19
|
|
20
20
|
# when admins add/edit translations they are considered accepted directly
|
21
|
-
accept_admin_translations: true
|
21
|
+
accept_admin_translations: true
|
22
22
|
|
23
23
|
# identifier_type: 'email' # Uncomment and change the identifier if your User model has no email attribute
|
24
24
|
# translator_type: 'User' # Uncomment and change if you want to change the translator type
|
@@ -36,7 +36,24 @@ development:
|
|
36
36
|
i18n_source: 'yaml' # can be db or yaml; default is db
|
37
37
|
|
38
38
|
# when a new key is added to db, the value of the key is added as the default translation in English
|
39
|
-
save_default_translation: true
|
39
|
+
save_default_translation: true
|
40
|
+
|
41
|
+
<<: *common_atts
|
42
|
+
|
43
|
+
test:
|
44
|
+
enabled: true # default false
|
45
|
+
|
46
|
+
# Keys inspector allowed values:
|
47
|
+
# "missing" to inspect only untranslated keys
|
48
|
+
# "all" to enable inspector for translated and untranslated keys
|
49
|
+
# "off" to turn off keys inspector
|
50
|
+
inspector: 'all' # default missing
|
51
|
+
|
52
|
+
# I18n.translate source
|
53
|
+
i18n_source: 'yaml' # can be db or yaml; default is db
|
54
|
+
|
55
|
+
# when a new key is added to db, the value of the key is added as the default translation in English
|
56
|
+
save_default_translation: true
|
40
57
|
|
41
58
|
<<: *common_atts
|
42
59
|
|
@@ -53,6 +70,6 @@ production:
|
|
53
70
|
i18n_source: 'yaml' # can be db or yaml; default is yaml
|
54
71
|
|
55
72
|
# when a new key is added to db, the value of the key is added as the default translation in English
|
56
|
-
save_default_translation: false
|
73
|
+
save_default_translation: false
|
57
74
|
|
58
|
-
<<: *common_atts
|
75
|
+
<<: *common_atts
|
@@ -0,0 +1,46 @@
|
|
1
|
+
class DeviseCreateUsers < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table(:users) do |t|
|
4
|
+
## Database authenticatable
|
5
|
+
t.string :email, :null => false, :default => ""
|
6
|
+
t.string :encrypted_password, :null => false, :default => ""
|
7
|
+
|
8
|
+
## Recoverable
|
9
|
+
t.string :reset_password_token
|
10
|
+
t.datetime :reset_password_sent_at
|
11
|
+
|
12
|
+
## Rememberable
|
13
|
+
t.datetime :remember_created_at
|
14
|
+
|
15
|
+
## Trackable
|
16
|
+
t.integer :sign_in_count, :default => 0
|
17
|
+
t.datetime :current_sign_in_at
|
18
|
+
t.datetime :last_sign_in_at
|
19
|
+
t.string :current_sign_in_ip
|
20
|
+
t.string :last_sign_in_ip
|
21
|
+
|
22
|
+
## Confirmable
|
23
|
+
# t.string :confirmation_token
|
24
|
+
# t.datetime :confirmed_at
|
25
|
+
# t.datetime :confirmation_sent_at
|
26
|
+
# t.string :unconfirmed_email # Only if using reconfirmable
|
27
|
+
|
28
|
+
## Lockable
|
29
|
+
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
|
30
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
31
|
+
# t.datetime :locked_at
|
32
|
+
|
33
|
+
## Token authenticatable
|
34
|
+
# t.string :authentication_token
|
35
|
+
|
36
|
+
|
37
|
+
t.timestamps
|
38
|
+
end
|
39
|
+
|
40
|
+
add_index :users, :email, :unique => true
|
41
|
+
add_index :users, :reset_password_token, :unique => true
|
42
|
+
# add_index :users, :confirmation_token, :unique => true
|
43
|
+
# add_index :users, :unlock_token, :unique => true
|
44
|
+
# add_index :users, :authentication_token, :unique => true
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateTranslationCenterTranslationKeys < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :translation_center_translation_keys do |t|
|
4
|
+
t.string :name
|
5
|
+
t.integer :category_id
|
6
|
+
t.datetime :last_accessed
|
7
|
+
|
8
|
+
t.string :en_status, default: 'untranslated'
|
9
|
+
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateTranslationCenterTranslations < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :translation_center_translations do |t|
|
4
|
+
t.integer :translation_key_id
|
5
|
+
t.string :value
|
6
|
+
t.string :lang
|
7
|
+
t.integer :user_id
|
8
|
+
t.string :status, default: 'pending'
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|