aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/options.rb')
-rw-r--r--lib/sisu/v3/options.rb18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/sisu/v3/options.rb b/lib/sisu/v3/options.rb
index 6626870f..5b179a57 100644
--- a/lib/sisu/v3/options.rb
+++ b/lib/sisu/v3/options.rb
@@ -62,11 +62,12 @@ module SiSU_commandline
require_relative 'sysenv' # sysenv.rb
@@base_path=nil
class Options
- attr_accessor :cmd,:mod,:act,:dir_structure_by,:f_pths,:files,:base_path,:base_stub,:paths,:lngs,:f_pth,:pth,:fns,:fnb,:fnc,:fncb,:lng,:what
+ attr_accessor :cmd,:mod,:act,:dir_structure_by,:f_pths,:files,:base_path,:base_stub,:paths,:lngs,:f_pth,:pth,:fns,:fnb,:fnc,:fncb,:lng,:lng_base,:what
def initialize(a)
- @cmd,@f_pth,@pth,@fns,@fnb,@fnc,@fncb,@what,@lng,@base_path,@base_stub='','','','','','','','','','','',''
+ @cmd,@f_pth,@pth,@fns,@fnb,@fnc,@fncb,@what,@lng,@lng_base,@base_path,@base_stub='','','','','','','','','','','','',''
@f_pths,@files,@paths,@mod,@act=Array.new(5){[]}
@env=SiSU_Env::Info_env.new
+ @lng_base=@env.language_default_set
@dir_structure_by=SiSU_Env::Env_call.new.output_dir_structure.by?
@@base_path ||=Dir.pwd
@base_path=@@base_path
@@ -134,7 +135,7 @@ module SiSU_commandline
end
end
r=Px[:lng_lst].join('|')
- r.gsub!(/\|en\|/,'|')
+ r.gsub!(/\|#{@lng_base}\|/,'|')
@lang_regx=%r{(?:#{r})}
z=if find_flag
if f.length > 0
@@ -144,7 +145,7 @@ module SiSU_commandline
end
elsif a.inspect =~/"(?:-\S+?|--\S+?)"/ \
&& a.inspect =~/"#{@lang_regx}\/?"/ \
- && a.inspect =~/"en\/\S+?\.ss[tm]"/
+ && a.inspect =~/"#{@lng_base}\/\S+?\.ss[tm]"/
init_selected_lang_dirs(a)
else b
end
@@ -154,7 +155,7 @@ module SiSU_commandline
def init_selected_lang_dirs(a)
@z=[]
a.each do |y|
- if y =~/^en\/(\S+?\.ss[tm])$/
+ if y =~/^#{@lng_base}\/(\S+?\.ss[tm])$/
@fn=$1
@z << y
elsif y =~/^#{@lang_regx}\/?$/
@@ -219,13 +220,13 @@ module SiSU_commandline
l_p
elsif x =~/~(#{r})\.ss[tm]/
$1
- else 'en'
+ else lng_base
end
lng_is =if l_p
l_p
elsif x =~/~(#{r})\.ss[tm]/
$1
- else 'en'
+ else lng_base
end
f_pths << {
pth: pt.split[0].realpath.to_s,
@@ -588,6 +589,9 @@ module SiSU_commandline
def lng
@lng
end
+ def lng_base
+ @lng_base
+ end
def fns
@fns
end