fair-gettext 2.0.2 → 2.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.
Binary file
data/gettext.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{fair-gettext}
5
- s.version = "2.0.2"
5
+ s.version = "2.0.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Masao Mutoh"]
data/lib/gettext/tools.rb CHANGED
@@ -88,17 +88,28 @@ module GetText
88
88
  # * mo_path_rule: the target directory for each mo-files.
89
89
  def create_mofiles(options = {})
90
90
  options = {:po_root => "./po"}.merge(options)
91
+
92
+ po_text = ''
93
+ mo_file = ''
94
+ pofile = ''
95
+
96
+ Dir.glob(File.join(options[:po_root], "*/")) do |dir|
97
+ Dir.glob(File.join(dir, "*.po")).each do |po_file|
98
+ po_text = File.read(po_file) + po_text
99
+ pofile = po_file unless po_file.include?("private")
100
+ mo_file = mo_file_from_po_file(pofile,options)
101
+ end
91
102
 
92
- Dir.glob(File.join(options[:po_root], "*/*.po")) do |po_file|
93
- mo_file = mo_file_from_po_file(po_file,options)
94
- $stderr.print %Q[#{po_file} -> #{mo_file} ... ] if options[:verbose]
103
+ en_tmp = dir + 'en_tmp.po'
104
+ file = File.new(en_tmp, "w+")
105
+ file << po_text
95
106
  FileUtils.mkdir_p(File.dirname(mo_file))
96
- rmsgfmt(po_file, mo_file)
97
- $stderr.puts "Done." if options[:verbose]
107
+ rmsgfmt(file, mo_file)
108
+ File.delete(en_tmp)
109
+ po_text = ''
98
110
  end
99
111
  end
100
112
 
101
-
102
113
  # At first, this creates the #{po_root}/#{domainname}.pot file using GetText.rgettext.
103
114
  # In the second step, this updates(merges) the #{po_root}/#{domainname}.pot and all of the
104
115
  # #{po_root}/#{lang}/#{domainname}.po files under "po_root" using "msgmerge".
@@ -23,13 +23,13 @@ module GetText
23
23
 
24
24
  def run(targetfile = nil, output_path = nil) # :nodoc:
25
25
  unless targetfile
26
- targetfile, output_path = check_options
26
+ targetfile, output_path = check_options
27
27
  end
28
28
  unless targetfile
29
- raise ArgumentError, _("no input files")
29
+ raise ArgumentError, _("no input files")
30
30
  end
31
31
  unless output_path
32
- output_path = "messages.mo"
32
+ output_path = "messages.mo"
33
33
  end
34
34
 
35
35
  parser = PoParser.new
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 2
9
- version: 2.0.2
8
+ - 3
9
+ version: 2.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Masao Mutoh
@@ -94,6 +94,7 @@ files:
94
94
  - data/locale/vi/LC_MESSAGES/rgettext.mo
95
95
  - data/locale/zh/LC_MESSAGES/rgettext.mo
96
96
  - data/locale/zh_TW/LC_MESSAGES/rgettext.mo
97
+ - fair-gettext-2.0.2.gem
97
98
  - gettext-2.0.0.gem
98
99
  - gettext.gemspec
99
100
  - lib/gettext/cgi.rb