gettext_simple_rails 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gettext_simple_rails/cache_handler.rb +5 -3
- data/lib/gettext_simple_rails/i18n_injector.rb +7 -65
- data/lib/gettext_simple_rails/translators/active_record_attributes_translator.rb +36 -0
- data/lib/gettext_simple_rails/translators/{active_record_translator.rb → active_record_validations_translator.rb} +5 -3
- data/lib/gettext_simple_rails/translators/globalize_translator.rb +32 -0
- data/lib/gettext_simple_rails/version.rb +1 -1
- data/lib/tasks/gettext_simple_rails_tasks.rake +0 -42
- data/spec/{active_record_spec.rb → active_record_validations_spec.rb} +2 -2
- data/spec/dummy/app/models/user.rb +2 -1
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/config/locales_gettext/static_translation_file.json +1 -1
- data/spec/dummy/db/migrate/20140515092420_create_user_translations.rb +11 -0
- data/spec/dummy/db/schema.rb +9 -5
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/gettext_simple_rails/active_record_attributes_translator_translations.rb +40 -0
- data/spec/dummy/lib/gettext_simple_rails/active_record_validations_translator_translations.rb +18 -0
- data/spec/dummy/lib/gettext_simple_rails/date_translator_translations.rb +60 -0
- data/spec/dummy/lib/gettext_simple_rails/globalize_translator_translations.rb +6 -0
- data/spec/dummy/lib/gettext_simple_rails/number_translator_translations.rb +48 -0
- data/spec/dummy/log/test.log +440 -0
- data/spec/gettext_simple_rails_spec.rb +10 -11
- data/spec/globalize_translator_spec.rb +20 -0
- metadata +35 -13
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/lib/gettext_simple_rails/models/role_model_translations.rb +0 -21
- data/spec/dummy/lib/gettext_simple_rails/models/user_model_translations.rb +0 -22
- data/spec/dummy/log/development.log +0 -26
@@ -1,21 +0,0 @@
|
|
1
|
-
class GettextSimpleRails::UserModelTranslations
|
2
|
-
def self.attribute_translations
|
3
|
-
puts _('models.attributes.role.id')
|
4
|
-
puts _('models.attributes.role.role')
|
5
|
-
puts _('models.attributes.role.user_id')
|
6
|
-
puts _('models.attributes.role.created_at')
|
7
|
-
puts _('models.attributes.role.updated_at')
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.relationship_translations
|
11
|
-
puts _('models.attributes.role.user')
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.paperclip_attachments
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.model_name
|
18
|
-
puts _('models.name.role.one')
|
19
|
-
puts _('models.name.role.other')
|
20
|
-
end
|
21
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
class GettextSimpleRails::UserModelTranslations
|
2
|
-
def self.attribute_translations
|
3
|
-
puts _('models.attributes.user.id')
|
4
|
-
puts _('models.attributes.user.name')
|
5
|
-
puts _('models.attributes.user.birthday_at')
|
6
|
-
puts _('models.attributes.user.age')
|
7
|
-
puts _('models.attributes.user.created_at')
|
8
|
-
puts _('models.attributes.user.updated_at')
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.relationship_translations
|
12
|
-
puts _('models.attributes.user.roles')
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.paperclip_attachments
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.model_name
|
19
|
-
puts _('models.name.user.one')
|
20
|
-
puts _('models.name.user.other')
|
21
|
-
end
|
22
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
[1m[36m (113.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
2
|
-
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3
|
-
[1m[36m (115.8ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
4
|
-
[1m[35mActiveRecord::SchemaMigration Load (0.4ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5
|
-
Migrating to CreateUsers (20140410170418)
|
6
|
-
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
7
|
-
[1m[35m (0.3ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "birthday_at" date, "age" integer, "created_at" datetime, "updated_at" datetime)
|
8
|
-
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20140410170418"]]
|
9
|
-
[1m[35m (130.7ms)[0m commit transaction
|
10
|
-
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
11
|
-
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
12
|
-
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
13
|
-
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
14
|
-
Migrating to CreateGettextSimpleRailsRoles (20140411112550)
|
15
|
-
[1m[35m (0.1ms)[0m begin transaction
|
16
|
-
[1m[36m (0.3ms)[0m [1mCREATE TABLE "gettext_simple_rails_roles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "role" varchar(255), "user_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
17
|
-
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140411112550"]]
|
18
|
-
[1m[36m (117.9ms)[0m [1mcommit transaction[0m
|
19
|
-
[1m[35mActiveRecord::SchemaMigration Load (0.3ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
20
|
-
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
21
|
-
Migrating to CreateRoles (20140411112622)
|
22
|
-
[1m[35m (0.1ms)[0m begin transaction
|
23
|
-
[1m[36m (0.7ms)[0m [1mCREATE TABLE "roles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "role" varchar(255), "user_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
24
|
-
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140411112622"]]
|
25
|
-
[1m[36m (109.6ms)[0m [1mcommit transaction[0m
|
26
|
-
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|