web_translate_it 1.7.1.3 → 1.7.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +26 -32
- data/bin/wti +20 -15
- data/history.md +12 -2
- data/lib/web_translate_it/command_line.rb +5 -5
- data/lib/web_translate_it/project.rb +1 -1
- data/lib/web_translate_it/server.rb +4 -1
- data/lib/web_translate_it/tasks.rb +3 -3
- data/lib/web_translate_it/translation_file.rb +2 -2
- data/lib/web_translate_it/views/index.erb +1 -1
- data/{MIT-LICENSE → licence} +0 -0
- data/readme.md +192 -0
- data/version.yml +1 -1
- metadata +16 -13
data/README.md
CHANGED
@@ -20,6 +20,8 @@ This gem provides 4 tools:
|
|
20
20
|
|
21
21
|
## Installation
|
22
22
|
|
23
|
+
These instructions are for Linux and Mac OS X system. Follow [these instructions](http://help.webtranslateit.com/kb/tips/how-to-install-wti-on-windows) if you’re using Microsoft Windows.
|
24
|
+
|
23
25
|
gem install web_translate_it
|
24
26
|
|
25
27
|
At this point you should have the `wti` executable working.
|
@@ -27,31 +29,34 @@ If your project if already set up on Web Translate It, open a terminal and type
|
|
27
29
|
|
28
30
|
Execute `wti --help` to see the usage:
|
29
31
|
|
30
|
-
Usage: wti [-
|
31
|
-
pull Pull target language file(s)
|
32
|
-
push Push master language file(s)
|
33
|
-
add Create and push a new master language file
|
32
|
+
Usage: wti [-lcphhv]
|
33
|
+
pull Pull target language file(s)
|
34
|
+
push Push master language file(s)
|
35
|
+
add Create and push a new master language file
|
36
|
+
addlocale Add a new locale to the project
|
34
37
|
server Start a synchronisation server
|
35
|
-
stats Fetch and display project statistics
|
36
|
-
autoconf Configure your project to sync
|
38
|
+
stats Fetch and display project statistics
|
39
|
+
autoconf Configure your project to sync
|
37
40
|
|
38
41
|
Synchronization options:
|
39
|
-
-l, --locale ISO code of a locale to pull or push
|
40
|
-
-c, --config Path to a translation.yml file
|
41
|
-
(default: config/translation.yml)
|
42
|
-
--all Download or upload all files
|
43
|
-
--force Force wti pull to download files
|
44
|
-
--merge Force WTI to merge this file
|
45
|
-
--ignore_missing Force WTI to not obsolete missing strings
|
42
|
+
-l, --locale ISO code of a locale to pull or push
|
43
|
+
-c, --config Path to a translation.yml file
|
44
|
+
(default: config/translation.yml)
|
45
|
+
--all Download or upload all files
|
46
|
+
--force Force wti pull to download files
|
47
|
+
--merge Force WTI to merge this file
|
48
|
+
--ignore_missing Force WTI to not obsolete missing strings
|
49
|
+
--low_priority Tells WTI to process this command with a low priority
|
50
|
+
--label Apply a label to the changes
|
46
51
|
|
47
52
|
Server options:
|
48
53
|
-p, --port Run server on a specific port
|
49
|
-
(default: 4000)
|
54
|
+
(default: 4000)
|
50
55
|
-h, --host Run server on a specific host
|
51
|
-
(default: localhost)
|
56
|
+
(default: localhost)
|
52
57
|
|
53
58
|
Other options:
|
54
|
-
|
59
|
+
-h, --help Show this message
|
55
60
|
-v, --version Show version
|
56
61
|
|
57
62
|
## Configuration
|
@@ -106,7 +111,7 @@ where `fr` should be replaced by the locale code of your file.
|
|
106
111
|
|
107
112
|
wti pull --all
|
108
113
|
|
109
|
-
### Force pull (
|
114
|
+
### Force pull (bypass Web Translate It’s HTTP caching)
|
110
115
|
|
111
116
|
wti pull --force
|
112
117
|
|
@@ -116,7 +121,7 @@ where `fr` should be replaced by the locale code of your file.
|
|
116
121
|
|
117
122
|
## Web Translate It Synchronisation Console
|
118
123
|
|
119
|
-
![Web Translate It](http://s3.amazonaws.com:80/edouard.baconfile.com/web_translate_it%
|
124
|
+
![Web Translate It](http://s3.amazonaws.com:80/edouard.baconfile.com/web_translate_it%2Fadmin_console2.png)
|
120
125
|
|
121
126
|
The `wti` gem integrates since its version 1.7.0 a sinatra back-end that allow you to sync your translations directly from a friendly web interface. It allows a translation team to refresh the language files on a staging server without having to ask the developers to manually `wti pull`.
|
122
127
|
|
@@ -126,7 +131,7 @@ To get started, go to the directory of the application you want to sync and do:
|
|
126
131
|
|
127
132
|
By default, it starts an application on localhost on the port 4000. You will find the tool on `http://localhost:4000`.
|
128
133
|
|
129
|
-
Should you need to use another host or port, you can use the
|
134
|
+
Should you need to use another host or port, you can use the `-h` and `-p` options. For example: `wti server -p 1234`.
|
130
135
|
|
131
136
|
You may want to run some commands before or after synching translations. To do so, add in the `translation.yml` file the following:
|
132
137
|
|
@@ -182,17 +187,6 @@ The gem currently has been tested against the following versions of Rails:
|
|
182
187
|
|
183
188
|
Please open a discussion on [our support site](http://help.webtranslateit.com) if you're using a version of Rails that is not listed above and the gem is not working properly.
|
184
189
|
|
185
|
-
#
|
186
|
-
|
187
|
-
* The executable’s commands are very much inspired from [Gemcutter](http://gemcutter.org),
|
188
|
-
* The Rails generator was pinched from [Hoptoad Notifier](http://github.com/thoughtbot/hoptoad_notifier),
|
189
|
-
* The idea of a web-app to sync translations with Web Translate It come from Tom Lea’s awesome [rack-webtranslateit](http://github.com/cwninja/rack-webtranslateit),
|
190
|
-
* The Sinatra app is much inspired from Chris Wanstrath’s [CI Joe](http://github.com/defunkt/cijoe).
|
191
|
-
|
192
|
-
# What is Web Translate It anyway?
|
193
|
-
|
194
|
-
[Web Translate It](https://webtranslateit.com) is a web-based computer-aided translation tool to collaboratively translate software.
|
195
|
-
|
196
|
-
To learn more about it, please visit our [tour page](https://webtranslateit.com/tour).
|
190
|
+
# License
|
197
191
|
|
198
|
-
|
192
|
+
Copyright (c) 2009-2011 Atelier Convivialité, and released under the MIT License.
|
data/bin/wti
CHANGED
@@ -7,17 +7,17 @@ Choice.options do
|
|
7
7
|
|
8
8
|
option :pull do
|
9
9
|
long 'pull'
|
10
|
-
desc "Pull target language file(s)
|
10
|
+
desc "Pull target language file(s)"
|
11
11
|
end
|
12
12
|
|
13
13
|
option :push do
|
14
14
|
long 'push'
|
15
|
-
desc "Push master language file(s)
|
15
|
+
desc "Push master language file(s)"
|
16
16
|
end
|
17
17
|
|
18
18
|
option :add do
|
19
19
|
long 'add'
|
20
|
-
desc "Create and push a new master language file
|
20
|
+
desc "Create and push a new master language file"
|
21
21
|
end
|
22
22
|
|
23
23
|
option :addlocale do
|
@@ -32,12 +32,12 @@ Choice.options do
|
|
32
32
|
|
33
33
|
option :stats do
|
34
34
|
long 'stats'
|
35
|
-
desc "Fetch and display project statistics
|
35
|
+
desc "Fetch and display project statistics"
|
36
36
|
end
|
37
37
|
|
38
38
|
option :autoconf do
|
39
39
|
long 'autoconf'
|
40
|
-
desc "Configure your project to sync
|
40
|
+
desc "Configure your project to sync"
|
41
41
|
end
|
42
42
|
|
43
43
|
separator ''
|
@@ -46,40 +46,45 @@ Choice.options do
|
|
46
46
|
option :locale do
|
47
47
|
short '-l'
|
48
48
|
long '--locale'
|
49
|
-
desc "ISO code of a locale to pull or push
|
49
|
+
desc "ISO code of a locale to pull or push"
|
50
50
|
end
|
51
51
|
|
52
52
|
option :config do
|
53
53
|
short '-c'
|
54
54
|
long '--config'
|
55
|
-
desc "Path to a translation.yml file
|
56
|
-
desc "(default: config/translation.yml)
|
55
|
+
desc "Path to a translation.yml file"
|
56
|
+
desc "(default: config/translation.yml)"
|
57
57
|
default "config/translation.yml"
|
58
58
|
end
|
59
59
|
|
60
60
|
option :all do
|
61
61
|
long '--all'
|
62
|
-
desc "Download or upload all files
|
62
|
+
desc "Download or upload all files"
|
63
63
|
end
|
64
64
|
|
65
65
|
option :force do
|
66
66
|
long '--force'
|
67
|
-
desc "Force wti pull to download files
|
67
|
+
desc "Force wti pull to download files"
|
68
68
|
end
|
69
69
|
|
70
70
|
option :merge do
|
71
71
|
long '--merge'
|
72
|
-
desc "Force WTI to merge this file
|
72
|
+
desc "Force WTI to merge this file"
|
73
73
|
end
|
74
74
|
|
75
75
|
option :ignore_missing do
|
76
76
|
long '--ignore_missing'
|
77
|
-
desc "Force WTI to not obsolete missing strings
|
77
|
+
desc "Force WTI to not obsolete missing strings"
|
78
|
+
end
|
79
|
+
|
80
|
+
option :low_priority do
|
81
|
+
long '--low_priority'
|
82
|
+
desc "Tells WTI to process this command with a low priority"
|
78
83
|
end
|
79
84
|
|
80
85
|
option :label do
|
81
86
|
long '--label'
|
82
|
-
desc "Apply a label to the changes
|
87
|
+
desc "Apply a label to the changes"
|
83
88
|
end
|
84
89
|
|
85
90
|
separator ''
|
@@ -89,7 +94,7 @@ Choice.options do
|
|
89
94
|
short '-p'
|
90
95
|
long '--port'
|
91
96
|
desc "Run server on a specific port"
|
92
|
-
desc "(default: 4000)
|
97
|
+
desc "(default: 4000)"
|
93
98
|
cast Integer
|
94
99
|
default '4000'
|
95
100
|
end
|
@@ -98,7 +103,7 @@ Choice.options do
|
|
98
103
|
short '-h'
|
99
104
|
long '--host'
|
100
105
|
desc "Run server on a specific host"
|
101
|
-
desc "(default: localhost)
|
106
|
+
desc "(default: localhost)"
|
102
107
|
default '0.0.0.0'
|
103
108
|
end
|
104
109
|
|
data/history.md
CHANGED
@@ -1,10 +1,20 @@
|
|
1
|
+
## Version 1.7.1.5 / 2011-02-10
|
2
|
+
|
3
|
+
* Fix an issue with `wti server` swallowing all `wti` outputs.
|
4
|
+
|
5
|
+
## Version 1.7.1.4 / 2011-02-10
|
6
|
+
|
7
|
+
* New: Add `--low_priority` option.
|
8
|
+
* Update Sinatra and multipart-post dependancies.
|
9
|
+
* New: Enable logging of `wti server`. Logs will be saved in `log/webtranslateit.log` in your project directory.
|
10
|
+
|
1
11
|
## Version 1.7.1.3 / 2011-01-13
|
2
12
|
|
3
|
-
* Fix: Bug in `wti add
|
13
|
+
* Fix: Bug in `wti add`.
|
4
14
|
|
5
15
|
## Version 1.7.1.2 / 2011-01-13
|
6
16
|
|
7
|
-
* Fix: server timeout handling on `wti addlocale
|
17
|
+
* Fix: server timeout handling on `wti addlocale`.
|
8
18
|
|
9
19
|
## Version 1.7.1.1 / 2011-01-13
|
10
20
|
|
@@ -19,7 +19,7 @@ module WebTranslateIt
|
|
19
19
|
STDOUT.sync = true
|
20
20
|
fetch_locales_to_pull.each do |locale|
|
21
21
|
configuration.files.find_all{ |file| file.locale == locale }.each do |file|
|
22
|
-
print "Pulling #{file.file_path}
|
22
|
+
print "Pulling #{file.file_path}... "
|
23
23
|
puts file.fetch(ARGV.index('--force'))
|
24
24
|
end
|
25
25
|
end
|
@@ -31,8 +31,8 @@ module WebTranslateIt
|
|
31
31
|
merge = !(ARGV.index('--merge')).nil?
|
32
32
|
ignore_missing = !(ARGV.index('--ignore_missing')).nil?
|
33
33
|
configuration.files.find_all{ |file| file.locale == locale }.each do |file|
|
34
|
-
print "Pushing #{file.file_path}
|
35
|
-
puts file.upload(merge, ignore_missing, options.label)
|
34
|
+
print "Pushing #{file.file_path}... "
|
35
|
+
puts file.upload(merge, ignore_missing, options.label, options.low_priority)
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -45,7 +45,7 @@ module WebTranslateIt
|
|
45
45
|
end
|
46
46
|
parameters.each do |param|
|
47
47
|
file = TranslationFile.new(nil, param, nil, configuration.api_key)
|
48
|
-
print "Creating #{file.file_path}
|
48
|
+
print "Creating #{file.file_path}... "
|
49
49
|
puts file.create
|
50
50
|
end
|
51
51
|
puts "Master file added. Use `wti push --all` to send your existing translations."
|
@@ -58,7 +58,7 @@ module WebTranslateIt
|
|
58
58
|
exit
|
59
59
|
end
|
60
60
|
parameters.each do |param|
|
61
|
-
print "Adding locale #{param}
|
61
|
+
print "Adding locale #{param}... "
|
62
62
|
puts WebTranslateIt::Project.create_locale(configuration.api_key, param)
|
63
63
|
end
|
64
64
|
puts "Done!"
|
@@ -3,7 +3,7 @@ module WebTranslateIt
|
|
3
3
|
class Project
|
4
4
|
|
5
5
|
def self.fetch_info(api_key)
|
6
|
-
puts "Gathering project's information
|
6
|
+
puts "Gathering project's information..."
|
7
7
|
begin
|
8
8
|
WebTranslateIt::Util.http_connection do |http|
|
9
9
|
request = Net::HTTP::Get.new("/api/projects/#{api_key}.yaml")
|
@@ -12,7 +12,7 @@ module WebTranslateIt
|
|
12
12
|
set :public, "#{dir}/public"
|
13
13
|
set :static, true
|
14
14
|
set :lock, true
|
15
|
-
|
15
|
+
|
16
16
|
helpers do
|
17
17
|
def wti_root
|
18
18
|
""
|
@@ -52,6 +52,9 @@ module WebTranslateIt
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def self.start(host, port)
|
55
|
+
logger = ::File.open("log/webtranslateit.log", "a+")
|
56
|
+
STDOUT.reopen(logger)
|
57
|
+
STDERR.reopen(logger)
|
55
58
|
WebTranslateIt::Server.run! :host => host, :port => port
|
56
59
|
end
|
57
60
|
end
|
@@ -5,7 +5,7 @@ namespace :trans do
|
|
5
5
|
desc "Fetch translation files from Web Translate It"
|
6
6
|
task :fetch, :locale do |task, args|
|
7
7
|
WebTranslateIt::Util.welcome_message
|
8
|
-
puts "Fetching file for locale #{args.locale}
|
8
|
+
puts "Fetching file for locale #{args.locale}..."
|
9
9
|
configuration = WebTranslateIt::Configuration.new
|
10
10
|
configuration.files.find_all{ |file| file.locale == args.locale }.each do |file|
|
11
11
|
puts file.file_path + ": " + file.fetch
|
@@ -19,7 +19,7 @@ namespace :trans do
|
|
19
19
|
configuration = WebTranslateIt::Configuration.new
|
20
20
|
locales = configuration.target_locales
|
21
21
|
configuration.ignore_locales.each{ |locale_to_ignore| locales.delete(locale_to_ignore) }
|
22
|
-
puts "Fetching all files for all locales
|
22
|
+
puts "Fetching all files for all locales..."
|
23
23
|
locales.each do |locale|
|
24
24
|
configuration.files.find_all{ |file| file.locale == locale }.each do |file|
|
25
25
|
puts file.file_path + " " + file.fetch
|
@@ -31,7 +31,7 @@ namespace :trans do
|
|
31
31
|
desc "Upload the translation files for a locale to Web Translate It"
|
32
32
|
task :upload, :locale do |task, args|
|
33
33
|
WebTranslateIt::Util.welcome_message
|
34
|
-
puts "Uploading file for locale #{args.locale}
|
34
|
+
puts "Uploading file for locale #{args.locale}..."
|
35
35
|
configuration = WebTranslateIt::Configuration.new
|
36
36
|
configuration.files.find_all{ |file| file.locale == args.locale }.each do |file|
|
37
37
|
puts file.file_path + " " + file.upload
|
@@ -70,12 +70,12 @@ module WebTranslateIt
|
|
70
70
|
#
|
71
71
|
# Note that the request might or might not eventually be acted upon, as it might be disallowed when processing
|
72
72
|
# actually takes place. This is due to the fact that language file imports are handled by background processing.
|
73
|
-
def upload(merge=false, ignore_missing=false, label=nil)
|
73
|
+
def upload(merge=false, ignore_missing=false, label=nil, low_priority=false)
|
74
74
|
if File.exists?(self.file_path)
|
75
75
|
File.open(self.file_path) do |file|
|
76
76
|
begin
|
77
77
|
WebTranslateIt::Util.http_connection do |http|
|
78
|
-
request = Net::HTTP::Put::Multipart.new(api_url, {"file" => UploadIO.new(file, "text/plain", file.path), "merge" => merge, "ignore_missing" => ignore_missing, "label" => label })
|
78
|
+
request = Net::HTTP::Put::Multipart.new(api_url, {"file" => UploadIO.new(file, "text/plain", file.path), "merge" => merge, "ignore_missing" => ignore_missing, "label" => label, "low_priority" => low_priority })
|
79
79
|
Util.handle_response(http.request(request))
|
80
80
|
end
|
81
81
|
rescue Timeout::Error
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<% end %>
|
24
24
|
</select>
|
25
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
|
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
27
|
</form>
|
28
28
|
<div class="clear"></div>
|
29
29
|
</div>
|
data/{MIT-LICENSE → licence}
RENAMED
File without changes
|
data/readme.md
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
# Web Translate It
|
2
|
+
|
3
|
+
[Homepage](https://webtranslateit.com) |
|
4
|
+
[RDocs](http://yardoc.org/docs/AtelierConvivialite-webtranslateit) |
|
5
|
+
[Example app](http://github.com/AtelierConvivialite/rails_example_app) |
|
6
|
+
[Report a bug](http://github.com/AtelierConvivialite/webtranslateit/issues) |
|
7
|
+
[Support](http://help.webtranslateit.com) |
|
8
|
+
[Documentation](http://docs.webtranslateit.com/web_translate_it_client/)
|
9
|
+
|
10
|
+
`web_translate_it` is a rubygem providing tools to sync your language files with [Web Translate It](https://webtranslateit.com), a web-based computer-aided translation tool.
|
11
|
+
|
12
|
+
![Web Translate It](http://s3.amazonaws.com:80/edouard.baconfile.com/web_translate_it%2Fwti2.png)
|
13
|
+
|
14
|
+
This gem provides 4 tools:
|
15
|
+
|
16
|
+
* an executable, `wti`, that will help you to upload and download language files from the command line,
|
17
|
+
* a synchronisation server to help your translation team update your language files from a web-based interface,
|
18
|
+
* a handful of rake task you can use with your Ruby on Rails application,
|
19
|
+
* a rack middleware to automatically fetch new translations from Web Translate It.
|
20
|
+
|
21
|
+
## Installation
|
22
|
+
|
23
|
+
These instructions are for Linux and Mac OS X system. Follow [these instructions](http://help.webtranslateit.com/kb/tips/how-to-install-wti-on-windows) if you’re using Microsoft Windows.
|
24
|
+
|
25
|
+
gem install web_translate_it
|
26
|
+
|
27
|
+
At this point you should have the `wti` executable working.
|
28
|
+
If your project if already set up on Web Translate It, open a terminal and type `wti autoconf` to generate the configuration file.
|
29
|
+
|
30
|
+
Execute `wti --help` to see the usage:
|
31
|
+
|
32
|
+
Usage: wti [-lcphhv]
|
33
|
+
pull Pull target language file(s)
|
34
|
+
push Push master language file(s)
|
35
|
+
add Create and push a new master language file
|
36
|
+
addlocale Add a new locale to the project
|
37
|
+
server Start a synchronisation server
|
38
|
+
stats Fetch and display project statistics
|
39
|
+
autoconf Configure your project to sync
|
40
|
+
|
41
|
+
Synchronization options:
|
42
|
+
-l, --locale ISO code of a locale to pull or push
|
43
|
+
-c, --config Path to a translation.yml file
|
44
|
+
(default: config/translation.yml)
|
45
|
+
--all Download or upload all files
|
46
|
+
--force Force wti pull to download files
|
47
|
+
--merge Force WTI to merge this file
|
48
|
+
--ignore_missing Force WTI to not obsolete missing strings
|
49
|
+
--low_priority Tells WTI to process this command with a low priority
|
50
|
+
--label Apply a label to the changes
|
51
|
+
|
52
|
+
Server options:
|
53
|
+
-p, --port Run server on a specific port
|
54
|
+
(default: 4000)
|
55
|
+
-h, --host Run server on a specific host
|
56
|
+
(default: localhost)
|
57
|
+
|
58
|
+
Other options:
|
59
|
+
-h, --help Show this message
|
60
|
+
-v, --version Show version
|
61
|
+
|
62
|
+
## Configuration
|
63
|
+
|
64
|
+
Now that the tool is installed, you’ll have to configure your project:
|
65
|
+
|
66
|
+
wti autoconf
|
67
|
+
|
68
|
+
It will ask for your Web Translate It API key, and where to save its configuration file. Letting it put in `config/translations.yml` makes everything easier.
|
69
|
+
|
70
|
+
## Usage
|
71
|
+
|
72
|
+
### Uploading your first language file
|
73
|
+
|
74
|
+
If you have no file on Web Translate It yet, you need to send us your master language files. You can do it from the web interface, or from the command line:
|
75
|
+
|
76
|
+
wti add path/to/master/file.po
|
77
|
+
|
78
|
+
You can also add several files at once:
|
79
|
+
|
80
|
+
wti add file1.po file2.po file3.xml
|
81
|
+
|
82
|
+
Or
|
83
|
+
|
84
|
+
wti add *.po
|
85
|
+
|
86
|
+
After receiving your master language files, Web Translate It will automatically create the corresponding, empty target files. If you have already some translations for these files, use `wti push --all` to synchronise them to Web Translate It.
|
87
|
+
|
88
|
+
### Updating a master language file
|
89
|
+
|
90
|
+
wti push
|
91
|
+
|
92
|
+
### Updating a target language file
|
93
|
+
|
94
|
+
wti push -l fr
|
95
|
+
|
96
|
+
where `fr` should be replaced by the locale code of your file.
|
97
|
+
|
98
|
+
### Updating all language files
|
99
|
+
|
100
|
+
wti push --all
|
101
|
+
|
102
|
+
### Download target language files
|
103
|
+
|
104
|
+
wti pull
|
105
|
+
|
106
|
+
### Download a specific language file
|
107
|
+
|
108
|
+
wti pull -l fr
|
109
|
+
|
110
|
+
### Download all the language files
|
111
|
+
|
112
|
+
wti pull --all
|
113
|
+
|
114
|
+
### Force pull (bypass Web Translate It’s HTTP caching)
|
115
|
+
|
116
|
+
wti pull --force
|
117
|
+
|
118
|
+
### View project stats
|
119
|
+
|
120
|
+
wti stats
|
121
|
+
|
122
|
+
## Web Translate It Synchronisation Console
|
123
|
+
|
124
|
+
![Web Translate It](http://s3.amazonaws.com:80/edouard.baconfile.com/web_translate_it%2Fadmin_console2.png)
|
125
|
+
|
126
|
+
The `wti` gem integrates since its version 1.7.0 a sinatra back-end that allow you to sync your translations directly from a friendly web interface. It allows a translation team to refresh the language files on a staging server without having to ask the developers to manually `wti pull`.
|
127
|
+
|
128
|
+
To get started, go to the directory of the application you want to sync and do:
|
129
|
+
|
130
|
+
wti server
|
131
|
+
|
132
|
+
By default, it starts an application on localhost on the port 4000. You will find the tool on `http://localhost:4000`.
|
133
|
+
|
134
|
+
Should you need to use another host or port, you can use the `-h` and `-p` options. For example: `wti server -p 1234`.
|
135
|
+
|
136
|
+
You may want to run some commands before or after synching translations. To do so, add in the `translation.yml` file the following:
|
137
|
+
|
138
|
+
before_pull: "echo 'some unix command'"
|
139
|
+
after_pull: "touch tmp/restart.txt"
|
140
|
+
|
141
|
+
`before_pull` and `after_pull` will respectively be executed before and after pulling your language files.
|
142
|
+
|
143
|
+
## Rake tasks
|
144
|
+
|
145
|
+
This gem includes some rake tasks and a rack middleware you could use to integrate Web Translate It with Ruby on Rails. The rake tasks are significantly slower than the executable, since it has to load the whole rails stack.
|
146
|
+
|
147
|
+
* Add to your config/environments.rb:
|
148
|
+
|
149
|
+
`config.gem 'web_translate_it'`
|
150
|
+
|
151
|
+
* Then, run:
|
152
|
+
|
153
|
+
`rake gems:install`
|
154
|
+
|
155
|
+
* If you did not already did `wti autoconf`, copy your API key from Web Translate It and run:
|
156
|
+
|
157
|
+
`script/generate webtranslateit --api-key your_key_here`
|
158
|
+
|
159
|
+
The generator does two things:
|
160
|
+
|
161
|
+
- It adds a auto-configured `config/translation.yml` file using Web Translate It’s API.
|
162
|
+
- It adds `require 'web_translate_it/tasks' rescue LoadError` to your `Rakefile`
|
163
|
+
|
164
|
+
There are 3 rake tasks.
|
165
|
+
|
166
|
+
rake trans:fetch:all
|
167
|
+
|
168
|
+
Fetch the latest translations for all your files for all languages defined in Web Translate It’s interface, except for the languages set in `ignore_locales`.
|
169
|
+
|
170
|
+
rake trans:fetch[fr_FR]
|
171
|
+
|
172
|
+
Fetch the latest translations for all the languages defined in Web Translate It’s interface. It takes the locale name as a parameter
|
173
|
+
|
174
|
+
rake trans:upload[fr_FR]
|
175
|
+
|
176
|
+
Upload to Web Translate It your files in a specific locale defined in Web Translate It’s interface.
|
177
|
+
|
178
|
+
Read more about [Rails integration in the wiki](http://wiki.github.com/AtelierConvivialite/webtranslateit/).
|
179
|
+
|
180
|
+
### Supported Rails Versions
|
181
|
+
|
182
|
+
The gem currently has been tested against the following versions of Rails:
|
183
|
+
|
184
|
+
* 2.3.4
|
185
|
+
* 2.3.5
|
186
|
+
* 2.3.10
|
187
|
+
|
188
|
+
Please open a discussion on [our support site](http://help.webtranslateit.com) if you're using a version of Rails that is not listed above and the gem is not working properly.
|
189
|
+
|
190
|
+
# License
|
191
|
+
|
192
|
+
Copyright (c) 2009-2011 Atelier Convivialité, and released under the MIT License.
|
data/version.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_translate_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 105
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 7
|
9
9
|
- 1
|
10
|
-
-
|
11
|
-
version: 1.7.1.
|
10
|
+
- 5
|
11
|
+
version: 1.7.1.5
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- "\xC3\x89douard Bri\xC3\xA8re"
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-02-10 00:00:00 +01:00
|
20
20
|
default_executable: wti
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -27,11 +27,12 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - ~>
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
hash:
|
30
|
+
hash: 19
|
31
31
|
segments:
|
32
32
|
- 1
|
33
|
+
- 1
|
33
34
|
- 0
|
34
|
-
version:
|
35
|
+
version: 1.1.0
|
35
36
|
type: :runtime
|
36
37
|
version_requirements: *id001
|
37
38
|
- !ruby/object:Gem::Dependency
|
@@ -58,11 +59,12 @@ dependencies:
|
|
58
59
|
requirements:
|
59
60
|
- - ~>
|
60
61
|
- !ruby/object:Gem::Version
|
61
|
-
hash:
|
62
|
+
hash: 23
|
62
63
|
segments:
|
63
64
|
- 1
|
64
|
-
-
|
65
|
-
|
65
|
+
- 1
|
66
|
+
- 2
|
67
|
+
version: 1.1.2
|
66
68
|
type: :runtime
|
67
69
|
version_requirements: *id003
|
68
70
|
- !ruby/object:Gem::Dependency
|
@@ -92,8 +94,8 @@ extra_rdoc_files:
|
|
92
94
|
- README.md
|
93
95
|
files:
|
94
96
|
- history.md
|
95
|
-
-
|
96
|
-
-
|
97
|
+
- licence
|
98
|
+
- readme.md
|
97
99
|
- version.yml
|
98
100
|
- examples/locale.rb
|
99
101
|
- examples/translation.yml
|
@@ -115,6 +117,7 @@ files:
|
|
115
117
|
- man/wti.1
|
116
118
|
- man/wti.1.html
|
117
119
|
- man/wti.1.ron
|
120
|
+
- README.md
|
118
121
|
- spec/examples/config/translation.yml
|
119
122
|
- spec/examples/en.yml
|
120
123
|
- spec/spec.opts
|
@@ -154,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
157
|
requirements: []
|
155
158
|
|
156
159
|
rubyforge_project:
|
157
|
-
rubygems_version: 1.
|
160
|
+
rubygems_version: 1.5.0
|
158
161
|
signing_key:
|
159
162
|
specification_version: 3
|
160
163
|
summary: Sync your translations between your app and Web Translate It
|