diff options
author | Ralph Amissah <ralph@amissah.com> | 2013-07-30 21:25:48 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2013-07-30 21:25:48 -0400 |
commit | 363a1c71795d6034a996eb3b4a52b20c6dedca95 (patch) | |
tree | 92fcc4c01bdddbe8265c15b8a5aede4d1c4226ef /lib/sisu/v5/sysenv.rb | |
parent | v4 (v5): misc, minor (diff) |
v5: output structure by, add monolingual alt for :filetype & :filename, step 1
Diffstat (limited to 'lib/sisu/v5/sysenv.rb')
-rw-r--r-- | lib/sisu/v5/sysenv.rb | 48 |
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 |