gettext_i18n_rails 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +4 -0
- data/VERSION +1 -1
- data/gettext_i18n_rails.gemspec +2 -2
- data/lib/gettext_i18n_rails/model_attributes_finder.rb +6 -1
- data/lib/tasks/gettext_rails_i18n.rake +5 -2
- metadata +3 -3
data/README.markdown
CHANGED
@@ -32,6 +32,9 @@ Copy default locales with dates/sentence-connectors/AR-errors you want from e.g.
|
|
32
32
|
config.gem "fast_gettext", :version => '>=0.4.8'
|
33
33
|
#only used for mo/po file generation in development, !do not load(:lib=>false), will needlessly eat ram!
|
34
34
|
config.gem "gettext", :lib => false, :version => '>=1.9.3'
|
35
|
+
# with bundler this would be
|
36
|
+
# gem "fast_gettext", '>=0.4.8'
|
37
|
+
# gem '>=1.9.3', "gettext", :require => false
|
35
38
|
end
|
36
39
|
|
37
40
|
#config/initialisers/fast_gettext.rb
|
@@ -134,6 +137,7 @@ Contributors
|
|
134
137
|
- [Paul McMahon](http://github.com/pwim)
|
135
138
|
- [Duncan Mac-Vicar P](http://duncan.mac-vicar.com/blog/)
|
136
139
|
- [Ramihajamalala Hery](http://my.rails-royce.org/)
|
140
|
+
- [J. Pablo Fernández](http://pupeno.com/)
|
137
141
|
|
138
142
|
[Michael Grosser](http://pragmatig.wordpress.com)
|
139
143
|
grosser.michael@gmail.com
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/gettext_i18n_rails.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{gettext_i18n_rails}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Grosser"]
|
12
|
-
s.date = %q{2010-06-
|
12
|
+
s.date = %q{2010-06-18}
|
13
13
|
s.email = %q{grosser.michael@gmail.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"README.markdown"
|
@@ -6,7 +6,12 @@ module GettextI18nRails
|
|
6
6
|
f.puts "#DO NOT MODIFY! AUTOMATICALLY GENERATED FILE!"
|
7
7
|
ModelAttributesFinder.new.find(options).each do |table_name,column_names|
|
8
8
|
#model name
|
9
|
-
|
9
|
+
begin
|
10
|
+
model = table_name.singularize.camelcase.constantize
|
11
|
+
rescue NameError
|
12
|
+
# Some tables are not models, for example: translation tables created by globalize2.
|
13
|
+
next
|
14
|
+
end
|
10
15
|
f.puts("_('#{model.human_name_without_translation}')")
|
11
16
|
|
12
17
|
#all columns namespaced under the model
|
@@ -16,9 +16,12 @@ namespace :gettext do
|
|
16
16
|
$LOAD_PATH << File.join(File.dirname(__FILE__),'..','..','lib')
|
17
17
|
require 'gettext_i18n_rails/haml_parser'
|
18
18
|
|
19
|
+
textdomain = (ENV['TEXTDOMAIN'] || "app")
|
20
|
+
|
21
|
+
|
19
22
|
if GetText.respond_to? :update_pofiles_org
|
20
23
|
GetText.update_pofiles_org(
|
21
|
-
|
24
|
+
textdomain,
|
22
25
|
Dir.glob("{app,lib,config,locale}/**/*.{rb,erb,haml}"),
|
23
26
|
"version 0.0.1",
|
24
27
|
:po_root => 'locale',
|
@@ -37,7 +40,7 @@ namespace :gettext do
|
|
37
40
|
|
38
41
|
#parse files.. (models are simply parsed as ruby files)
|
39
42
|
GetText.update_pofiles(
|
40
|
-
|
43
|
+
textdomain,
|
41
44
|
Dir.glob("{app,lib,config,locale}/**/*.{rb,erb,haml}"),
|
42
45
|
"version 0.0.1",
|
43
46
|
'locale'
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 4
|
9
|
+
version: 0.1.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Michael Grosser
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-06-
|
17
|
+
date: 2010-06-18 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|