ready_for_i18n 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +9 -6
- data/VERSION +1 -1
- data/bin/ready_for_i18n +1 -1
- data/ready_for_i18n.gemspec +2 -2
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,16 +1,19 @@
|
|
1
1
|
= ready_for_i18n
|
2
2
|
|
3
|
-
|
4
|
-
Rails project to an i18n one.
|
3
|
+
Ready_for_i18n is handy tool helping you in the first step of getting your local Rails project ready for I18N.
|
5
4
|
|
6
5
|
It will automatically extract hard-coded text from your ERB view file,
|
7
6
|
then choose a proper key and replace them with the I18n.translate method.
|
8
7
|
|
9
8
|
Currently two extractors are available:
|
10
9
|
|
11
|
-
|
12
|
-
|
10
|
+
* TextExtractor will scan all HTML text nodes in you view files, like <b>Hello</b> then replace it with <%=t(:text_hello)%>.
|
11
|
+
* LabelExtractor will scan all the text in helper methods like link_to('Login'...) and replace with link_to (t(:login)).
|
13
12
|
|
13
|
+
== Installation:
|
14
|
+
gem install ready_for_i18n
|
15
|
+
|
16
|
+
Hosed at http://www.gemcutter.org/gems/ready_for_i18n
|
14
17
|
|
15
18
|
== Basic Command Line Usage:
|
16
19
|
ready_for_i18n <path to ERB source files> <target path>
|
@@ -19,8 +22,8 @@ Your erb files in source path will be transformed(i18n_ready)
|
|
19
22
|
and copy to target file path,together with a locale file 'en.yml'.
|
20
23
|
|
21
24
|
Using the following options:
|
22
|
-
|
23
|
-
|
25
|
+
--locale [LOCALE] Generating for the specified locale (default locale 'en')
|
26
|
+
--ext [EXTENSION] The file extension name of your views(default '.html.erb')
|
24
27
|
|
25
28
|
== Note on Patches/Pull Requests
|
26
29
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
data/bin/ready_for_i18n
CHANGED
@@ -53,7 +53,7 @@ end
|
|
53
53
|
def excute(src_path,target_path,locale,extension)
|
54
54
|
ext = extension || '.html.erb'
|
55
55
|
dict = ReadyForI18N::LocaleDictionary.new(locale)
|
56
|
-
Dir.glob(File.join(src_path,"
|
56
|
+
Dir.glob(File.join(src_path,"**#{File::SEPARATOR}*#{ext}")).each do |f|
|
57
57
|
full_target_path = File.dirname(f).gsub(src_path,target_path)
|
58
58
|
FileUtils.makedirs full_target_path
|
59
59
|
target_file = File.join(full_target_path,File.basename(f))
|
data/ready_for_i18n.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ready_for_i18n}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["zigzag"]
|
12
|
-
s.date = %q{2009-12-
|
12
|
+
s.date = %q{2009-12-16}
|
13
13
|
s.default_executable = %q{ready_for_i18n}
|
14
14
|
s.description = %q{ ready_for_i18n will help you extract visible hard-coded text from your ERB view files,
|
15
15
|
then choose a proper key and replace them with the I18n.translate method like t(:login)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ready_for_i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zigzag
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-16 00:00:00 +08:00
|
13
13
|
default_executable: ready_for_i18n
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|