web_translate_it 1.8.4 → 1.9.0
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/bin/wti +2 -2
- data/history.md +4 -0
- data/lib/web_translate_it.rb +0 -1
- data/lib/web_translate_it/command_line.rb +4 -1
- data/readme.md +1 -18
- data/version.yml +2 -2
- metadata +9 -23
- data/lib/web_translate_it/public/screen.css +0 -246
- data/lib/web_translate_it/server.rb +0 -57
- data/lib/web_translate_it/views/index.erb +0 -63
data/bin/wti
CHANGED
@@ -17,7 +17,6 @@ The most commonly used wti commands are:
|
|
17
17
|
match Display matching of local files with File Manager
|
18
18
|
add Create and push a new master language file
|
19
19
|
addlocale Add a new locale to the project
|
20
|
-
server Start a synchronisation server
|
21
20
|
status Fetch and display project statistics
|
22
21
|
init Configure your project to sync
|
23
22
|
|
@@ -79,7 +78,8 @@ EOS
|
|
79
78
|
when "server"
|
80
79
|
Trollop::options do
|
81
80
|
banner <<-EOS
|
82
|
-
|
81
|
+
Deprecated, used to start a synchronisation server.
|
82
|
+
`gem install web_translate_it_server` and run `wti-server` instead.
|
83
83
|
[options] are:
|
84
84
|
EOS
|
85
85
|
opt :port, "Run server on a specific port", :default => 4000, :short => "-p"
|
data/history.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## Version 1.9.0 / 2011-11-23
|
2
|
+
|
3
|
+
* Deprecate `wti server`. This feature was introducing a hard dependency on Sinatra, which is not desirable when embedding `web_translate_it` on a Rails application. `wti server` now lives in a separate gem, `web_translate_it_server`, which depends on the `web_translate_it` gem. To keep using `wti server`, execute: `gem install web_translate_it_server` and run: `wti-server`.
|
4
|
+
|
1
5
|
## Version 1.8.4 / 2011-11-14
|
2
6
|
|
3
7
|
* Add new command `wti rmlocale locale_code_1 locale_code_2 ...` to delete a locale from a project.
|
data/lib/web_translate_it.rb
CHANGED
@@ -180,7 +180,10 @@ module WebTranslateIt
|
|
180
180
|
alias :st :status
|
181
181
|
|
182
182
|
def server
|
183
|
-
|
183
|
+
puts "This feature is deprecated and was extracted to a separate gem,"
|
184
|
+
puts " `web_translate_it_server`."
|
185
|
+
puts "To use it, run `gem install web_translate_it_server`"
|
186
|
+
puts "and run the server with `wti-server`."
|
184
187
|
end
|
185
188
|
|
186
189
|
def method_missing(m, *args, &block)
|
data/readme.md
CHANGED
@@ -163,24 +163,7 @@ Check the [sample `.wti`](https://github.com/AtelierConvivialite/webtranslateit/
|
|
163
163
|
Web Translate It Synchronisation Console
|
164
164
|
----------------------------------------
|
165
165
|
|
166
|
-
|
167
|
-
|
168
|
-
`wti` contains a server you can use to run a friendly web interface to sync your translations. It allows a translation team to refresh the language files on a staging server without asking the developers to manually `wti pull`.
|
169
|
-
|
170
|
-
To get started, go to the directory of the application you want to sync and do:
|
171
|
-
|
172
|
-
wti server
|
173
|
-
|
174
|
-
By default, it starts an application on localhost on the port 4000. You will find the tool on `http://localhost:4000`.
|
175
|
-
|
176
|
-
Should you need to use another host or port, you can use the `-h` and `-p` options. For example: `wti server -p 1234`.
|
177
|
-
|
178
|
-
You may want to run some commands before or after syncing translations. You can use the hooks to do so. For instance, you could add the following in your `.wti` file:
|
179
|
-
|
180
|
-
before_pull: "echo 'some unix command'"
|
181
|
-
after_pull: "touch tmp/restart.txt"
|
182
|
-
|
183
|
-
`before_pull` and `after_pull` are respectively executed before and after pulling language files.
|
166
|
+
This feature was extracted out to a separate gem. See [web_translate_it_server](https://github.com/AtelierConvivialite/web_translate_it_server).
|
184
167
|
|
185
168
|
# License
|
186
169
|
|
data/version.yml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_translate_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multipart-post
|
16
|
-
requirement: &
|
16
|
+
requirement: &70172331071400 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.1.3
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70172331071400
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: trollop
|
27
|
-
requirement: &
|
27
|
+
requirement: &70172331070900 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,21 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.16.2
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: sinatra
|
38
|
-
requirement: &70301606154700 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 1.2.6
|
44
|
-
type: :runtime
|
45
|
-
prerelease: false
|
46
|
-
version_requirements: *70301606154700
|
35
|
+
version_requirements: *70172331070900
|
47
36
|
- !ruby/object:Gem::Dependency
|
48
37
|
name: rspec
|
49
|
-
requirement: &
|
38
|
+
requirement: &70172331070440 !ruby/object:Gem::Requirement
|
50
39
|
none: false
|
51
40
|
requirements:
|
52
41
|
- - ! '>='
|
@@ -54,7 +43,7 @@ dependencies:
|
|
54
43
|
version: 2.6.0
|
55
44
|
type: :development
|
56
45
|
prerelease: false
|
57
|
-
version_requirements: *
|
46
|
+
version_requirements: *70172331070440
|
58
47
|
description:
|
59
48
|
email: edouard@atelierconvivialite.com
|
60
49
|
executables:
|
@@ -74,13 +63,10 @@ files:
|
|
74
63
|
- lib/web_translate_it/command_line.rb
|
75
64
|
- lib/web_translate_it/configuration.rb
|
76
65
|
- lib/web_translate_it/project.rb
|
77
|
-
- lib/web_translate_it/public/screen.css
|
78
|
-
- lib/web_translate_it/server.rb
|
79
66
|
- lib/web_translate_it/translation_file.rb
|
80
67
|
- lib/web_translate_it/util/array_util.rb
|
81
68
|
- lib/web_translate_it/util/string_util.rb
|
82
69
|
- lib/web_translate_it/util.rb
|
83
|
-
- lib/web_translate_it/views/index.erb
|
84
70
|
- lib/web_translate_it.rb
|
85
71
|
- generators/webtranslateit/lib/insert_commands.rb
|
86
72
|
- generators/webtranslateit/webtranslateit_generator.rb
|
@@ -117,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
103
|
version: '0'
|
118
104
|
requirements: []
|
119
105
|
rubyforge_project:
|
120
|
-
rubygems_version: 1.8.
|
106
|
+
rubygems_version: 1.8.11
|
121
107
|
signing_key:
|
122
108
|
specification_version: 3
|
123
109
|
summary: A CLI to sync locale files with webtranslateit.com.
|
@@ -1,246 +0,0 @@
|
|
1
|
-
/*****************************************************************************/
|
2
|
-
/*
|
3
|
-
/* Common
|
4
|
-
/*
|
5
|
-
/*****************************************************************************/
|
6
|
-
|
7
|
-
/* Global Reset */
|
8
|
-
|
9
|
-
* {
|
10
|
-
margin: 0;
|
11
|
-
padding: 0;
|
12
|
-
}
|
13
|
-
|
14
|
-
html, body {
|
15
|
-
height: 100%;
|
16
|
-
}
|
17
|
-
|
18
|
-
body {
|
19
|
-
background-color: white;
|
20
|
-
font: 13.34px helvetica, arial, clean, sans-serif;
|
21
|
-
*font-size: small;
|
22
|
-
text-align: center;
|
23
|
-
}
|
24
|
-
|
25
|
-
h1, h2, h3, h4, h5, h6 {
|
26
|
-
font-size: 100%;
|
27
|
-
}
|
28
|
-
|
29
|
-
h1 {
|
30
|
-
margin-bottom: 1em;
|
31
|
-
}
|
32
|
-
|
33
|
-
h1 a {
|
34
|
-
text-decoration: none;
|
35
|
-
color: #000;
|
36
|
-
}
|
37
|
-
|
38
|
-
.failed, .color31 {
|
39
|
-
color: red !important;
|
40
|
-
}
|
41
|
-
|
42
|
-
.worked, .color32 {
|
43
|
-
color: green !important;
|
44
|
-
}
|
45
|
-
|
46
|
-
.errored, .color33 {
|
47
|
-
color: yellow !important;
|
48
|
-
}
|
49
|
-
|
50
|
-
p {
|
51
|
-
margin: 1em 0;
|
52
|
-
}
|
53
|
-
|
54
|
-
.update {
|
55
|
-
background-color: #DFF2BF;
|
56
|
-
border: 2px solid #4F8A10;
|
57
|
-
padding: 5px;
|
58
|
-
width: 300px;
|
59
|
-
line-height: 30px;
|
60
|
-
text-align: center;
|
61
|
-
}
|
62
|
-
|
63
|
-
select, input {
|
64
|
-
font-size: 16px;
|
65
|
-
}
|
66
|
-
|
67
|
-
a {
|
68
|
-
color: #00a;
|
69
|
-
}
|
70
|
-
|
71
|
-
a:hover {
|
72
|
-
color: black;
|
73
|
-
}
|
74
|
-
|
75
|
-
a:visited {
|
76
|
-
color: #a0a;
|
77
|
-
}
|
78
|
-
|
79
|
-
table {
|
80
|
-
font-size: inherit;
|
81
|
-
font: 100%;
|
82
|
-
border-collapse: collapse;
|
83
|
-
}
|
84
|
-
|
85
|
-
th {
|
86
|
-
text-align: center;
|
87
|
-
padding-right: 1em;
|
88
|
-
}
|
89
|
-
|
90
|
-
tr {
|
91
|
-
border-bottom: 1px solid #CCC;
|
92
|
-
}
|
93
|
-
|
94
|
-
td {
|
95
|
-
padding: .5em 1em;
|
96
|
-
}
|
97
|
-
|
98
|
-
.information {
|
99
|
-
background-color: #ffffc0;
|
100
|
-
color: #333;
|
101
|
-
padding: 5px;
|
102
|
-
}
|
103
|
-
|
104
|
-
/*****************************************************************************/
|
105
|
-
/*
|
106
|
-
/* Home
|
107
|
-
/*
|
108
|
-
/*****************************************************************************/
|
109
|
-
|
110
|
-
ul.posts {
|
111
|
-
list-style-type: none;
|
112
|
-
margin-bottom: 2em;
|
113
|
-
}
|
114
|
-
|
115
|
-
ul.posts li {
|
116
|
-
line-height: 1.75em;
|
117
|
-
}
|
118
|
-
|
119
|
-
ul.posts .date,
|
120
|
-
ul.posts .duration {
|
121
|
-
color: #aaa;
|
122
|
-
font-family: Monaco, "Courier New", monospace;
|
123
|
-
font-size: 80%;
|
124
|
-
}
|
125
|
-
|
126
|
-
/*****************************************************************************/
|
127
|
-
/*
|
128
|
-
/* Site
|
129
|
-
/*
|
130
|
-
/*****************************************************************************/
|
131
|
-
|
132
|
-
.site {
|
133
|
-
font-size: 110%;
|
134
|
-
text-align: justify;
|
135
|
-
width: 80%;
|
136
|
-
margin: 3em auto 2em auto;
|
137
|
-
line-height: 1.5em;
|
138
|
-
}
|
139
|
-
|
140
|
-
.title {
|
141
|
-
color: #a00;
|
142
|
-
font-weight: bold;
|
143
|
-
margin-bottom: 2em;
|
144
|
-
}
|
145
|
-
|
146
|
-
.site .title a {
|
147
|
-
color: #a00;
|
148
|
-
text-decoration: none;
|
149
|
-
}
|
150
|
-
|
151
|
-
.site .title a:hover {
|
152
|
-
color: black;
|
153
|
-
}
|
154
|
-
|
155
|
-
.site .title .extra {
|
156
|
-
color: #aaa;
|
157
|
-
text-decoration: none;
|
158
|
-
margin-left: 1em;
|
159
|
-
font-size: 0.9em;
|
160
|
-
}
|
161
|
-
|
162
|
-
.site .title a.extra:hover {
|
163
|
-
color: black;
|
164
|
-
}
|
165
|
-
|
166
|
-
.site .meta {
|
167
|
-
color: #aaa;
|
168
|
-
}
|
169
|
-
|
170
|
-
.site .footer {
|
171
|
-
font-size: 80%;
|
172
|
-
color: #666;
|
173
|
-
border-top: 4px solid #eee;
|
174
|
-
margin-top: 2em;
|
175
|
-
overflow: hidden;
|
176
|
-
}
|
177
|
-
|
178
|
-
.site .footer .contact {
|
179
|
-
float: left;
|
180
|
-
margin-right: 3em;
|
181
|
-
}
|
182
|
-
|
183
|
-
.site .footer .contact a {
|
184
|
-
color: #8085C1;
|
185
|
-
}
|
186
|
-
|
187
|
-
.site .footer .rss {
|
188
|
-
margin-top: 1.1em;
|
189
|
-
margin-right: -.2em;
|
190
|
-
float: right;
|
191
|
-
}
|
192
|
-
|
193
|
-
.site .footer .rss img {
|
194
|
-
border: 0;
|
195
|
-
}
|
196
|
-
|
197
|
-
/*****************************************************************************/
|
198
|
-
/*
|
199
|
-
/* Posts
|
200
|
-
/*
|
201
|
-
/*****************************************************************************/
|
202
|
-
|
203
|
-
#post {
|
204
|
-
|
205
|
-
}
|
206
|
-
|
207
|
-
/* standard */
|
208
|
-
|
209
|
-
#post pre {
|
210
|
-
border: 1px solid #ddd;
|
211
|
-
background-color: #eef;
|
212
|
-
padding: 0 .4em;
|
213
|
-
}
|
214
|
-
|
215
|
-
#post ul,
|
216
|
-
#post ol {
|
217
|
-
margin-left: 1.25em;
|
218
|
-
}
|
219
|
-
|
220
|
-
#post code {
|
221
|
-
border: 1px solid #ddd;
|
222
|
-
background-color: #eef;
|
223
|
-
font-size: 95%;
|
224
|
-
padding: 0 .2em;
|
225
|
-
}
|
226
|
-
|
227
|
-
#post pre code {
|
228
|
-
border: none;
|
229
|
-
}
|
230
|
-
|
231
|
-
/* terminal */
|
232
|
-
|
233
|
-
pre.terminal {
|
234
|
-
border: 1px solid black;
|
235
|
-
background-color: #333;
|
236
|
-
color: white;
|
237
|
-
padding: 5px;
|
238
|
-
overflow: auto;
|
239
|
-
word-wrap: break-word;
|
240
|
-
}
|
241
|
-
|
242
|
-
pre.terminal code {
|
243
|
-
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
|
244
|
-
background-color: #333;
|
245
|
-
}
|
246
|
-
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'sinatra/base'
|
3
|
-
require 'erb'
|
4
|
-
|
5
|
-
module WebTranslateIt
|
6
|
-
class Server < Sinatra::Base
|
7
|
-
attr_reader :config
|
8
|
-
|
9
|
-
dir = File.dirname(File.expand_path(__FILE__))
|
10
|
-
|
11
|
-
set :views, "#{dir}/views"
|
12
|
-
set :public, "#{dir}/public"
|
13
|
-
set :static, true
|
14
|
-
set :lock, true
|
15
|
-
|
16
|
-
helpers do
|
17
|
-
def wti_root
|
18
|
-
""
|
19
|
-
end
|
20
|
-
|
21
|
-
def highlight(value, expected)
|
22
|
-
return if value.nil?
|
23
|
-
print_value = value == true ? "Yes" : "No"
|
24
|
-
value == expected ? "<em>#{print_value}</em>" : "<em class=\"information\">#{print_value}</em>"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
get '/' do
|
29
|
-
@config = WebTranslateIt::Configuration.new('.')
|
30
|
-
erb :index, :locals => { :config => config, :locale => "" }
|
31
|
-
end
|
32
|
-
|
33
|
-
get '/:locale' do
|
34
|
-
@config = WebTranslateIt::Configuration.new('.')
|
35
|
-
erb :index, :locals => { :config => config, :locale => params[:locale] }
|
36
|
-
end
|
37
|
-
|
38
|
-
post '/pull/' do
|
39
|
-
`wti pull`
|
40
|
-
redirect "/"
|
41
|
-
end
|
42
|
-
|
43
|
-
post '/pull/:locale' do
|
44
|
-
`wti pull -l #{params[:locale]}`
|
45
|
-
redirect "/#{params[:locale]}"
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.start(host, port)
|
49
|
-
puts "Starting wti server..."
|
50
|
-
Dir::mkdir('log') unless FileTest::directory?('log')
|
51
|
-
logger = ::File.open("log/webtranslateit.log", "a+")
|
52
|
-
STDOUT.reopen(logger)
|
53
|
-
STDERR.reopen(logger)
|
54
|
-
WebTranslateIt::Server.run! :host => host, :port => port
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,63 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<link href="<%= wti_root %>/screen.css" media="screen" rel="stylesheet" type="text/css" />
|
5
|
-
<link rel="shortcut icon" href="<%= wti_root %>/favicon.ico" type="image/x-icon" />
|
6
|
-
<title>Web Translate It Synchronisation Console</title>
|
7
|
-
</head>
|
8
|
-
<body>
|
9
|
-
<div class="site">
|
10
|
-
<div class="title">
|
11
|
-
<a href="<%= wti_root %>/">Web Translate It Synchronisation Console</a>
|
12
|
-
</div>
|
13
|
-
|
14
|
-
<div id="home">
|
15
|
-
<h1>Update</h1>
|
16
|
-
|
17
|
-
<div class="update">
|
18
|
-
Download files update for
|
19
|
-
<select name="locale" onchange="window.location=this.value;">
|
20
|
-
<option value="/" <%= "selected='true'" if locale == "" %>>All locales</option>
|
21
|
-
<% config.target_locales.each do |l| %>
|
22
|
-
<option value="/<%= l %>" <%= "selected='true'" if locale == l %>><%= l.upcase %></option>
|
23
|
-
<% end %>
|
24
|
-
</select>
|
25
|
-
<form method="post" action="<%= wti_root %>/pull/<%= locale %>">
|
26
|
-
<input type="submit" value="Update" onclick="if (window.hiddenCommit) { window.hiddenCommit.setAttribute('value', this.value); }else { hiddenCommit = document.createElement('input');hiddenCommit.type = 'hidden';hiddenCommit.value = this.value;hiddenCommit.name = this.name;this.form.appendChild(hiddenCommit); }this.setAttribute('originalValue', this.value);this.disabled = true;this.value='Please wait...';result = (this.form.onsubmit ? (this.form.onsubmit() ? this.form.submit() : false) : this.form.submit());if (result == false) { this.value = this.getAttribute('originalValue');this.disabled = false; }return result;" />
|
27
|
-
</form>
|
28
|
-
<div class="clear"></div>
|
29
|
-
</div>
|
30
|
-
|
31
|
-
<% if config.before_pull %>
|
32
|
-
<p>
|
33
|
-
This command will be executed before pulling files:
|
34
|
-
<code><%= config.before_pull %></code>
|
35
|
-
</p>
|
36
|
-
<% end %>
|
37
|
-
<% if config.after_pull %>
|
38
|
-
<p>
|
39
|
-
This command will be executed after pulling files:
|
40
|
-
<code><%= config.after_pull %></code>
|
41
|
-
</p>
|
42
|
-
<% end %>
|
43
|
-
</div>
|
44
|
-
|
45
|
-
<div class="footer">
|
46
|
-
<div class="contact">
|
47
|
-
<p>
|
48
|
-
<a href="http://docs.webtranslateit.com">Documentation</a><br/>
|
49
|
-
<a href="https://github.com/AtelierConvivialite/webtranslateit/">Source</a><br/>
|
50
|
-
<a href="https://github.com/AtelierConvivialite/webtranslateit/issues">Issues</a><br/>
|
51
|
-
<a href="http://twitter.com/webtranslateit">Twitter</a>
|
52
|
-
</p>
|
53
|
-
</div>
|
54
|
-
<div class="contact">
|
55
|
-
<p>
|
56
|
-
wti v.<%= WebTranslateIt::Util.version %><br/>
|
57
|
-
Built with <a href="http://sinatrarb.com/">Sinatra</a>
|
58
|
-
</p>
|
59
|
-
</div>
|
60
|
-
</div>
|
61
|
-
</div>
|
62
|
-
</body>
|
63
|
-
</html>
|