aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/sysenv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v5/sysenv.rb')
-rw-r--r--lib/sisu/v5/sysenv.rb48
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/sysenv.rb
index 973e0dcc..dcf0a671 100644
--- a/lib/sisu/v5/sysenv.rb
+++ b/lib/sisu/v5/sysenv.rb
@@ -441,6 +441,32 @@ module SiSU_Env
end
@fnn,@fnb,@fnt,@flv,@fnz=@@fnn,@@fnb,@@fnt,@@flv,@@fnz
end
+ def default_language?
+ if @rc
+ if defined? @rc['language_default'] \
+ && (@rc['language_default'] =~/#{Px[:lng_lst_rgx]}/)
+ @rc['language_default']
+ else
+ 'en'
+ end
+ else
+ 'en'
+ end
+ end
+ def mono_multi_lingual?
+ if @rc
+ if defined? @rc['lingual'] \
+ && (@rc['lingual'] =~/mono(?:lingual)?/)
+ :mono
+ elsif defined? @rc['lingual'] \
+ && (@rc['lingual'] =~/multi(?:lingual)?/)
+ :multi
+ else
+ :multi
+ end
+ else :multi
+ end
+ end
def output_dir_structure
def by?
output_structure=:filename #set default output structure
@@ -5703,6 +5729,28 @@ WOK
self
end
end
+ class FilenameLanguageCodeInsert
+ def initialize(opt,lng=nil)
+ @opt,@lng=opt,lng
+ @opt=opt
+ @lng=lng ||=@opt.lng
+ end
+ def language_code_insert
+ if @opt.dir_structure_by ==:language \
+ or ((@opt.dir_structure_by ==:filetype \
+ || @opt.dir_structure_by ==:filename) \
+ and (@opt.lingual ==:mono \
+ && @opt.lng == @opt.act[:default_language][:code]))
+ ''
+ elsif (@opt.dir_structure_by ==:filetype \
+ || @opt.dir_structure_by ==:filename) \
+ and not @opt.lingual ==:mono
+ ".#{@lng}"
+ else
+ ".#{@lng}"
+ end
+ end
+ end
class CreateFile <InfoEnv #todo unify with FileOp
def initialize(fns)
begin