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.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gettext_simple_rails/cache_handler.rb +5 -3
  3. data/lib/gettext_simple_rails/i18n_injector.rb +7 -65
  4. data/lib/gettext_simple_rails/translators/active_record_attributes_translator.rb +36 -0
  5. data/lib/gettext_simple_rails/translators/{active_record_translator.rb → active_record_validations_translator.rb} +5 -3
  6. data/lib/gettext_simple_rails/translators/globalize_translator.rb +32 -0
  7. data/lib/gettext_simple_rails/version.rb +1 -1
  8. data/lib/tasks/gettext_simple_rails_tasks.rake +0 -42
  9. data/spec/{active_record_spec.rb → active_record_validations_spec.rb} +2 -2
  10. data/spec/dummy/app/models/user.rb +2 -1
  11. data/spec/dummy/config/application.rb +1 -0
  12. data/spec/dummy/config/locales_gettext/static_translation_file.json +1 -1
  13. data/spec/dummy/db/migrate/20140515092420_create_user_translations.rb +11 -0
  14. data/spec/dummy/db/schema.rb +9 -5
  15. data/spec/dummy/db/test.sqlite3 +0 -0
  16. data/spec/dummy/lib/gettext_simple_rails/active_record_attributes_translator_translations.rb +40 -0
  17. data/spec/dummy/lib/gettext_simple_rails/active_record_validations_translator_translations.rb +18 -0
  18. data/spec/dummy/lib/gettext_simple_rails/date_translator_translations.rb +60 -0
  19. data/spec/dummy/lib/gettext_simple_rails/globalize_translator_translations.rb +6 -0
  20. data/spec/dummy/lib/gettext_simple_rails/number_translator_translations.rb +48 -0
  21. data/spec/dummy/log/test.log +440 -0
  22. data/spec/gettext_simple_rails_spec.rb +10 -11
  23. data/spec/globalize_translator_spec.rb +20 -0
  24. metadata +35 -13
  25. data/spec/dummy/db/development.sqlite3 +0 -0
  26. data/spec/dummy/lib/gettext_simple_rails/models/role_model_translations.rb +0 -21
  27. data/spec/dummy/lib/gettext_simple_rails/models/user_model_translations.rb +0 -22
  28. 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
-  (113.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
2
-  (0.1ms) select sqlite_version(*)
3
-  (115.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
- ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
- Migrating to CreateUsers (20140410170418)
6
-  (0.3ms) begin transaction
7
-  (0.3ms) 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
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140410170418"]]
9
-  (130.7ms) commit transaction
10
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
11
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
12
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
13
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
14
- Migrating to CreateGettextSimpleRailsRoles (20140411112550)
15
-  (0.1ms) begin transaction
16
-  (0.3ms) CREATE TABLE "gettext_simple_rails_roles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "role" varchar(255), "user_id" integer, "created_at" datetime, "updated_at" datetime) 
17
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140411112550"]]
18
-  (117.9ms) commit transaction
19
- ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
20
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
21
- Migrating to CreateRoles (20140411112622)
22
-  (0.1ms) begin transaction
23
-  (0.7ms) CREATE TABLE "roles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "role" varchar(255), "user_id" integer, "created_at" datetime, "updated_at" datetime) 
24
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140411112622"]]
25
-  (109.6ms) commit transaction
26
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"