aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-12-26 21:43:46 -0500
committerRalph Amissah <ralph@amissah.com>2015-01-07 22:42:40 -0500
commitf23af592ed11742a7bf7d3c4272726774baacd51 (patch)
tree358b1d6ed6127a1b73162ef98f2a49a7a45d16a1
parentc&d: po4a, book index, reinstate (diff)
d: po4a, init, if lang src == translation, empty translation field
-rw-r--r--lib/sisu/develop/po4a.rb35
1 files changed, 28 insertions, 7 deletions
diff --git a/lib/sisu/develop/po4a.rb b/lib/sisu/develop/po4a.rb
index a302e02e..1ce46d1b 100644
--- a/lib/sisu/develop/po4a.rb
+++ b/lib/sisu/develop/po4a.rb
@@ -562,7 +562,10 @@ GSUB
end
desc="#{d}#{s_mark}#{instruct}"
orig="#{s_mark}#{dob_src.obj}"
- trans=(dob_trn=='') ? '' : "#{s_mark}#{dob_trn.obj}"
+ trans=((dob_trn=='') \
+ || (dob_src.obj == dob_trn.obj)) \
+ ? ''
+ : "#{s_mark}#{dob_trn.obj}"
util=pot_structure(desc,orig,trans)
wrapped=util.line_wrap
@pot[:body] << wrapped << br # main text, contents, body KEEP
@@ -603,7 +606,10 @@ GSUB
desc="#{d}#{s_mark}#{instruct}"
end
orig="#{s_mark}#{dob_src.obj}"
- trans=(dob_trn=='') ? '' : "#{s_mark}#{dob_trn.obj}"
+ trans=((dob_trn=='') \
+ || (dob_src.obj == dob_trn.obj)) \
+ ? ''
+ : "#{s_mark}#{dob_trn.obj}"
util=pot_structure(desc,orig,trans)
elsif dob_src.hang =~/[0-9]/ \
and dob_src.indent != dob_src.hang
@@ -621,7 +627,10 @@ GSUB
end
desc="#{d}#{s_mark}#{instruct}"
orig="#{s_mark}#{dob_src.obj}"
- trans=(dob_trn=='') ? '' : "#{s_mark}#{dob_trn.obj}"
+ trans=((dob_trn=='') \
+ || (dob_src.obj == dob_trn.obj)) \
+ ? ''
+ : "#{s_mark}#{dob_trn.obj}"
util=pot_structure(desc,orig,trans)
else
s_mark=desc=orig=trans=''
@@ -636,7 +645,10 @@ GSUB
end
desc="#{d}#{s_mark}#{instruct}"
orig="#{s_mark}#{dob_src.obj}"
- trans=(dob_trn=='') ? '' : "#{s_mark}#{dob_trn.obj}"
+ trans=((dob_trn=='') \
+ || (dob_src.obj == dob_trn.obj)) \
+ ? ''
+ : "#{s_mark}#{dob_trn.obj}"
else
mark=''
d=dob_src.is.to_s
@@ -647,7 +659,10 @@ GSUB
end
desc="#{d}#{s_mark}#{instruct}"
orig=dob_src.obj
- trans=(dob_trn=='') ? '' : dob_trn.obj
+ trans=((dob_trn=='') \
+ || (dob_src.obj == dob_trn.obj)) \
+ ? ''
+ : "#{s_mark}#{dob_trn.obj}"
end
util=pot_structure(desc,orig,trans)
end
@@ -674,7 +689,10 @@ GSUB
end
desc="#{d}#{s_mark}#{instruct}"
orig=dob_src.obj
- trans=(dob_trn=='') ? '' : dob_trn.obj
+ trans=((dob_trn=='') \
+ || (dob_src.obj == dob_trn.obj)) \
+ ? ''
+ : "#{s_mark}#{dob_trn.obj}"
util=pot_structure(desc,orig,trans)
unwrapped=util.no_line_wrap_block
@pot[:body] << unwrapped << br
@@ -690,7 +708,10 @@ GSUB
end
desc="#{d}#{s_mark}#{instruct}"
orig=dob_src.obj
- trans=(dob_trn=='') ? '' : dob_trn.obj
+ trans=((dob_trn=='') \
+ || (dob_src.obj == dob_trn.obj)) \
+ ? ''
+ : "#{s_mark}#{dob_trn.obj}"
util=pot_structure(desc,orig,trans)
unwrapped=util.no_line_wrap_block
@pot[:body] << unwrapped << br