From 45d6d69d89fb6a8ad36be13f22c6af0b2a7cbc9a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 15 Jan 2015 23:38:04 -0500 Subject: d: po4a, initialize either directly with sst or passed through ao * creates source language directory with source markup files (.sst .ssm .ssi) & the po4a.cfg configuration file, then runs po4a to place the markup source under po4a translation management * --po4a-sst uses original sisu markup source as described above * --po4a-ao passes sisu source markup through document abstraction before converting back to a sisu markup source markup equivalent of the original document, it does this in an attempt to get more uniform output, and put footnotes for example if any in a form that is easier to translate --po4a-ao -v --trans-en:fr,es en/live-manual.ssm --po4a-ao -v --trans-en:fr,es en/live-manual.ssm \ es/live-manual.ssm in the latter example also runs sisu marked up "es" document through document abstraction and returns a sisu markup source version of the document, and against this gettext is (or can be run) to (attempt to) have the source and target languages together in the po/es file * all quite rough, will need to be revisited, * these for now replace the renamed --po4a-shelf (formerly --po4a) --- lib/sisu/develop/hub_actions.rb | 138 +++++++++++++++++++++++++++++++--------- 1 file changed, 108 insertions(+), 30 deletions(-) (limited to 'lib/sisu/develop/hub_actions.rb') diff --git a/lib/sisu/develop/hub_actions.rb b/lib/sisu/develop/hub_actions.rb index 44834cba..7130615e 100644 --- a/lib/sisu/develop/hub_actions.rb +++ b/lib/sisu/develop/hub_actions.rb @@ -158,7 +158,7 @@ module SiSU_Hub_Actions def abstract_objects? if @opt.act[:ao][:set]==:on #% --ao --dal, -m if @opt.f_pths.length > 0 - unless @opt.act[:po4a][:set]==:on # --po4a, -P + unless @opt.act[:po4a_shelf][:set]==:on # --po4a-shelf if @opt.fno =~ /\.ssm$/ require_relative 'ao_composite' # ao_composite.rb #pre-processing SiSU_Assemble::Composite.new(@opt).read @@ -548,15 +548,51 @@ module SiSU_Hub_Actions end end end + def po4a_make? + if @opt.act[:po4a_sst_ao_sst][:set]==:on #% --po4a-ao + if @opt.f_pths.length > 0 + require_relative 'src_po4a_sst_ao_sst' + SiSU_SStm_AO_SStm::Source.new(@opt).read_process_src_files # src_po4a_sst_ao_sst.rb + else + msg='sst request requires sisu markup files' + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan). + mark(msg) + else puts msg + end + end + end + end + def elasticsearch? + if @opt.act[:elasticsearch][:set]==:on #% --elastic, -x + if @opt.f_pths.length > 0 + require_relative 'json_elastic' # json_elastic.rb + SiSU_Elastic::Source.new(@opt).read + else + msg='easticsearch request requires sisu markup files' + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow). + mark(msg) + else puts msg + end + end + end + end def manifest? if @opt.act[:manifest][:set]==:on #% --manifest, -y if @opt.f_pths.length > 0 - require_relative 'html_manifest' # html_manifest.rb - ((@opt.act[:sisupod][:set]==:on \ - || @opt.act[:share_source][:set]==:on) \ - && @opt.f_pths.length < 2 ) \ - ? nil - : SiSU_Manifest::Source.new(@opt).read + begin + require_relative 'html_manifest' # html_manifest.rb + ((@opt.act[:sisupod][:set]==:on \ + || @opt.act[:share_source][:set]==:on \ + || @opt.act[:po4a_sstm][:set]==:on) \ + && @opt.f_pths.length < 2 ) \ + ? nil + : SiSU_Manifest::Source.new(@opt).read + rescue + end else msg='manifest request requires sisu markup files' if (@opt.act[:verbose_plus][:set]==:on \ @@ -588,8 +624,9 @@ module SiSU_Hub_Actions end def loop_files def share_source? - if @opt.act[:share_source][:set]==:on \ - or @opt.act[:sisupod][:set]==:on \ + if @opt.act[:sisupod][:set]==:on \ + or @opt.act[:share_source][:set]==:on \ + or @opt.act[:po4a_sstm][:set]==:on \ or @opt.act[:git][:set]==:on begin if @opt.f_pths.length > 0 @@ -607,26 +644,6 @@ module SiSU_Hub_Actions else puts msg end end - if @opt.act[:share_source][:set]==:on - if @opt.f_pths.length > 0 - require_relative 'src_share' # src_share.rb - begin - ensure - SiSU_Hub_Loops::OptionLoopFiles.new(@opt). - loop_files_on_given_option_bundle do - SiSU_Markup::Source.new(@opt).read - end - end - else - msg='share markup source request requires sisu markup files' - if (@opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan). - mark(msg) - else puts msg - end - end - end if @opt.act[:sisupod][:set]==:on #% --sisupod, -S if @opt.f_pths.length > 0 require_relative 'src_sisupod_make' # src_sisupod_make.rb @@ -672,7 +689,8 @@ module SiSU_Hub_Actions end end if (@opt.act[:sisupod][:set]==:on \ - || @opt.act[:share_source][:set]==:on) \ + || @opt.act[:share_source][:set]==:on \ + || @opt.act[:po4a_sstm][:set]==:on) \ and @opt.act[:manifest][:set]==:on #% --manifest, -y if @opt.f_pths.length > 0 require_relative 'html_manifest' # html_manifest.rb @@ -707,6 +725,66 @@ module SiSU_Hub_Actions end end end + if @opt.act[:share_source][:set]==:on + if @opt.f_pths.length > 0 + require_relative 'src_sisupod_sstm' # src_sisupod_sstm.rb + begin + ensure + SiSU_Hub_Loops::OptionLoopFiles.new(@opt). + loop_files_on_given_option_bundle do + SiSU_Markup::Source_Sisupod.new(@opt).read + end + end + else + msg='share markup source request requires sisu markup files' + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan). + mark(msg) + else puts msg + end + end + end + if @opt.act[:po4a_sstm][:set]==:on #% --po4a-sst + if @opt.f_pths.length > 0 + require_relative 'src_po4a_sstm' + begin + SiSU_Hub_Loops::OptionLoopFiles.new(@opt). + loop_files_on_given_option do + SiSU_Markup::Source_Po4a.new(@opt).read # src_po4a_sstm.rb + end + ensure + end + else + msg='sst request requires sisu markup files' + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan). + mark(msg) + else puts msg + end + end + end + if @opt.act[:po4a_sst_ao_sst][:set]==:on #% --po4a-ao + if @opt.f_pths.length > 0 + require_relative 'src_po4a_sst_ao_sst' + begin + SiSU_Hub_Loops::OptionLoopFiles.new(@opt). + loop_files_on_given_option do + SiSU_SStm_AO_SStm::Source.new(@opt).read_setup # src_po4a_sst_ao_sst.rb + end + ensure + end + else + msg='sst request requires sisu markup files' + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan). + mark(msg) + else puts msg + end + end + end if @opt.act[:po4a_shelf][:set]==:on #% --po4a-shelf if @opt.f_pths.length > 0 require_relative 'src_po4a_shelf' -- cgit v1.2.3