From c610cd64a0b754a5623b2a91c7fe3220f7933ef9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 8 Aug 2011 23:56:51 -0400 Subject: v3: po4a, make use of base directory (default) language setting * set original language, (instead of assuming English) (per directory or wider) --- data/doc/sisu/CHANGELOG_v3 | 6 ++++-- lib/sisu/v3/po4a.rb | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 9d00f986..dbe0bc2a 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -22,8 +22,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.15.orig.tar.gz * options, default action on running "sisu3 [filename.sst]", fix - * sysenv, options, sisurc.yml base directory language setting, to be used - e.g. by po for setting original language, (instead of assuming English) + * sysenv, options, sisurc.yml base directory (default) language setting + + * po4a, make use of base directory (default) language setting + (for setting original language, (instead of assuming English)) * objects.txt, removed, cleaning diff --git a/lib/sisu/v3/po4a.rb b/lib/sisu/v3/po4a.rb index c87da346..a1f4991a 100644 --- a/lib/sisu/v3/po4a.rb +++ b/lib/sisu/v3/po4a.rb @@ -77,7 +77,7 @@ module SiSU_po4a r.gsub!(/\|en\|/,'|') @lang_regx=%r{(?:#{r})} if opt.fns =~/\S+?~#{@lang_regx}\.ss[mti]/ \ - and opt.f_pth[:lng]!='en' + and opt.f_pth[:lng]!=opt.lng_base @@opt_src_=false @@opt_trn=opt @@md_trn=SiSU_Param::Parameters.new(opt).get @@ -114,7 +114,7 @@ module SiSU_po4a SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{path}/#{md.fnb}/#{md.fn[:plain]}").flow if @opt.cmd =~/[MV]/ end if @opt.fns =~/\S+?~#{@lang_regx}\.ss[mti]/ \ - or @opt.f_pth[:lng] !='en' + or @opt.f_pth[:lng] !=opt.lng_base opt_lang_trn_fn=fn @dal_array_lang_translation=SiSU_DAL::Source.new(@opt,opt_lang_trn_fn).get # dal file drawn here opt_lang_src_fn=if fn =~/\S+?~\S{2}(?:_\S{2})?\.ss[mti]/ @@ -124,7 +124,7 @@ module SiSU_po4a transdir,srcdir=Dir.pwd,Dir.pwd if Dir.pwd.to_s =~/\/#{@lang_regx}$/ transdir=Dir.pwd - srcdir=transdir.gsub(/\/#{@lang_regx}$/,'/en') + srcdir=transdir.gsub(/\/#{@lang_regx}$/,"/#{opt.lng_base}") if FileTest.directory?(srcdir) Dir.chdir(srcdir) end @@ -924,7 +924,7 @@ GSUB @file=SiSU_Env::SiSU_file.new(md,fn) end def po4a #%pot output - file_pot=(@md.opt.f_pth[:lng] =='en') \ + file_pot=(@md.opt.f_pth[:lng] ==opt.lng_base) \ ? @file.write_file.pot \ : @file.write_file.po @sisu=[] @@ -955,7 +955,7 @@ GSUB require_relative 'git' # git.rb git=SiSU_Git::Source.new(@md.opt) git.create_file_structure_git unless FileTest.directory?(@file.output_path.pot_git.dir) - if @md.opt.f_pth[:lng] =='en' + if @md.opt.f_pth[:lng] ==opt.lng_base cp(@file.place_file.pot.dir, @file.output_path.pot_git.dir) else # naive, work on --> cp(@file.place_file.po.dir, @file.output_path.po_git.dir) #unless FileTest.file?(@file.place_file.po_git.dir) -- cgit v1.2.3