i18n-active_record 0.2.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n-active_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-20 00:00:00.000000000 Z
11
+ date: 2021-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.5.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: appraisal
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +52,76 @@ dependencies:
38
52
  - - ">="
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: mocha
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: test_declarative
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
41
125
  description: I18n ActiveRecord backend. Allows to store translations in a database
42
126
  using ActiveRecord, e.g. for providing a web-interface for managing translations.
43
127
  email: svenfuchs@artweb-design.de
@@ -46,8 +130,12 @@ extensions: []
46
130
  extra_rdoc_files: []
47
131
  files:
48
132
  - MIT-LICENSE
49
- - README.textile
133
+ - README.md
50
134
  - Rakefile
135
+ - lib/generators/i18n/active_record/install_generator.rb
136
+ - lib/generators/i18n/active_record/templates/advanced_initializer.rb.erb
137
+ - lib/generators/i18n/active_record/templates/migration.rb.erb
138
+ - lib/generators/i18n/active_record/templates/simple_initializer.rb.erb
51
139
  - lib/i18n/active_record.rb
52
140
  - lib/i18n/active_record/version.rb
53
141
  - lib/i18n/backend/active_record.rb
@@ -63,7 +151,7 @@ homepage: http://github.com/svenfuchs/i18n-active_record
63
151
  licenses:
64
152
  - MIT
65
153
  metadata: {}
66
- post_install_message:
154
+ post_install_message:
67
155
  rdoc_options: []
68
156
  require_paths:
69
157
  - lib
@@ -78,9 +166,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
166
  - !ruby/object:Gem::Version
79
167
  version: '0'
80
168
  requirements: []
81
- rubyforge_project: "[none]"
82
- rubygems_version: 2.5.2
83
- signing_key:
169
+ rubygems_version: 3.2.29
170
+ signing_key:
84
171
  specification_version: 4
85
172
  summary: I18n ActiveRecord backend
86
173
  test_files: []
data/README.textile DELETED
@@ -1,94 +0,0 @@
1
- h1. I18n::Backend::ActiveRecord
2
-
3
- !https://travis-ci.org/svenfuchs/i18n-active_record.svg?branch=master!:https://travis-ci.org/svenfuchs/i18n-active_record
4
-
5
- This repository contains the I18n ActiveRecord backend and support code that has been extracted from the "I18n":http://github.com/svenfuchs/i18n.
6
- It is fully compatible with Rails 3, 4 and 5
7
-
8
- h2. Installation
9
-
10
- For Bundler put the following in your Gemfile:
11
-
12
- <pre>
13
- gem 'i18n-active_record', :require => 'i18n/active_record'
14
- </pre>
15
-
16
- Next create a active record model named @Translation@ with the Rails Generator.
17
- Your migration should look like this:
18
-
19
- <pre>
20
- class CreateTranslations < ActiveRecord::Migration
21
- def self.up
22
- create_table :translations do |t|
23
- t.string :locale
24
- t.string :key
25
- t.text :value
26
- t.text :interpolations
27
- t.boolean :is_proc, :default => false
28
-
29
- t.timestamps
30
- end
31
- end
32
-
33
- def self.down
34
- drop_table :translations
35
- end
36
- end
37
- </pre>
38
-
39
- With this translation model you will be able to manage your translation, and add new translations or languages through
40
- it.
41
-
42
- To load @I18n::Backend::ActiveRecord@ into your Rails application, create a new file in *config/initializers* named *locale.rb*.
43
-
44
- A simple configuration for your locale.rb could look like this:
45
-
46
- <pre>
47
- require 'i18n/backend/active_record'
48
- I18n.backend = I18n::Backend::ActiveRecord.new
49
- </pre>
50
-
51
- A more advanced example (Thanks Moritz), which uses YAML files and ActiveRecord for lookups:
52
-
53
- <pre>
54
- require 'i18n/backend/active_record'
55
-
56
- Translation = I18n::Backend::ActiveRecord::Translation
57
-
58
- if Translation.table_exists?
59
- I18n.backend = I18n::Backend::ActiveRecord.new
60
-
61
- I18n::Backend::ActiveRecord.send(:include, I18n::Backend::Memoize)
62
- I18n::Backend::Simple.send(:include, I18n::Backend::Memoize)
63
- I18n::Backend::Simple.send(:include, I18n::Backend::Pluralization)
64
-
65
- I18n.backend = I18n::Backend::Chain.new(I18n::Backend::Simple.new, I18n.backend)
66
- end
67
- </pre>
68
-
69
- You may also configure whether the ActiveRecord backend should use @destroy@ or @delete@ when cleaning up internally.
70
-
71
- <pre>
72
- I18n::Backend::ActiveRecord.configure do |config|
73
- config.cleanup_with_destroy = true # defaults to false
74
- end
75
- </pre>
76
-
77
- h2. Usage
78
-
79
- You can now use @I18n.t('Your String')@ to lookup translations in the database.
80
-
81
- h2. Missing Translations -> Interpolations
82
-
83
- The interpolations field in the Translations table is used by I18n::Backend::ActiveRecord::Missing to store the interpolations seen the first time this Translation was requested. This will help translators understand what interpolations to expect, and thus to include when providing the translations.
84
-
85
- The interpolations field is otherwise unused since the "value" in Translation.value is actually used for interpolation during actual translations.
86
-
87
- h2. Examples
88
-
89
- * http://collectiveidea.com/blog/archives/2016/05/31/beyond-yml-files-dynamic-translations/
90
-
91
- h2. Maintainers
92
-
93
- * Sven Fuchs
94
- * Tim Maslyuchenko