web_translate_it 1.6.5 → 1.6.6
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/en.yml +38 -3
- data/history.md +5 -0
- data/lib/web_translate_it/command_line.rb +18 -13
- data/lib/web_translate_it/translation_file.rb +2 -2
- data/version.yml +1 -1
- metadata +3 -3
data/examples/en.yml
CHANGED
@@ -1,3 +1,38 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
en:
|
2
|
+
activerecord:
|
3
|
+
errors:
|
4
|
+
templates:
|
5
|
+
header:
|
6
|
+
one: "1 error prohibited this {{model}} from being saved"
|
7
|
+
other: "{{count}} errors prohibited this {{model}} from being saved"
|
8
|
+
body: "there were problems with the following fields:"
|
9
|
+
messages:
|
10
|
+
accepted: "must be accepted"
|
11
|
+
blank: "can't be blank"
|
12
|
+
confirmation: "doesn't match confirmation"
|
13
|
+
empty: "can't be empty"
|
14
|
+
equal_to: "must be equal to {{count}}"
|
15
|
+
even: "must be even"
|
16
|
+
exclusion: "is reserved"
|
17
|
+
greater_than: "must be greater than {{count}}"
|
18
|
+
greater_than_or_equal_to: "must be greater than or equal to {{count}}"
|
19
|
+
inclusion: "is not included in the list"
|
20
|
+
invalid: "is invalid"
|
21
|
+
less_than: "must be less than {{count}}"
|
22
|
+
less_than_or_equal_to: "must be less than or equal to {{count}}"
|
23
|
+
not_a_number: "is not a number"
|
24
|
+
odd: "must be odd"
|
25
|
+
taken: "is already taken"
|
26
|
+
too_long: "is too long (maximum is {{count}} characters)"
|
27
|
+
too_short: "is too short (minimum is {{count}} characters)"
|
28
|
+
wrong_length: "is the wrong length (should be {{count}} characters)"
|
29
|
+
models:
|
30
|
+
invitation:
|
31
|
+
attributes:
|
32
|
+
email:
|
33
|
+
user_already_invited: "This user has already been invited"
|
34
|
+
user_already_member: "This user is already a member"
|
35
|
+
project_file:
|
36
|
+
attributes:
|
37
|
+
file:
|
38
|
+
file_format_not_supported: "Sorry, we currenly support only Gettext .pot/.po, .yml/.yaml and .strings"
|
data/history.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## Version 1.6.6 /2010-04-26
|
2
|
+
|
3
|
+
* New: `--merge` option to force WTI to perform a merge of this file with its database.
|
4
|
+
* New: `--ignore_missing` option to force WTI to not obsolete missing strings.
|
5
|
+
|
1
6
|
## Version 1.6.5 /2010-04-19
|
2
7
|
|
3
8
|
* Enhancement: Remove new line on push/pull result. It now displays `Pulling config/locales/app/fr.yml… 200 OK`.
|
@@ -4,23 +4,26 @@ module WebTranslateIt
|
|
4
4
|
require 'fileutils'
|
5
5
|
|
6
6
|
OPTIONS = <<-OPTION
|
7
|
-
pull
|
8
|
-
push
|
9
|
-
autoconf
|
10
|
-
stats
|
7
|
+
pull Pull target language file(s) from Web Translate It.
|
8
|
+
push Push master language file(s) to Web Translate It.
|
9
|
+
autoconf Configure your project to sync with Web Translate It.
|
10
|
+
stats Fetch and display your project statistics.
|
11
11
|
|
12
12
|
OPTIONAL PARAMETERS:
|
13
13
|
--------------------
|
14
|
-
-l --locale
|
15
|
-
-c --config
|
16
|
-
|
17
|
-
--all
|
18
|
-
--force
|
19
|
-
|
14
|
+
-l --locale The ISO code of a specific locale to pull or push.
|
15
|
+
-c --config Path to a translation.yml file. If this option
|
16
|
+
is absent, looks for config/translation.yml.
|
17
|
+
--all Respectively download or upload all files.
|
18
|
+
--force Force wti pull to re-download the language file,
|
19
|
+
regardless if local version is current.
|
20
|
+
--merge Force WTI to perform a merge of this file with its database.
|
21
|
+
--ignore_missing Force WTI to not obsolete missing strings.
|
22
|
+
|
20
23
|
OTHER:
|
21
24
|
------
|
22
|
-
-v --version
|
23
|
-
-h --help
|
25
|
+
-v --version Show version.
|
26
|
+
-h --help This page.
|
24
27
|
OPTION
|
25
28
|
|
26
29
|
def self.run
|
@@ -58,9 +61,11 @@ OPTION
|
|
58
61
|
STDOUT.sync = true
|
59
62
|
configuration = fetch_configuration
|
60
63
|
fetch_locales_to_push(configuration).each do |locale|
|
64
|
+
merge = !(ARGV.index('--merge')).nil?
|
65
|
+
ignore_missing = !(ARGV.index('--ignore_missing')).nil?
|
61
66
|
configuration.files.find_all{ |file| file.locale == locale }.each do |file|
|
62
67
|
print "Pushing #{file.file_path}… "
|
63
|
-
puts file.upload
|
68
|
+
puts file.upload(merge, ignore_missing)
|
64
69
|
end
|
65
70
|
end
|
66
71
|
end
|
@@ -56,11 +56,11 @@ module WebTranslateIt
|
|
56
56
|
# been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing
|
57
57
|
# actually takes place.
|
58
58
|
# This is due to the fact that language file imports are handled by background processing.
|
59
|
-
def upload
|
59
|
+
def upload(merge=false, ignore_missing=false)
|
60
60
|
if File.exists?(self.file_path)
|
61
61
|
File.open(self.file_path) do |file|
|
62
62
|
WebTranslateIt::Util.http_connection do |http|
|
63
|
-
request = Net::HTTP::Put::Multipart.new(api_url, "file" => UploadIO.new(file, "text/plain", file.path))
|
63
|
+
request = Net::HTTP::Put::Multipart.new(api_url, {"file" => UploadIO.new(file, "text/plain", file.path), "merge" => merge, "ignore_missing" => ignore_missing})
|
64
64
|
Util.handle_response(http.request(request))
|
65
65
|
end
|
66
66
|
end
|
data/version.yml
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 6
|
8
|
-
-
|
9
|
-
version: 1.6.
|
8
|
+
- 6
|
9
|
+
version: 1.6.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "\xC3\x89douard Bri\xC3\xA8re"
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-26 00:00:00 +02:00
|
18
18
|
default_executable: wti
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|