get_pomo 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/get_pomo/po_file.rb +12 -4
- data/lib/get_pomo/version.rb +1 -1
- metadata +8 -10
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7d9bfc39b28cf385862461eb28f58aa4dd6e2da9
|
4
|
+
data.tar.gz: 4dc015cb5423989462ac675d5d947395ff705458
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 73465557ef57baa6efb55bae8e87748c09a76c03ad7811a204279d071be69edf1a1f892366971707e3584583e96124fabca9e3a358b139983c491d3d22a0dd53
|
7
|
+
data.tar.gz: f8b88c0770edba5ab337926391b782d75f4acbef25abc9e0d76f5b3d66b899d13f0e3a0e2ac331fe2d10499af5bf0693fb83c49c3fdb4efa5606735ad98eb8c5
|
data/lib/get_pomo/po_file.rb
CHANGED
@@ -22,6 +22,7 @@ module GetPomo
|
|
22
22
|
#and a msgid / msgstr
|
23
23
|
def add_translations_from_text(text)
|
24
24
|
start_new_translation
|
25
|
+
text.gsub!(/^#{"\357\273\277"}/, "") #remove boom
|
25
26
|
text.split(/$/).each_with_index do |line,index|
|
26
27
|
@line_number = index + 1
|
27
28
|
next if line.empty?
|
@@ -38,8 +39,15 @@ module GetPomo
|
|
38
39
|
end
|
39
40
|
|
40
41
|
def to_text
|
41
|
-
GetPomo.unique_translations(translations).map
|
42
|
+
GetPomo.unique_translations(translations).map do |translation|
|
42
43
|
comment = translation.comment.to_s.split(/\n|\r\n/).map{|line|"#{line}\n"}*''
|
44
|
+
|
45
|
+
msgctxt = if translation.msgctxt
|
46
|
+
%Q(msgctxt "#{translation.msgctxt}"\n)
|
47
|
+
else
|
48
|
+
""
|
49
|
+
end
|
50
|
+
|
43
51
|
msgid_and_msgstr = if translation.plural?
|
44
52
|
msgids =
|
45
53
|
%Q(msgid "#{escape_quotes(translation.msgid[0])}"\n)+
|
@@ -56,8 +64,8 @@ module GetPomo
|
|
56
64
|
%Q(msgstr "#{escape_quotes(translation.msgstr)}")
|
57
65
|
end
|
58
66
|
|
59
|
-
comment + msgid_and_msgstr
|
60
|
-
|
67
|
+
comment + msgctxt + msgid_and_msgstr
|
68
|
+
end * "\n\n"
|
61
69
|
end
|
62
70
|
|
63
71
|
private
|
@@ -87,7 +95,7 @@ module GetPomo
|
|
87
95
|
method, string = line.match(/^\s*([a-z0-9_\[\]]+)(.*)/)[1..2]
|
88
96
|
raise "no method found" unless method
|
89
97
|
|
90
|
-
start_new_translation if %W(msgid msgctxt).include? method and translation_complete?
|
98
|
+
start_new_translation if %W(msgid msgctxt msgctxt).include? method and translation_complete?
|
91
99
|
@last_method = method.to_sym
|
92
100
|
add_string(string)
|
93
101
|
end
|
data/lib/get_pomo/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: get_pomo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
5
|
-
prerelease:
|
4
|
+
version: 0.6.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Michael Grosser
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-12-26 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description:
|
15
14
|
email: michael@grosser.it
|
@@ -45,26 +44,25 @@ files:
|
|
45
44
|
homepage: https://github.com/grosser/get_pomo
|
46
45
|
licenses:
|
47
46
|
- MIT
|
47
|
+
metadata: {}
|
48
48
|
post_install_message:
|
49
49
|
rdoc_options: []
|
50
50
|
require_paths:
|
51
51
|
- lib
|
52
52
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
-
none: false
|
54
53
|
requirements:
|
55
|
-
- -
|
54
|
+
- - '>='
|
56
55
|
- !ruby/object:Gem::Version
|
57
56
|
version: '0'
|
58
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
-
none: false
|
60
58
|
requirements:
|
61
|
-
- -
|
59
|
+
- - '>='
|
62
60
|
- !ruby/object:Gem::Version
|
63
61
|
version: '0'
|
64
62
|
requirements: []
|
65
63
|
rubyforge_project:
|
66
|
-
rubygems_version: 1.
|
64
|
+
rubygems_version: 2.1.11
|
67
65
|
signing_key:
|
68
|
-
specification_version:
|
69
|
-
summary:
|
66
|
+
specification_version: 4
|
67
|
+
summary: 'Ruby/Gettext: A .po and .mo file parser/generator'
|
70
68
|
test_files: []
|