fair-gettext 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/fair-gettext-2.0.2.gem +0 -0
- data/gettext.gemspec +1 -1
- data/lib/gettext/tools.rb +17 -6
- data/lib/gettext/tools/rmsgfmt.rb +3 -3
- metadata +3 -2
Binary file
|
data/gettext.gemspec
CHANGED
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
|
-
|
93
|
-
|
94
|
-
|
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(
|
97
|
-
|
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
|
-
|
26
|
+
targetfile, output_path = check_options
|
27
27
|
end
|
28
28
|
unless targetfile
|
29
|
-
|
29
|
+
raise ArgumentError, _("no input files")
|
30
30
|
end
|
31
31
|
unless output_path
|
32
|
-
|
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
|
-
-
|
9
|
-
version: 2.0.
|
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
|