babelphish 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/README.rdoc +1 -1
- data/Rakefile +22 -0
- data/VERSION +1 -1
- data/babelphish.gemspec +5 -177
- data/bin/babelphish +0 -0
- data/lib/babelphish/html_translator.rb +1 -1
- data/lib/babelphish/yml_translator.rb +21 -11
- data/test/test_babelphish.rb +3 -3
- data/test/test_yml_translator.rb +3 -3
- data/test/translations/en.yml +1 -0
- metadata +25 -181
- data/test/html_translations/test.ar.html.erb +0 -4
- data/test/html_translations/test.bg.html.erb +0 -4
- data/test/html_translations/test.ca.html.erb +0 -4
- data/test/html_translations/test.cs.html.erb +0 -4
- data/test/html_translations/test.da.html.erb +0 -4
- data/test/html_translations/test.de.html.erb +0 -4
- data/test/html_translations/test.el.html.erb +0 -4
- data/test/html_translations/test.es.html.erb +0 -4
- data/test/html_translations/test.et.html.erb +0 -4
- data/test/html_translations/test.fa.html.erb +0 -4
- data/test/html_translations/test.fi.html.erb +0 -4
- data/test/html_translations/test.fr.html.erb +0 -4
- data/test/html_translations/test.gl.html.erb +0 -4
- data/test/html_translations/test.hi.html.erb +0 -4
- data/test/html_translations/test.hr.html.erb +0 -4
- data/test/html_translations/test.hu.html.erb +0 -4
- data/test/html_translations/test.id.html.erb +0 -4
- data/test/html_translations/test.it.html.erb +0 -4
- data/test/html_translations/test.iw.html.erb +0 -4
- data/test/html_translations/test.ja.html.erb +0 -4
- data/test/html_translations/test.ko.html.erb +0 -4
- data/test/html_translations/test.lt.html.erb +0 -4
- data/test/html_translations/test.lv.html.erb +0 -4
- data/test/html_translations/test.mt.html.erb +0 -4
- data/test/html_translations/test.nl.html.erb +0 -4
- data/test/html_translations/test.no.html.erb +0 -4
- data/test/html_translations/test.pl.html.erb +0 -4
- data/test/html_translations/test.pt-PT.html.erb +0 -4
- data/test/html_translations/test.ro.html.erb +0 -4
- data/test/html_translations/test.ru.html.erb +0 -4
- data/test/html_translations/test.sk.html.erb +0 -4
- data/test/html_translations/test.sl.html.erb +0 -4
- data/test/html_translations/test.sq.html.erb +0 -4
- data/test/html_translations/test.sr.html.erb +0 -4
- data/test/html_translations/test.sv.html.erb +0 -4
- data/test/html_translations/test.text.ar.html.erb +0 -5
- data/test/html_translations/test.text.ar.plain.erb +0 -8
- data/test/html_translations/test.text.bg.html.erb +0 -5
- data/test/html_translations/test.text.bg.plain.erb +0 -8
- data/test/html_translations/test.text.ca.html.erb +0 -5
- data/test/html_translations/test.text.ca.plain.erb +0 -8
- data/test/html_translations/test.text.cs.html.erb +0 -5
- data/test/html_translations/test.text.cs.plain.erb +0 -8
- data/test/html_translations/test.text.da.html.erb +0 -5
- data/test/html_translations/test.text.da.plain.erb +0 -8
- data/test/html_translations/test.text.de.html.erb +0 -5
- data/test/html_translations/test.text.de.plain.erb +0 -8
- data/test/html_translations/test.text.el.html.erb +0 -5
- data/test/html_translations/test.text.el.plain.erb +0 -8
- data/test/html_translations/test.text.es.html.erb +0 -5
- data/test/html_translations/test.text.es.plain.erb +0 -8
- data/test/html_translations/test.text.et.html.erb +0 -5
- data/test/html_translations/test.text.et.plain.erb +0 -8
- data/test/html_translations/test.text.fa.html.erb +0 -5
- data/test/html_translations/test.text.fa.plain.erb +0 -8
- data/test/html_translations/test.text.fi.html.erb +0 -5
- data/test/html_translations/test.text.fi.plain.erb +0 -8
- data/test/html_translations/test.text.fr.html.erb +0 -5
- data/test/html_translations/test.text.fr.plain.erb +0 -8
- data/test/html_translations/test.text.gl.html.erb +0 -5
- data/test/html_translations/test.text.gl.plain.erb +0 -8
- data/test/html_translations/test.text.hi.html.erb +0 -5
- data/test/html_translations/test.text.hi.plain.erb +0 -8
- data/test/html_translations/test.text.hr.html.erb +0 -5
- data/test/html_translations/test.text.hr.plain.erb +0 -8
- data/test/html_translations/test.text.hu.html.erb +0 -5
- data/test/html_translations/test.text.hu.plain.erb +0 -8
- data/test/html_translations/test.text.id.html.erb +0 -5
- data/test/html_translations/test.text.id.plain.erb +0 -8
- data/test/html_translations/test.text.it.html.erb +0 -5
- data/test/html_translations/test.text.it.plain.erb +0 -8
- data/test/html_translations/test.text.iw.html.erb +0 -5
- data/test/html_translations/test.text.iw.plain.erb +0 -8
- data/test/html_translations/test.text.ja.html.erb +0 -5
- data/test/html_translations/test.text.ja.plain.erb +0 -8
- data/test/html_translations/test.text.ko.html.erb +0 -5
- data/test/html_translations/test.text.ko.plain.erb +0 -8
- data/test/html_translations/test.text.lt.html.erb +0 -5
- data/test/html_translations/test.text.lt.plain.erb +0 -8
- data/test/html_translations/test.text.lv.html.erb +0 -5
- data/test/html_translations/test.text.lv.plain.erb +0 -8
- data/test/html_translations/test.text.mt.html.erb +0 -5
- data/test/html_translations/test.text.mt.plain.erb +0 -8
- data/test/html_translations/test.text.nl.html.erb +0 -5
- data/test/html_translations/test.text.nl.plain.erb +0 -8
- data/test/html_translations/test.text.no.html.erb +0 -5
- data/test/html_translations/test.text.no.plain.erb +0 -8
- data/test/html_translations/test.text.pl.html.erb +0 -5
- data/test/html_translations/test.text.pl.plain.erb +0 -8
- data/test/html_translations/test.text.pt-PT.html.erb +0 -5
- data/test/html_translations/test.text.pt-PT.plain.erb +0 -8
- data/test/html_translations/test.text.ro.html.erb +0 -5
- data/test/html_translations/test.text.ro.plain.erb +0 -8
- data/test/html_translations/test.text.ru.html.erb +0 -5
- data/test/html_translations/test.text.ru.plain.erb +0 -8
- data/test/html_translations/test.text.sk.html.erb +0 -5
- data/test/html_translations/test.text.sk.plain.erb +0 -8
- data/test/html_translations/test.text.sl.html.erb +0 -5
- data/test/html_translations/test.text.sl.plain.erb +0 -8
- data/test/html_translations/test.text.sq.html.erb +0 -5
- data/test/html_translations/test.text.sq.plain.erb +0 -8
- data/test/html_translations/test.text.sr.html.erb +0 -5
- data/test/html_translations/test.text.sr.plain.erb +0 -8
- data/test/html_translations/test.text.sv.html.erb +0 -5
- data/test/html_translations/test.text.sv.plain.erb +0 -8
- data/test/html_translations/test.text.th.html.erb +0 -5
- data/test/html_translations/test.text.th.plain.erb +0 -8
- data/test/html_translations/test.text.tl.html.erb +0 -5
- data/test/html_translations/test.text.tl.plain.erb +0 -8
- data/test/html_translations/test.text.tr.html.erb +0 -5
- data/test/html_translations/test.text.tr.plain.erb +0 -8
- data/test/html_translations/test.text.uk.html.erb +0 -5
- data/test/html_translations/test.text.uk.plain.erb +0 -8
- data/test/html_translations/test.text.vi.html.erb +0 -5
- data/test/html_translations/test.text.vi.plain.erb +0 -8
- data/test/html_translations/test.text.zh-CN.html.erb +0 -5
- data/test/html_translations/test.text.zh-CN.plain.erb +0 -8
- data/test/html_translations/test.text.zh-TW.html.erb +0 -5
- data/test/html_translations/test.text.zh-TW.plain.erb +0 -8
- data/test/html_translations/test.text.zh.html.erb +0 -5
- data/test/html_translations/test.text.zh.plain.erb +0 -8
- data/test/html_translations/test.th.html.erb +0 -4
- data/test/html_translations/test.tl.html.erb +0 -4
- data/test/html_translations/test.tr.html.erb +0 -4
- data/test/html_translations/test.uk.html.erb +0 -4
- data/test/html_translations/test.vi.html.erb +0 -4
- data/test/html_translations/test.zh-CN.html.erb +0 -4
- data/test/html_translations/test.zh-TW.html.erb +0 -4
- data/test/html_translations/test.zh.html.erb +0 -4
- data/test/translations/ar.yml +0 -7
- data/test/translations/bg.yml +0 -7
- data/test/translations/ca.yml +0 -7
- data/test/translations/cs.yml +0 -7
- data/test/translations/da.yml +0 -7
- data/test/translations/de.yml +0 -7
- data/test/translations/el.yml +0 -7
- data/test/translations/es.yml +0 -7
- data/test/translations/et.yml +0 -7
- data/test/translations/fa.yml +0 -7
- data/test/translations/fi.yml +0 -7
- data/test/translations/fr.yml +0 -7
- data/test/translations/gl.yml +0 -7
- data/test/translations/hi.yml +0 -7
- data/test/translations/hr.yml +0 -7
- data/test/translations/hu.yml +0 -7
- data/test/translations/id.yml +0 -7
- data/test/translations/it.yml +0 -7
- data/test/translations/iw.yml +0 -7
- data/test/translations/ja.yml +0 -7
- data/test/translations/ko.yml +0 -7
- data/test/translations/lt.yml +0 -7
- data/test/translations/lv.yml +0 -7
- data/test/translations/mt.yml +0 -7
- data/test/translations/nl.yml +0 -7
- data/test/translations/no.yml +0 -8
- data/test/translations/pl.yml +0 -7
- data/test/translations/pt-PT.yml +0 -7
- data/test/translations/ro.yml +0 -7
- data/test/translations/ru.yml +0 -7
- data/test/translations/sk.yml +0 -7
- data/test/translations/sl.yml +0 -7
- data/test/translations/sq.yml +0 -7
- data/test/translations/sr.yml +0 -7
- data/test/translations/sv.yml +0 -7
- data/test/translations/th.yml +0 -7
- data/test/translations/tl.yml +0 -7
- data/test/translations/tr.yml +0 -7
- data/test/translations/uk.yml +0 -7
- data/test/translations/vi.yml +0 -7
- data/test/translations/zh-CN.yml +0 -7
- data/test/translations/zh-TW.yml +0 -7
- data/test/translations/zh.yml +0 -7
data/.gitignore
CHANGED
data/README.rdoc
CHANGED
@@ -145,7 +145,7 @@ VIETNAMESE = 'vi'
|
|
145
145
|
|
146
146
|
(The MIT License)
|
147
147
|
|
148
|
-
Copyright (c) 2009 Justin Ball
|
148
|
+
Copyright (c) 2009-2010 Justin Ball
|
149
149
|
|
150
150
|
Permission is hereby granted, free of charge, to any person obtaining
|
151
151
|
a copy of this software and associated documentation files (the
|
data/Rakefile
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/rdoctask'
|
4
|
+
require 'rake/testtask'
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << 'lib'
|
8
|
+
t.libs << 'test'
|
9
|
+
t.pattern = 'test/test_*.rb'
|
10
|
+
t.verbose = false
|
11
|
+
end
|
12
|
+
|
13
|
+
task :default => :test
|
14
|
+
|
15
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
17
|
+
rdoc.title = 'BabelPhish'
|
18
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
+
end
|
22
|
+
|
1
23
|
begin
|
2
24
|
require 'jeweler'
|
3
25
|
Jeweler::Tasks.new do |gem|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.8
|
data/babelphish.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{babelphish}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Justin Ball"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2010-08-28}
|
13
13
|
s.default_executable = %q{babelphish}
|
14
14
|
s.description = %q{Babelphish helps you make a quick translation of your application using Google Translate.}
|
15
15
|
s.email = %q{justinball@gmail.com}
|
@@ -62,192 +62,20 @@ Gem::Specification.new do |s|
|
|
62
62
|
"script/destroy",
|
63
63
|
"script/generate",
|
64
64
|
"script/txt2html",
|
65
|
-
"test/html_translations/test.ar.html.erb",
|
66
|
-
"test/html_translations/test.bg.html.erb",
|
67
|
-
"test/html_translations/test.ca.html.erb",
|
68
|
-
"test/html_translations/test.cs.html.erb",
|
69
|
-
"test/html_translations/test.da.html.erb",
|
70
|
-
"test/html_translations/test.de.html.erb",
|
71
|
-
"test/html_translations/test.el.html.erb",
|
72
|
-
"test/html_translations/test.es.html.erb",
|
73
|
-
"test/html_translations/test.et.html.erb",
|
74
|
-
"test/html_translations/test.fa.html.erb",
|
75
|
-
"test/html_translations/test.fi.html.erb",
|
76
|
-
"test/html_translations/test.fr.html.erb",
|
77
|
-
"test/html_translations/test.gl.html.erb",
|
78
|
-
"test/html_translations/test.hi.html.erb",
|
79
|
-
"test/html_translations/test.hr.html.erb",
|
80
65
|
"test/html_translations/test.html.erb",
|
81
|
-
"test/html_translations/test.hu.html.erb",
|
82
|
-
"test/html_translations/test.id.html.erb",
|
83
|
-
"test/html_translations/test.it.html.erb",
|
84
|
-
"test/html_translations/test.iw.html.erb",
|
85
|
-
"test/html_translations/test.ja.html.erb",
|
86
|
-
"test/html_translations/test.ko.html.erb",
|
87
|
-
"test/html_translations/test.lt.html.erb",
|
88
|
-
"test/html_translations/test.lv.html.erb",
|
89
|
-
"test/html_translations/test.mt.html.erb",
|
90
|
-
"test/html_translations/test.nl.html.erb",
|
91
|
-
"test/html_translations/test.no.html.erb",
|
92
|
-
"test/html_translations/test.pl.html.erb",
|
93
|
-
"test/html_translations/test.pt-PT.html.erb",
|
94
|
-
"test/html_translations/test.ro.html.erb",
|
95
|
-
"test/html_translations/test.ru.html.erb",
|
96
|
-
"test/html_translations/test.sk.html.erb",
|
97
|
-
"test/html_translations/test.sl.html.erb",
|
98
|
-
"test/html_translations/test.sq.html.erb",
|
99
|
-
"test/html_translations/test.sr.html.erb",
|
100
|
-
"test/html_translations/test.sv.html.erb",
|
101
|
-
"test/html_translations/test.text.ar.html.erb",
|
102
|
-
"test/html_translations/test.text.ar.plain.erb",
|
103
|
-
"test/html_translations/test.text.bg.html.erb",
|
104
|
-
"test/html_translations/test.text.bg.plain.erb",
|
105
|
-
"test/html_translations/test.text.ca.html.erb",
|
106
|
-
"test/html_translations/test.text.ca.plain.erb",
|
107
|
-
"test/html_translations/test.text.cs.html.erb",
|
108
|
-
"test/html_translations/test.text.cs.plain.erb",
|
109
|
-
"test/html_translations/test.text.da.html.erb",
|
110
|
-
"test/html_translations/test.text.da.plain.erb",
|
111
|
-
"test/html_translations/test.text.de.html.erb",
|
112
|
-
"test/html_translations/test.text.de.plain.erb",
|
113
|
-
"test/html_translations/test.text.el.html.erb",
|
114
|
-
"test/html_translations/test.text.el.plain.erb",
|
115
|
-
"test/html_translations/test.text.es.html.erb",
|
116
|
-
"test/html_translations/test.text.es.plain.erb",
|
117
|
-
"test/html_translations/test.text.et.html.erb",
|
118
|
-
"test/html_translations/test.text.et.plain.erb",
|
119
|
-
"test/html_translations/test.text.fa.html.erb",
|
120
|
-
"test/html_translations/test.text.fa.plain.erb",
|
121
|
-
"test/html_translations/test.text.fi.html.erb",
|
122
|
-
"test/html_translations/test.text.fi.plain.erb",
|
123
|
-
"test/html_translations/test.text.fr.html.erb",
|
124
|
-
"test/html_translations/test.text.fr.plain.erb",
|
125
|
-
"test/html_translations/test.text.gl.html.erb",
|
126
|
-
"test/html_translations/test.text.gl.plain.erb",
|
127
|
-
"test/html_translations/test.text.hi.html.erb",
|
128
|
-
"test/html_translations/test.text.hi.plain.erb",
|
129
|
-
"test/html_translations/test.text.hr.html.erb",
|
130
|
-
"test/html_translations/test.text.hr.plain.erb",
|
131
66
|
"test/html_translations/test.text.html.erb",
|
132
|
-
"test/html_translations/test.text.hu.html.erb",
|
133
|
-
"test/html_translations/test.text.hu.plain.erb",
|
134
|
-
"test/html_translations/test.text.id.html.erb",
|
135
|
-
"test/html_translations/test.text.id.plain.erb",
|
136
|
-
"test/html_translations/test.text.it.html.erb",
|
137
|
-
"test/html_translations/test.text.it.plain.erb",
|
138
|
-
"test/html_translations/test.text.iw.html.erb",
|
139
|
-
"test/html_translations/test.text.iw.plain.erb",
|
140
|
-
"test/html_translations/test.text.ja.html.erb",
|
141
|
-
"test/html_translations/test.text.ja.plain.erb",
|
142
|
-
"test/html_translations/test.text.ko.html.erb",
|
143
|
-
"test/html_translations/test.text.ko.plain.erb",
|
144
|
-
"test/html_translations/test.text.lt.html.erb",
|
145
|
-
"test/html_translations/test.text.lt.plain.erb",
|
146
|
-
"test/html_translations/test.text.lv.html.erb",
|
147
|
-
"test/html_translations/test.text.lv.plain.erb",
|
148
|
-
"test/html_translations/test.text.mt.html.erb",
|
149
|
-
"test/html_translations/test.text.mt.plain.erb",
|
150
|
-
"test/html_translations/test.text.nl.html.erb",
|
151
|
-
"test/html_translations/test.text.nl.plain.erb",
|
152
|
-
"test/html_translations/test.text.no.html.erb",
|
153
|
-
"test/html_translations/test.text.no.plain.erb",
|
154
|
-
"test/html_translations/test.text.pl.html.erb",
|
155
|
-
"test/html_translations/test.text.pl.plain.erb",
|
156
67
|
"test/html_translations/test.text.plain.erb",
|
157
|
-
"test/html_translations/test.text.pt-PT.html.erb",
|
158
|
-
"test/html_translations/test.text.pt-PT.plain.erb",
|
159
|
-
"test/html_translations/test.text.ro.html.erb",
|
160
|
-
"test/html_translations/test.text.ro.plain.erb",
|
161
|
-
"test/html_translations/test.text.ru.html.erb",
|
162
|
-
"test/html_translations/test.text.ru.plain.erb",
|
163
|
-
"test/html_translations/test.text.sk.html.erb",
|
164
|
-
"test/html_translations/test.text.sk.plain.erb",
|
165
|
-
"test/html_translations/test.text.sl.html.erb",
|
166
|
-
"test/html_translations/test.text.sl.plain.erb",
|
167
|
-
"test/html_translations/test.text.sq.html.erb",
|
168
|
-
"test/html_translations/test.text.sq.plain.erb",
|
169
|
-
"test/html_translations/test.text.sr.html.erb",
|
170
|
-
"test/html_translations/test.text.sr.plain.erb",
|
171
|
-
"test/html_translations/test.text.sv.html.erb",
|
172
|
-
"test/html_translations/test.text.sv.plain.erb",
|
173
|
-
"test/html_translations/test.text.th.html.erb",
|
174
|
-
"test/html_translations/test.text.th.plain.erb",
|
175
|
-
"test/html_translations/test.text.tl.html.erb",
|
176
|
-
"test/html_translations/test.text.tl.plain.erb",
|
177
|
-
"test/html_translations/test.text.tr.html.erb",
|
178
|
-
"test/html_translations/test.text.tr.plain.erb",
|
179
|
-
"test/html_translations/test.text.uk.html.erb",
|
180
|
-
"test/html_translations/test.text.uk.plain.erb",
|
181
|
-
"test/html_translations/test.text.vi.html.erb",
|
182
|
-
"test/html_translations/test.text.vi.plain.erb",
|
183
|
-
"test/html_translations/test.text.zh-CN.html.erb",
|
184
|
-
"test/html_translations/test.text.zh-CN.plain.erb",
|
185
|
-
"test/html_translations/test.text.zh-TW.html.erb",
|
186
|
-
"test/html_translations/test.text.zh-TW.plain.erb",
|
187
|
-
"test/html_translations/test.text.zh.html.erb",
|
188
|
-
"test/html_translations/test.text.zh.plain.erb",
|
189
|
-
"test/html_translations/test.th.html.erb",
|
190
|
-
"test/html_translations/test.tl.html.erb",
|
191
|
-
"test/html_translations/test.tr.html.erb",
|
192
|
-
"test/html_translations/test.uk.html.erb",
|
193
|
-
"test/html_translations/test.vi.html.erb",
|
194
|
-
"test/html_translations/test.zh-CN.html.erb",
|
195
|
-
"test/html_translations/test.zh-TW.html.erb",
|
196
|
-
"test/html_translations/test.zh.html.erb",
|
197
68
|
"test/test_babelphish.rb",
|
198
69
|
"test/test_helper.rb",
|
199
70
|
"test/test_html_translator.rb",
|
200
71
|
"test/test_yml_translator.rb",
|
201
|
-
"test/translations/
|
202
|
-
"test/translations/bg.yml",
|
203
|
-
"test/translations/ca.yml",
|
204
|
-
"test/translations/cs.yml",
|
205
|
-
"test/translations/da.yml",
|
206
|
-
"test/translations/de.yml",
|
207
|
-
"test/translations/el.yml",
|
208
|
-
"test/translations/en.yml",
|
209
|
-
"test/translations/es.yml",
|
210
|
-
"test/translations/et.yml",
|
211
|
-
"test/translations/fa.yml",
|
212
|
-
"test/translations/fi.yml",
|
213
|
-
"test/translations/fr.yml",
|
214
|
-
"test/translations/gl.yml",
|
215
|
-
"test/translations/hi.yml",
|
216
|
-
"test/translations/hr.yml",
|
217
|
-
"test/translations/hu.yml",
|
218
|
-
"test/translations/id.yml",
|
219
|
-
"test/translations/it.yml",
|
220
|
-
"test/translations/iw.yml",
|
221
|
-
"test/translations/ja.yml",
|
222
|
-
"test/translations/ko.yml",
|
223
|
-
"test/translations/lt.yml",
|
224
|
-
"test/translations/lv.yml",
|
225
|
-
"test/translations/mt.yml",
|
226
|
-
"test/translations/nl.yml",
|
227
|
-
"test/translations/no.yml",
|
228
|
-
"test/translations/pl.yml",
|
229
|
-
"test/translations/pt-PT.yml",
|
230
|
-
"test/translations/ro.yml",
|
231
|
-
"test/translations/ru.yml",
|
232
|
-
"test/translations/sk.yml",
|
233
|
-
"test/translations/sl.yml",
|
234
|
-
"test/translations/sq.yml",
|
235
|
-
"test/translations/sr.yml",
|
236
|
-
"test/translations/sv.yml",
|
237
|
-
"test/translations/th.yml",
|
238
|
-
"test/translations/tl.yml",
|
239
|
-
"test/translations/tr.yml",
|
240
|
-
"test/translations/uk.yml",
|
241
|
-
"test/translations/vi.yml",
|
242
|
-
"test/translations/zh-CN.yml",
|
243
|
-
"test/translations/zh-TW.yml",
|
244
|
-
"test/translations/zh.yml"
|
72
|
+
"test/translations/en.yml"
|
245
73
|
]
|
246
74
|
s.homepage = %q{http://github.com/jbasdf/babelphish}
|
247
75
|
s.rdoc_options = ["--charset=UTF-8"]
|
248
76
|
s.require_paths = ["lib"]
|
249
77
|
s.rubyforge_project = %q{babelphish}
|
250
|
-
s.rubygems_version = %q{1.3.
|
78
|
+
s.rubygems_version = %q{1.3.7}
|
251
79
|
s.summary = %q{Translate with Google like a fule => 'fool'}
|
252
80
|
s.test_files = [
|
253
81
|
"test/test_babelphish.rb",
|
@@ -260,7 +88,7 @@ Gem::Specification.new do |s|
|
|
260
88
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
261
89
|
s.specification_version = 3
|
262
90
|
|
263
|
-
if Gem::Version.new(Gem::
|
91
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
264
92
|
s.add_runtime_dependency(%q<ya2yaml>, [">= 0"])
|
265
93
|
else
|
266
94
|
s.add_dependency(%q<ya2yaml>, [">= 0"])
|
data/bin/babelphish
CHANGED
File without changes
|
@@ -2,6 +2,7 @@ module Babelphish
|
|
2
2
|
module YmlTranslator
|
3
3
|
|
4
4
|
SUBSTITUTION_PLACE_HOLDER = '{{---}}'
|
5
|
+
SUBSTITUTION_PLACE_HOLDER_2 = '-.-.-'
|
5
6
|
|
6
7
|
class << self
|
7
8
|
|
@@ -52,11 +53,9 @@ module Babelphish
|
|
52
53
|
elsif key == true
|
53
54
|
puts "Key #{key} was evaluated as true. Check your yml file and be sure to escape values like yes with 'yes'. ie 'yes': 'Yes'"
|
54
55
|
elsif !translate_hash[key].nil?
|
55
|
-
|
56
|
+
add_substitutions(translate_hash[key])
|
56
57
|
translate_hash[key] = Babelphish::Translator.translate(translate_hash[key], to, from)
|
57
|
-
|
58
|
-
translate_hash[key].sub!(SUBSTITUTION_PLACE_HOLDER, r)
|
59
|
-
end
|
58
|
+
remove_substitutions(translate_hash[key])
|
60
59
|
else
|
61
60
|
puts "Key #{key} contains no data"
|
62
61
|
end
|
@@ -104,12 +103,10 @@ module Babelphish
|
|
104
103
|
elsif key == true
|
105
104
|
puts "Key #{key} was evaluated as true. Check your yml file and be sure it does not include values like yes: Yes"
|
106
105
|
elsif !translate_hash[key].nil?
|
107
|
-
|
106
|
+
add_substitutions(translate_hash[key])
|
108
107
|
translations = Babelphish::Translator.multiple_translate(translate_hash[key], tos, from)
|
109
108
|
translations.each_key do |locale|
|
110
|
-
|
111
|
-
translations[locale].sub!(SUBSTITUTION_PLACE_HOLDER, r)
|
112
|
-
end
|
109
|
+
remove_substitutions(translations[locale])
|
113
110
|
end
|
114
111
|
translate_hash[key] = translations
|
115
112
|
else
|
@@ -119,14 +116,27 @@ module Babelphish
|
|
119
116
|
end
|
120
117
|
end
|
121
118
|
|
122
|
-
def
|
119
|
+
def add_substitutions(translate_text)
|
123
120
|
# pull out all the string substitutions so that google doesn't translate those
|
124
121
|
pattern = /\{\{.+?\}\}/ # non greedy pattern match so that we properly match strings like: "{{name}} on {{application_name}}"
|
125
|
-
replacements = translate_text.scan(pattern)
|
122
|
+
@replacements = translate_text.scan(pattern)
|
126
123
|
translate_text.gsub!(pattern, SUBSTITUTION_PLACE_HOLDER)
|
127
|
-
|
124
|
+
|
125
|
+
# Pull out all the translation blocks so Google doesn't mess with those
|
126
|
+
pattern = /%\{.+?\}/
|
127
|
+
@replacements2 = translate_text.scan(pattern)
|
128
|
+
translate_text.gsub!(pattern, SUBSTITUTION_PLACE_HOLDER_2)
|
128
129
|
end
|
129
130
|
|
131
|
+
def remove_substitutions(translate_text)
|
132
|
+
@replacements.each do |r|
|
133
|
+
translate_text.sub!(SUBSTITUTION_PLACE_HOLDER, r)
|
134
|
+
end
|
135
|
+
@replacements2.each do |r|
|
136
|
+
translate_text.sub!(SUBSTITUTION_PLACE_HOLDER_2, r)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
130
140
|
end
|
131
141
|
end
|
132
142
|
end
|
data/test/test_babelphish.rb
CHANGED
@@ -4,7 +4,7 @@ class TestBabelphish < Test::Unit::TestCase
|
|
4
4
|
|
5
5
|
def test_translate
|
6
6
|
translation = Babelphish::Translator.translate('hello', 'es', 'en')
|
7
|
-
assert_equal '
|
7
|
+
assert_equal '¡Hola', translation
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_run_each_language
|
@@ -19,10 +19,10 @@ class TestBabelphish < Test::Unit::TestCase
|
|
19
19
|
|
20
20
|
def test_multiple_translate
|
21
21
|
translations = Babelphish::Translator.multiple_translate('hello', Babelphish::GoogleTranslate::LANGUAGES, 'en')
|
22
|
-
assert_equal '
|
22
|
+
assert_equal '¡Hola', translations[Babelphish::GoogleTranslate::SPANISH]
|
23
23
|
assert_equal 'hallo', translations[Babelphish::GoogleTranslate::GERMAN]
|
24
24
|
assert_equal 'ciao', translations[Babelphish::GoogleTranslate::ITALIAN]
|
25
|
-
assert_equal '
|
25
|
+
assert_equal 'alo', translations[Babelphish::GoogleTranslate::ROMANIAN]
|
26
26
|
assert_equal 'こんにちは', translations[Babelphish::GoogleTranslate::JAPANESE]
|
27
27
|
end
|
28
28
|
|
data/test/test_yml_translator.rb
CHANGED
@@ -11,9 +11,9 @@ class TestYmlTranslator < Test::Unit::TestCase
|
|
11
11
|
translation = YAML.load_file(translated_yml)
|
12
12
|
assert translation['es']
|
13
13
|
assert translation['es']['babelphish']
|
14
|
-
assert_equal "
|
15
|
-
assert_equal "Esto es una
|
16
|
-
assert_equal "Esta es una cadena con
|
14
|
+
assert_equal "Se trata de un nivel inferior", translation['es']['babelphish']['more']['test_more']
|
15
|
+
assert_equal "Esto es una cadena de prueba", translation['es']['babelphish']['test']
|
16
|
+
assert_equal "Esta es una cadena con incrustación {{insert}}", translation['es']['babelphish']['test_embedded']
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_multiple_yml_translation
|
data/test/translations/en.yml
CHANGED
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: babelphish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 7
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 8
|
10
|
+
version: 0.2.8
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Justin Ball
|
@@ -9,19 +15,23 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
18
|
+
date: 2010-08-28 00:00:00 -06:00
|
13
19
|
default_executable: babelphish
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: ya2yaml
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
23
32
|
version: "0"
|
24
|
-
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
25
35
|
description: Babelphish helps you make a quick translation of your application using Google Translate.
|
26
36
|
email: justinball@gmail.com
|
27
37
|
executables:
|
@@ -75,186 +85,14 @@ files:
|
|
75
85
|
- script/destroy
|
76
86
|
- script/generate
|
77
87
|
- script/txt2html
|
78
|
-
- test/html_translations/test.ar.html.erb
|
79
|
-
- test/html_translations/test.bg.html.erb
|
80
|
-
- test/html_translations/test.ca.html.erb
|
81
|
-
- test/html_translations/test.cs.html.erb
|
82
|
-
- test/html_translations/test.da.html.erb
|
83
|
-
- test/html_translations/test.de.html.erb
|
84
|
-
- test/html_translations/test.el.html.erb
|
85
|
-
- test/html_translations/test.es.html.erb
|
86
|
-
- test/html_translations/test.et.html.erb
|
87
|
-
- test/html_translations/test.fa.html.erb
|
88
|
-
- test/html_translations/test.fi.html.erb
|
89
|
-
- test/html_translations/test.fr.html.erb
|
90
|
-
- test/html_translations/test.gl.html.erb
|
91
|
-
- test/html_translations/test.hi.html.erb
|
92
|
-
- test/html_translations/test.hr.html.erb
|
93
88
|
- test/html_translations/test.html.erb
|
94
|
-
- test/html_translations/test.hu.html.erb
|
95
|
-
- test/html_translations/test.id.html.erb
|
96
|
-
- test/html_translations/test.it.html.erb
|
97
|
-
- test/html_translations/test.iw.html.erb
|
98
|
-
- test/html_translations/test.ja.html.erb
|
99
|
-
- test/html_translations/test.ko.html.erb
|
100
|
-
- test/html_translations/test.lt.html.erb
|
101
|
-
- test/html_translations/test.lv.html.erb
|
102
|
-
- test/html_translations/test.mt.html.erb
|
103
|
-
- test/html_translations/test.nl.html.erb
|
104
|
-
- test/html_translations/test.no.html.erb
|
105
|
-
- test/html_translations/test.pl.html.erb
|
106
|
-
- test/html_translations/test.pt-PT.html.erb
|
107
|
-
- test/html_translations/test.ro.html.erb
|
108
|
-
- test/html_translations/test.ru.html.erb
|
109
|
-
- test/html_translations/test.sk.html.erb
|
110
|
-
- test/html_translations/test.sl.html.erb
|
111
|
-
- test/html_translations/test.sq.html.erb
|
112
|
-
- test/html_translations/test.sr.html.erb
|
113
|
-
- test/html_translations/test.sv.html.erb
|
114
|
-
- test/html_translations/test.text.ar.html.erb
|
115
|
-
- test/html_translations/test.text.ar.plain.erb
|
116
|
-
- test/html_translations/test.text.bg.html.erb
|
117
|
-
- test/html_translations/test.text.bg.plain.erb
|
118
|
-
- test/html_translations/test.text.ca.html.erb
|
119
|
-
- test/html_translations/test.text.ca.plain.erb
|
120
|
-
- test/html_translations/test.text.cs.html.erb
|
121
|
-
- test/html_translations/test.text.cs.plain.erb
|
122
|
-
- test/html_translations/test.text.da.html.erb
|
123
|
-
- test/html_translations/test.text.da.plain.erb
|
124
|
-
- test/html_translations/test.text.de.html.erb
|
125
|
-
- test/html_translations/test.text.de.plain.erb
|
126
|
-
- test/html_translations/test.text.el.html.erb
|
127
|
-
- test/html_translations/test.text.el.plain.erb
|
128
|
-
- test/html_translations/test.text.es.html.erb
|
129
|
-
- test/html_translations/test.text.es.plain.erb
|
130
|
-
- test/html_translations/test.text.et.html.erb
|
131
|
-
- test/html_translations/test.text.et.plain.erb
|
132
|
-
- test/html_translations/test.text.fa.html.erb
|
133
|
-
- test/html_translations/test.text.fa.plain.erb
|
134
|
-
- test/html_translations/test.text.fi.html.erb
|
135
|
-
- test/html_translations/test.text.fi.plain.erb
|
136
|
-
- test/html_translations/test.text.fr.html.erb
|
137
|
-
- test/html_translations/test.text.fr.plain.erb
|
138
|
-
- test/html_translations/test.text.gl.html.erb
|
139
|
-
- test/html_translations/test.text.gl.plain.erb
|
140
|
-
- test/html_translations/test.text.hi.html.erb
|
141
|
-
- test/html_translations/test.text.hi.plain.erb
|
142
|
-
- test/html_translations/test.text.hr.html.erb
|
143
|
-
- test/html_translations/test.text.hr.plain.erb
|
144
89
|
- test/html_translations/test.text.html.erb
|
145
|
-
- test/html_translations/test.text.hu.html.erb
|
146
|
-
- test/html_translations/test.text.hu.plain.erb
|
147
|
-
- test/html_translations/test.text.id.html.erb
|
148
|
-
- test/html_translations/test.text.id.plain.erb
|
149
|
-
- test/html_translations/test.text.it.html.erb
|
150
|
-
- test/html_translations/test.text.it.plain.erb
|
151
|
-
- test/html_translations/test.text.iw.html.erb
|
152
|
-
- test/html_translations/test.text.iw.plain.erb
|
153
|
-
- test/html_translations/test.text.ja.html.erb
|
154
|
-
- test/html_translations/test.text.ja.plain.erb
|
155
|
-
- test/html_translations/test.text.ko.html.erb
|
156
|
-
- test/html_translations/test.text.ko.plain.erb
|
157
|
-
- test/html_translations/test.text.lt.html.erb
|
158
|
-
- test/html_translations/test.text.lt.plain.erb
|
159
|
-
- test/html_translations/test.text.lv.html.erb
|
160
|
-
- test/html_translations/test.text.lv.plain.erb
|
161
|
-
- test/html_translations/test.text.mt.html.erb
|
162
|
-
- test/html_translations/test.text.mt.plain.erb
|
163
|
-
- test/html_translations/test.text.nl.html.erb
|
164
|
-
- test/html_translations/test.text.nl.plain.erb
|
165
|
-
- test/html_translations/test.text.no.html.erb
|
166
|
-
- test/html_translations/test.text.no.plain.erb
|
167
|
-
- test/html_translations/test.text.pl.html.erb
|
168
|
-
- test/html_translations/test.text.pl.plain.erb
|
169
90
|
- test/html_translations/test.text.plain.erb
|
170
|
-
- test/html_translations/test.text.pt-PT.html.erb
|
171
|
-
- test/html_translations/test.text.pt-PT.plain.erb
|
172
|
-
- test/html_translations/test.text.ro.html.erb
|
173
|
-
- test/html_translations/test.text.ro.plain.erb
|
174
|
-
- test/html_translations/test.text.ru.html.erb
|
175
|
-
- test/html_translations/test.text.ru.plain.erb
|
176
|
-
- test/html_translations/test.text.sk.html.erb
|
177
|
-
- test/html_translations/test.text.sk.plain.erb
|
178
|
-
- test/html_translations/test.text.sl.html.erb
|
179
|
-
- test/html_translations/test.text.sl.plain.erb
|
180
|
-
- test/html_translations/test.text.sq.html.erb
|
181
|
-
- test/html_translations/test.text.sq.plain.erb
|
182
|
-
- test/html_translations/test.text.sr.html.erb
|
183
|
-
- test/html_translations/test.text.sr.plain.erb
|
184
|
-
- test/html_translations/test.text.sv.html.erb
|
185
|
-
- test/html_translations/test.text.sv.plain.erb
|
186
|
-
- test/html_translations/test.text.th.html.erb
|
187
|
-
- test/html_translations/test.text.th.plain.erb
|
188
|
-
- test/html_translations/test.text.tl.html.erb
|
189
|
-
- test/html_translations/test.text.tl.plain.erb
|
190
|
-
- test/html_translations/test.text.tr.html.erb
|
191
|
-
- test/html_translations/test.text.tr.plain.erb
|
192
|
-
- test/html_translations/test.text.uk.html.erb
|
193
|
-
- test/html_translations/test.text.uk.plain.erb
|
194
|
-
- test/html_translations/test.text.vi.html.erb
|
195
|
-
- test/html_translations/test.text.vi.plain.erb
|
196
|
-
- test/html_translations/test.text.zh-CN.html.erb
|
197
|
-
- test/html_translations/test.text.zh-CN.plain.erb
|
198
|
-
- test/html_translations/test.text.zh-TW.html.erb
|
199
|
-
- test/html_translations/test.text.zh-TW.plain.erb
|
200
|
-
- test/html_translations/test.text.zh.html.erb
|
201
|
-
- test/html_translations/test.text.zh.plain.erb
|
202
|
-
- test/html_translations/test.th.html.erb
|
203
|
-
- test/html_translations/test.tl.html.erb
|
204
|
-
- test/html_translations/test.tr.html.erb
|
205
|
-
- test/html_translations/test.uk.html.erb
|
206
|
-
- test/html_translations/test.vi.html.erb
|
207
|
-
- test/html_translations/test.zh-CN.html.erb
|
208
|
-
- test/html_translations/test.zh-TW.html.erb
|
209
|
-
- test/html_translations/test.zh.html.erb
|
210
91
|
- test/test_babelphish.rb
|
211
92
|
- test/test_helper.rb
|
212
93
|
- test/test_html_translator.rb
|
213
94
|
- test/test_yml_translator.rb
|
214
|
-
- test/translations/ar.yml
|
215
|
-
- test/translations/bg.yml
|
216
|
-
- test/translations/ca.yml
|
217
|
-
- test/translations/cs.yml
|
218
|
-
- test/translations/da.yml
|
219
|
-
- test/translations/de.yml
|
220
|
-
- test/translations/el.yml
|
221
95
|
- test/translations/en.yml
|
222
|
-
- test/translations/es.yml
|
223
|
-
- test/translations/et.yml
|
224
|
-
- test/translations/fa.yml
|
225
|
-
- test/translations/fi.yml
|
226
|
-
- test/translations/fr.yml
|
227
|
-
- test/translations/gl.yml
|
228
|
-
- test/translations/hi.yml
|
229
|
-
- test/translations/hr.yml
|
230
|
-
- test/translations/hu.yml
|
231
|
-
- test/translations/id.yml
|
232
|
-
- test/translations/it.yml
|
233
|
-
- test/translations/iw.yml
|
234
|
-
- test/translations/ja.yml
|
235
|
-
- test/translations/ko.yml
|
236
|
-
- test/translations/lt.yml
|
237
|
-
- test/translations/lv.yml
|
238
|
-
- test/translations/mt.yml
|
239
|
-
- test/translations/nl.yml
|
240
|
-
- test/translations/no.yml
|
241
|
-
- test/translations/pl.yml
|
242
|
-
- test/translations/pt-PT.yml
|
243
|
-
- test/translations/ro.yml
|
244
|
-
- test/translations/ru.yml
|
245
|
-
- test/translations/sk.yml
|
246
|
-
- test/translations/sl.yml
|
247
|
-
- test/translations/sq.yml
|
248
|
-
- test/translations/sr.yml
|
249
|
-
- test/translations/sv.yml
|
250
|
-
- test/translations/th.yml
|
251
|
-
- test/translations/tl.yml
|
252
|
-
- test/translations/tr.yml
|
253
|
-
- test/translations/uk.yml
|
254
|
-
- test/translations/vi.yml
|
255
|
-
- test/translations/zh-CN.yml
|
256
|
-
- test/translations/zh-TW.yml
|
257
|
-
- test/translations/zh.yml
|
258
96
|
has_rdoc: true
|
259
97
|
homepage: http://github.com/jbasdf/babelphish
|
260
98
|
licenses: []
|
@@ -265,21 +103,27 @@ rdoc_options:
|
|
265
103
|
require_paths:
|
266
104
|
- lib
|
267
105
|
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
268
107
|
requirements:
|
269
108
|
- - ">="
|
270
109
|
- !ruby/object:Gem::Version
|
110
|
+
hash: 3
|
111
|
+
segments:
|
112
|
+
- 0
|
271
113
|
version: "0"
|
272
|
-
version:
|
273
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
274
116
|
requirements:
|
275
117
|
- - ">="
|
276
118
|
- !ruby/object:Gem::Version
|
119
|
+
hash: 3
|
120
|
+
segments:
|
121
|
+
- 0
|
277
122
|
version: "0"
|
278
|
-
version:
|
279
123
|
requirements: []
|
280
124
|
|
281
125
|
rubyforge_project: babelphish
|
282
|
-
rubygems_version: 1.3.
|
126
|
+
rubygems_version: 1.3.7
|
283
127
|
signing_key:
|
284
128
|
specification_version: 3
|
285
129
|
summary: Translate with Google like a fule => 'fool'
|