idiom 0.3.0 → 0.3.1

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.4.0
data/idiom.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{idiom}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jeff Coleman"]
12
- s.date = %q{2011-07-06}
12
+ s.date = %q{2011-09-30}
13
13
  s.default_executable = %q{idiom}
14
14
  s.description = %q{Takes a set of keys in Yaml format and translates them through Google Translate.}
15
15
  s.email = %q{progressions@gmail.com}
data/lib/idiom/base.rb CHANGED
@@ -74,40 +74,18 @@ module Idiom #:nodoc:
74
74
  end
75
75
 
76
76
  def post_process(value, lang)
77
- if lang =~ /zh/
78
- value.gsub!("<strong>", "")
79
- value.gsub!("</strong>", "")
80
- end
81
-
82
- value.gsub!(/^#{194.chr}#{160.chr}/, "")
83
-
84
- value.gsub!(" ]", "]")
85
- value.gsub!("«", "\"")
86
- value.gsub!("»", "\"")
87
- value.gsub!(/\"\.$/, ".\"")
88
- value.gsub!(/\\ \"/, "\\\"")
89
- value.gsub!(/<\/ /, "<\/")
90
- value.gsub!(/(“|”)/, "\"")
91
- value.gsub!("<strong> ", "<strong>")
92
- value.gsub!(" </strong>", "</strong>")
93
- value.gsub!("&quot;", "\"")
94
- value.gsub!("&#39;", "\"")
95
- value.gsub!("&gt; ", ">")
77
+ value.gsub!('"。', '。"')
78
+ value.gsub!(/^[''"「«]+/, "")
79
+ value.gsub!(/[''"」»]+$/, "")
80
+ value.gsub!('"', "'")
81
+ value.gsub!("«", "")
82
+ value.gsub!("»", "")
96
83
 
97
- value.gsub!("\"", "'")
98
- value.gsub!(" \"O", " \\\"O")
99
-
100
- while value =~ /\[(\d)\]/
101
- index = $1.to_i
102
- value.sub!(/\[#{index}\]/, "{#{index}}")
103
- end
104
-
105
- value.gsub!(/\((0)\)/, "{0}")
106
- value.gsub!(/\((1)\)/, "{1}")
107
- value.gsub!(/\((2)\)/, "{2}")
108
- value.gsub!("(0)", "{0}")
109
-
110
- value.strip
84
+ value.strip!
85
+ value.capitalize!
86
+ value = "\"#{value}\"" if value.present?
87
+
88
+ value
111
89
  end
112
90
  end
113
91
 
data/lib/idiom/yaml.rb CHANGED
@@ -5,6 +5,10 @@ module Idiom #:nodoc:
5
5
  # Translator::Yaml.new().copy
6
6
  #
7
7
  class Yaml < Base
8
+ def destination_path(lang)
9
+ source
10
+ end
11
+
8
12
  def extension
9
13
  "yml"
10
14
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idiom
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeff Coleman
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-06 00:00:00 -05:00
18
+ date: 2011-09-30 00:00:00 -05:00
19
19
  default_executable: idiom
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency