e9s 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,5 +1,10 @@
1
1
  = E9s CHANGELOG
2
2
 
3
+ == Version 2.1.2 (October 2, 2010)
4
+
5
+ * Using Rich-CMS v2.0.5 and Rich-i18n v1.2.1
6
+ * Not defining the helper method 'link' anymore
7
+
3
8
  == Version 2.1.1 (October 1, 2010)
4
9
 
5
10
  * Added rails generator 'enrichments'
@@ -49,12 +49,6 @@ Add e9s in environment.rb as a gem dependency:
49
49
 
50
50
  h3. Testing E9s out-of-the-box
51
51
 
52
- Set the default locale to @:nl@ in @environment.rb@:
53
-
54
- <pre>
55
- config.i18n.default_locale = :nl
56
- </pre>
57
-
58
52
  Run the Rails console:
59
53
 
60
54
  <pre>
@@ -64,11 +58,35 @@ Run the Rails console:
64
58
  Start translating in Dutch:
65
59
 
66
60
  <pre>
61
+ >> I18n.locale = :nl
62
+ => :nl
67
63
  >> "MORE HOUSES".t
68
64
  => "MEER HUIZEN"
69
65
  </pre>
70
66
 
71
- h2. Usage
67
+ h2. Use the provided Rails generator
68
+
69
+ In order to manage translations and/or CMS content. You need the following entities:
70
+
71
+ * An @Authlogic@ authenticated user model
72
+ * An @ActiveRecord@ model used for translation storage
73
+ * An @ActiveRecord@ model used for CMS content storage
74
+
75
+ Fortunately, E9s is provided with a Rails generator with which you can generate all the entities.
76
+
77
+ h3. In your console
78
+
79
+ Run the following command:
80
+
81
+ <pre>
82
+ script/generate enrichments
83
+ </pre>
84
+
85
+ *Note*: The generator has the @-m@ or @--migrate@ option which runs @rake db:migrate@ after creating the files.
86
+
87
+ Actually, this generator calls the generators of "Rich-CMS":http://github.com/archan937/rich_cms and "Rich-i18n":http://github.com/archan937/rich_i18n. For more information, please check the README files.
88
+
89
+ h2. Start specifying translations
72
90
 
73
91
  h3. Populating config/locales
74
92
 
@@ -161,6 +179,47 @@ nl:
161
179
 
162
180
  For a complete example, please open "http://github.com/archan937/rich_pluralization/blob/master/locales/nl.yml":http://github.com/archan937/rich_pluralization/blob/master/locales/nl.yml which contains Dutch inflections.
163
181
 
182
+ h3. Labels and seatholders
183
+
184
+ You can translate @labels@ and @seatholders@ (placeholders :D) within Formtastic forms without altering its code.
185
+
186
+ *Note*: specified in @config/locales/nl.yml@
187
+
188
+ <pre>
189
+ ---
190
+ nl:
191
+
192
+ word:
193
+ password: wachtwoord
194
+
195
+ label:
196
+ user_name: gebruikersnaam
197
+ content: bericht
198
+
199
+ Question:
200
+ content: jouw vraag
201
+
202
+ Answer:
203
+ content: jouw antwoord
204
+
205
+ (search_form)
206
+ criteria: uw zoekcriteria
207
+
208
+ seatholder:
209
+ email_address: uw.naam@een.website.nl
210
+
211
+ Question:
212
+ content: Hoeveel uren zitten in een dag?
213
+
214
+ Answer:
215
+ content: 24 uur
216
+
217
+ (search_form)
218
+ criteria: '&Voorbeeld'
219
+ </pre>
220
+
221
+ h2. Start translating / pluralizing
222
+
164
223
  h3. String / Symbol methods
165
224
 
166
225
  E9s adds the following methods to strings and symbols:
@@ -244,45 +303,70 @@ As a result of the YAML file specified above, you will get the following transla
244
303
  => "Meer huizen"
245
304
  </pre>
246
305
 
247
- h3. Labels and seatholders
306
+ h2. Render E9s in your views
248
307
 
249
- You can translate @labels@ and @seatholders@ (placeholders :D) within Formtastic forms without altering its code.
308
+ h3. Alter your layout
250
309
 
251
- *Note*: specified in @config/locales/nl.yml@
310
+ Add the following line at the beginning of the @<body>@ tag:
252
311
 
253
312
  <pre>
254
- ---
255
- nl:
256
-
257
- word:
258
- password: wachtwoord
259
-
260
- label:
261
- user_name: gebruikersnaam
262
- content: bericht
263
-
264
- Question:
265
- content: jouw vraag
266
-
267
- Answer:
268
- content: jouw antwoord
269
-
270
- (search_form)
271
- criteria: uw zoekcriteria
272
-
273
- seatholder:
274
- email_address: uw.naam@een.website.nl
275
-
276
- Question:
277
- content: Hoeveel uren zitten in een dag?
278
-
279
- Answer:
280
- content: 24 uur
281
-
282
- (search_form)
283
- criteria: '&Voorbeeld'
313
+ <body>
314
+ <%= e9s %>
315
+ ...
316
+ </body>
317
+ </pre>
318
+
319
+ h3. Render CMS content
320
+
321
+ The E9s module Rich-CMS requires a rendered DOM element provided with meta data of the content instance. Fortunately, you can call a method provided by Rich-CMS. Just specify the identifier of the content type and the key of the CMS content instance in question:
322
+
323
+ <pre>
324
+ >> key = "test_content"
325
+ => "test_content"
326
+ >> Rich::Cms::Engine.to_content_tag(".cms_content", key)
327
+ => "<div class='cms_content' data-key='test_content' data-value='Hello world!'>Hello world!</div>"
328
+ </pre>
329
+
330
+ When using a combined key for content identification, just call it as follows:
331
+
332
+ <pre>
333
+ >> Rich::Cms::Engine.to_content_tag(".cms_content", {:key => key, :locale => I18n.locale})
334
+ => "<div class='cms_content' data-key='test_content' data-locale='nl' data-value='Hallo wereld!'>Hallo wereld!</div>"
335
+ </pre>
336
+
337
+ *Note*: In this case, the content was registered with @Rich::Cms::Engine.register(".cms_content", {:class_name => "Cms::StaticContent", :key => [:key, :locale]})@
338
+
339
+ We have also provided you a helper method to render Rich-CMS content tags:
340
+
341
+ <pre>
342
+ ...
343
+ <%= rich_cms_tag ".cms_content", "test_content" %>
344
+ <%= rich_cms_tag ".cms_content", {:key => "test_content", :locale => I18n.locale} %>
345
+ ...
346
+ </pre>
347
+
348
+ For further documentation, please check the "Rich-CMS README":http://github.com/archan937/rich_cms file.
349
+
350
+ h3. Render translations
351
+
352
+ The E9s module Rich-i18n has its own conventions which are simpler. A few examples:
353
+
354
+ <pre>
355
+ ...
356
+ <h1>
357
+ <%= "application.index.Welcome_to_our_renewed_website".t %>
358
+ </h1>
359
+ <%= link_to "PRODUCTS".t, products_path %>
360
+ <%= "Hello world".t %>
361
+ ...
284
362
  </pre>
285
363
 
364
+ For further documentation, please check the "Rich-i18n README":http://github.com/archan937/rich_i18n file.
365
+
366
+ h3. E9s in your browser
367
+
368
+ Open "http://localhost:3000/cms":http://localhost:3000/cms, log in and start managing translations / CMS content.
369
+
286
370
  h2. Contact me
287
371
 
288
372
  For support, remarks and requests please mail me at "paul.engel@holder.nl":mailto:paul.engel@holder.nl.
@@ -292,32 +376,26 @@ h2. Credit
292
376
  This Rails gem / plugin depends on:
293
377
 
294
378
  Rich-CMS<br>
379
+ "http://codehero.es/rails_gems_plugins/rich_cms":http://codehero.es/rails_gems_plugins/rich_cms <br>
295
380
  "http://github.com/archan937/rich_cms":http://github.com/archan937/rich_cms
296
381
 
297
382
  Rich-i18n<br>
383
+ "http://codehero.es/rails_gems_plugins/rich_i18n":http://codehero.es/rails_gems_plugins/rich_i18n <br>
298
384
  "http://github.com/archan937/rich_i18n":http://github.com/archan937/rich_i18n
299
385
 
300
386
  Rich-pluralization<br>
387
+ "http://codehero.es/rails_gems_plugins/rich_pluralization":http://codehero.es/rails_gems_plugins/rich_pluralization <br>
301
388
  "http://github.com/archan937/rich_pluralization":http://github.com/archan937/rich_pluralization
302
389
 
303
- i18n<br>
304
- "http://github.com/svenfuchs/i18n":http://github.com/svenfuchs/i18n
305
-
306
- Formtastic<br>
307
- "http://github.com/justinfrench/formtastic":http://github.com/justinfrench/formtastic
308
-
309
- SeatHolder<br>
310
- "http://github.com/archan937/seat_holder":http://github.com/archan937/seat_holder
311
-
312
- h2. E9s
390
+ h2. Enrichments
313
391
 
314
- E9s - "http://github.com/archan937/e9s":http://github.com/archan937/e9s
392
+ The all-in-one gem at - "http://codehero.es/rails_gems_plugins/e9s":http://codehero.es/rails_gems_plugins/e9s - "http://github.com/archan937/e9s":http://github.com/archan937/e9s
315
393
 
316
394
  h3. E9s modules
317
395
 
318
- * Rich-CMS - "http://github.com/archan937/rich_cms":http://github.com/archan937/rich_cms
319
- * Rich-i18n - "http://github.com/archan937/rich_i18n":http://github.com/archan937/rich_i18n
320
- * Rich-pluralization - "http://github.com/archan937/rich_pluralization":http://github.com/archan937/rich_pluralization
396
+ * Rich-CMS <br> "http://codehero.es/rails_gems_plugins/rich_cms":http://codehero.es/rails_gems_plugins/rich_cms <br> "http://github.com/archan937/rich_cms":http://github.com/archan937/rich_cms
397
+ * Rich-i18n <br> "http://codehero.es/rails_gems_plugins/rich_i18n":http://codehero.es/rails_gems_plugins/rich_i18n <br> "http://github.com/archan937/rich_i18n":http://github.com/archan937/rich_i18n
398
+ * Rich-pluralization <br> "http://codehero.es/rails_gems_plugins/rich_pluralization":http://codehero.es/rails_gems_plugins/rich_pluralization <br> "http://github.com/archan937/rich_pluralization":http://github.com/archan937/rich_pluralization
321
399
 
322
400
  h2. License
323
401
 
data/Rakefile CHANGED
@@ -9,11 +9,11 @@ begin
9
9
  gemspec.summary = "Enrichments (e9s) for a pluggable CMS, internationalization (i18n) and localized pluralization"
10
10
  gemspec.description = "E9s was created due to the need of simply implementing I18n within a Rails application. This simplifies internationalization of your Rails application making a Rails developers life much easier. E9s is divided into modules (as gem and plugin): Rich-CMS (http://github.com/archan937/rich_cms) , Rich-i18n (http://github.com/archan937/rich_i18n) and Rich-pluralization (http://github.com/archan937/rich_pluralization)."
11
11
  gemspec.email = "paul.engel@holder.nl"
12
- gemspec.homepage = "http://github.com/archan937/e9s"
12
+ gemspec.homepage = "http://codehero.es/rails_gems_plugins/e9s"
13
13
  gemspec.author = "Paul Engel"
14
14
 
15
- gemspec.add_dependency "rich_cms" , ">= 2.0.4"
16
- gemspec.add_dependency "rich_i18n" , ">= 1.2.0"
15
+ gemspec.add_dependency "rich_cms" , ">= 2.0.5"
16
+ gemspec.add_dependency "rich_i18n" , ">= 1.2.1"
17
17
  gemspec.add_dependency "rich_pluralization", ">= 1.0.3"
18
18
  end
19
19
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.1
1
+ 2.1.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{e9s}
8
- s.version = "2.1.1"
8
+ s.version = "2.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Paul Engel"]
12
- s.date = %q{2010-10-01}
12
+ s.date = %q{2010-10-02}
13
13
  s.description = %q{E9s was created due to the need of simply implementing I18n within a Rails application. This simplifies internationalization of your Rails application making a Rails developers life much easier. E9s is divided into modules (as gem and plugin): Rich-CMS (http://github.com/archan937/rich_cms) , Rich-i18n (http://github.com/archan937/rich_i18n) and Rich-pluralization (http://github.com/archan937/rich_pluralization).}
14
14
  s.email = %q{paul.engel@holder.nl}
15
15
  s.extra_rdoc_files = [
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
36
36
  "test/test_helper.rb",
37
37
  "uninstall.rb"
38
38
  ]
39
- s.homepage = %q{http://github.com/archan937/e9s}
39
+ s.homepage = %q{http://codehero.es/rails_gems_plugins/e9s}
40
40
  s.rdoc_options = ["--charset=UTF-8"]
41
41
  s.require_paths = ["lib"]
42
42
  s.rubygems_version = %q{1.3.7}
@@ -51,17 +51,17 @@ Gem::Specification.new do |s|
51
51
  s.specification_version = 3
52
52
 
53
53
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
54
- s.add_runtime_dependency(%q<rich_cms>, [">= 2.0.4"])
55
- s.add_runtime_dependency(%q<rich_i18n>, [">= 1.2.0"])
54
+ s.add_runtime_dependency(%q<rich_cms>, [">= 2.0.5"])
55
+ s.add_runtime_dependency(%q<rich_i18n>, [">= 1.2.1"])
56
56
  s.add_runtime_dependency(%q<rich_pluralization>, [">= 1.0.3"])
57
57
  else
58
- s.add_dependency(%q<rich_cms>, [">= 2.0.4"])
59
- s.add_dependency(%q<rich_i18n>, [">= 1.2.0"])
58
+ s.add_dependency(%q<rich_cms>, [">= 2.0.5"])
59
+ s.add_dependency(%q<rich_i18n>, [">= 1.2.1"])
60
60
  s.add_dependency(%q<rich_pluralization>, [">= 1.0.3"])
61
61
  end
62
62
  else
63
- s.add_dependency(%q<rich_cms>, [">= 2.0.4"])
64
- s.add_dependency(%q<rich_i18n>, [">= 1.2.0"])
63
+ s.add_dependency(%q<rich_cms>, [">= 2.0.5"])
64
+ s.add_dependency(%q<rich_i18n>, [">= 1.2.1"])
65
65
  s.add_dependency(%q<rich_pluralization>, [">= 1.0.3"])
66
66
  end
67
67
  end
@@ -9,11 +9,6 @@ module ActionView
9
9
  end
10
10
  end.compact.join("\n")
11
11
  end
12
-
13
- def link(name, options = nil)
14
- options = {:class => options || name.underscore} unless options.is_a?(Hash)
15
- link_to name, "#", options
16
- end
17
12
 
18
13
  end
19
14
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: e9s
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
- - 1
10
- version: 2.1.1
9
+ - 2
10
+ version: 2.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Paul Engel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-01 00:00:00 +02:00
18
+ date: 2010-10-02 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,12 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- hash: 7
29
+ hash: 5
30
30
  segments:
31
31
  - 2
32
32
  - 0
33
- - 4
34
- version: 2.0.4
33
+ - 5
34
+ version: 2.0.5
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency
@@ -42,12 +42,12 @@ dependencies:
42
42
  requirements:
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- hash: 31
45
+ hash: 29
46
46
  segments:
47
47
  - 1
48
48
  - 2
49
- - 0
50
- version: 1.2.0
49
+ - 1
50
+ version: 1.2.1
51
51
  type: :runtime
52
52
  version_requirements: *id002
53
53
  - !ruby/object:Gem::Dependency
@@ -95,7 +95,7 @@ files:
95
95
  - test/test_helper.rb
96
96
  - uninstall.rb
97
97
  has_rdoc: true
98
- homepage: http://github.com/archan937/e9s
98
+ homepage: http://codehero.es/rails_gems_plugins/e9s
99
99
  licenses: []
100
100
 
101
101
  post_install_message: