wti_gettext_i18n_rails 1.0.2 → 1.0.3

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.
@@ -22,7 +22,7 @@ namespace :trans do
22
22
  configuration.ignore_locales.each do |ignore|
23
23
  locales.delete(ignore)
24
24
  end
25
- puts "Fetching all files for all locales"
25
+ puts "Fetching all files for all locales..."
26
26
  locales.each do |locale|
27
27
  configuration.files.each do |file|
28
28
  unless File.exist?(file.file_path_for_directory(locale))
@@ -36,13 +36,14 @@ namespace :trans do
36
36
  end
37
37
 
38
38
  desc "Upload the translation files for a locale to Web Translate It"
39
- task :upload, :locale do |task, args|
39
+ task :upload do |task|
40
40
  welcome_message
41
- puts "Uploading file for locale #{args.locale}…"
41
+ filename = 'translation'
42
+ puts "Uploading file for locale translation.pot..."
42
43
  configuration = WebTranslateIt::Configuration.new
43
44
  configuration.files.each do |file|
44
- response_code = file.upload(args.locale)
45
- handle_response(file.file_path_for_locale(args.locale), response_code)
45
+ response_code = file.upload(filename)
46
+ handle_response(file.file_path_for_locale_initial(filename), response_code)
46
47
  end
47
48
  end
48
49
 
@@ -60,12 +60,11 @@ module WebTranslateIt
60
60
 
61
61
  def upload(locale)
62
62
  File.open(file_path_for_locale_initial(locale)) do |file|
63
- WebTranslateIt::Util.http_connection do |http|
64
- request = Net::HTTP::Put::Multipart.new(api_url(locale), "file" => UploadIO.new(file, "text/plain", file.path))
65
- response = http.request(request)
66
- response.code.to_i
67
- end
68
- #end
63
+ WebTranslateIt::Util.http_connection do |http|
64
+ request = Net::HTTP::Put::Multipart.new(api_url('en'), "file" => UploadIO.new(file, "text/plain", file.path))
65
+ response = http.request(request)
66
+ response.code.to_i
67
+ end
69
68
  end
70
69
  end
71
70
 
@@ -75,7 +74,7 @@ module WebTranslateIt
75
74
 
76
75
  # Convenience method which returns the file path of a TranslationFile for a given locale.
77
76
  def file_path_for_locale(locale)
78
- self.file_path.gsub("[locale].pot", locale.split(/-/, 2)[0].to_s.split(/_/, 2)[0].to_s + "/" + "en.po")
77
+ self.file_path.gsub("[locale].pot", locale.split(/-/, 2)[0].to_s.split(/_/, 2)[0].to_s + "/" + "translation.po")
79
78
  end
80
79
 
81
80
  def file_path_for_directory(locale)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 2
9
- version: 1.0.2
8
+ - 3
9
+ version: 1.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - "\xC3\x89douard Bri\xC3\xA8re"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-03-31 00:00:00 +02:00
18
+ date: 2010-04-06 00:00:00 +02:00
19
19
  default_executable: wti
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -45,21 +45,7 @@ dependencies:
45
45
  version: 1.2.0
46
46
  type: :development
47
47
  version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: mg
50
- prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- segments:
56
- - 0
57
- - 0
58
- - 7
59
- version: 0.0.7
60
- type: :development
61
- version_requirements: *id003
62
- description: A rack middleware and a handful of rake tasks to sync your translations between webtranslateit.com and your rails applications.
48
+ description: A rack middleware and a handful of rake tasks to sync your translations between webtranslateit.com and gettext_i18n_rails application
63
49
  email:
64
50
  executables:
65
51
  - wti
@@ -94,7 +80,7 @@ has_rdoc: true
94
80
  homepage: https://webtranslateit.com
95
81
  licenses: []
96
82
 
97
- post_install_message:
83
+ post_install_message: " ************************************************************\n\n Thank you for installing web_translate_it\n\n If you upgrade from a version <= 1.5.2\n be sure to read this blog post: http://bit.ly/aEox3b\n for useful information about this release.\n 1.6.0 bring some important breaking changes.\n\n ************************************************************\n"
98
84
  rdoc_options:
99
85
  - --main
100
86
  - README.md
@@ -120,7 +106,7 @@ rubyforge_project:
120
106
  rubygems_version: 1.3.6
121
107
  signing_key:
122
108
  specification_version: 3
123
- summary: Sync your translations between your Rails app and Web Translate It, adaptate for gettext_i18n_rails
109
+ summary: Sync your translations between your Rails app and Web Translate It
124
110
  test_files:
125
111
  - spec/examples/config/translation.yml
126
112
  - spec/examples/en.yml