diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-03-19 22:07:29 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-03-19 22:07:33 -0400 |
commit | 6811ac91f21a434fc7d967c11e1b20f33918c6ea (patch) | |
tree | 30f39674ca96a79f8a604a9f02d571f24320e221 /lib/sisu/v3/po4a_set.rb | |
parent | v3: 3.2.0 version & changelog "opened" (diff) |
v3: 3.2 branch is main (v3dv --> v3); dev (v3dv) branch directories removed
* v3dv (3.2) "merged" into v3 (previously 3.1) (& removed)
* conf/sisu/v3dv --> conf/sisu/v3
* data/sisu/v3dv --> data/sisu/v3
* lib/sisu/v3dv --> lib/sisu/v3
* bin/sisu* (v3dv references changed to v3)
* (--dev modifier (superfluous for the time being) runs main v3 branch)
Diffstat (limited to 'lib/sisu/v3/po4a_set.rb')
-rw-r--r-- | lib/sisu/v3/po4a_set.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/sisu/v3/po4a_set.rb b/lib/sisu/v3/po4a_set.rb index 1e0f90c4..6335fb8c 100644 --- a/lib/sisu/v3/po4a_set.rb +++ b/lib/sisu/v3/po4a_set.rb @@ -56,7 +56,7 @@ ** Description: modules shared by flatfile output generators =end -module SiSU_po4a_utils +module SiSU_Po4aUtils class Wrap def initialize(md,orig='',trans='',is_desc='',n_char_max=76,n_indent=0,n_hang=nil) @md,@orig,@trans,@is_desc,@n_char_max,@n_indent=md,orig,trans,is_desc,n_char_max,n_indent @@ -76,8 +76,8 @@ module SiSU_po4a_utils out=[] out[line]='' @oldword='' #REMOVE @oldword - pa.gsub!(/<br>/,' <br> ') - pa.gsub!(/#{Mx[:br_nl]}/,"\n\n") + pa=pa.gsub(/<br>/,' <br> '). + gsub(/#{Mx[:br_nl]}/,"\n\n") words=pa.scan(/\n\n|<br>|\S+/m) while words != '' word=words.shift @@ -109,7 +109,7 @@ module SiSU_po4a_utils x=out.join(spaces_indent).gsub(/\A\n+/m,'').insert(0,spaces_hang) z=[] x.split(/\n/).each do |y| - y.gsub!(/"/,'\"') + y=y.gsub(/"/,'\"') y=%{"#{y}"} z << y end @@ -120,7 +120,7 @@ module SiSU_po4a_utils trans=(pot.length == 2) ? pot[1] : '' po_str=<<WOK #. #{@po4a_identify_type} - #{@is_desc} -#: en/#{@md.fns}:#{Pot_number.new.num} +#: en/#{@md.fns}:#{PotNumber.new.num} msgid "" #{pot[0]} msgstr "" @@ -134,7 +134,7 @@ WOK pot_array.each do |pa| z=[] pa.split(/\n\n/).each do |y| - y.gsub!(/"/,'\"') + y=y.gsub(/"/,'\"') y=%{"#{y}"} z << y if not y.empty? end @@ -145,7 +145,7 @@ WOK trans=(pot.length == 2) ? pot[1] : '' po_str=<<WOK #. #{@po4a_identify_type} - #{@is_desc} -#: en/#{@md.fns}:#{Pot_number.new.num} +#: en/#{@md.fns}:#{PotNumber.new.num} #, no-wrap msgid "" #{pot[0]} @@ -166,13 +166,13 @@ WOK if @orig.class==Array @arr=[] @orig.each do |line| - @arr << SiSU_text_utils::Wrap.new(line,@n_char_max,@n_indent,@n_hang).line_wrap + @arr << SiSU_TextUtils::Wrap.new(line,@n_char_max,@n_indent,@n_hang).line_wrap end end @arr end end - class Header_scan + class HeaderScan def initialize(md,para) @md,@p=md,para end @@ -276,7 +276,7 @@ WOK end end end - class Paragraph_number + class ParagraphNumber def initialize(paranum) @paranum=/(\d+)/m.match(paranum)[1] end @@ -284,7 +284,7 @@ WOK @paranum.gsub(/(\d+)/,'#\1') end end - class Pot_number + class PotNumber @@n=0 def initialize @@n +=2 |