class SiSU_Po4a::Source::Po4aCfg
Public Class Methods
new(opt,file)
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1070 def initialize(opt,file) @opt,@file=opt,file end
Public Instance Methods
dir()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1076 def dir def pwd Dir.pwd end def po4a_ 'po4a/' # '' end def pot po4a_ + 'pot' end def po po4a_ + 'po' end self end
language()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1094 def language def sisu_languages_available Px[:lng_lst] end def translation_languages_selected @opt.act[:po4a_lang_trans][:trn] \ ? @opt.act[:po4a_lang_trans][:trn] : [] end def translation_languages_selected_that_are_available translation_languages_selected & sisu_languages_available end def source_language_selected_str @opt.act[:po4a_lang_trans][:src] \ ? @opt.act[:po4a_lang_trans][:src] : 'en' end def translation_languages_selected_that_are_available_str translation_languages_selected_that_are_available.join(' ') end def translation_languages_selected_str @opt.act[:po4a_lang_trans][:trn].join(' ') end self end
po()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1086 def po po4a_ + 'po' end
po4a_()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1080 def po4a_ 'po4a/' # '' end
po4a_cfg()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1119 def po4a_cfg doc_import_list=composite_and_imported_filenames_array(@opt.fno) po4a_cfg_arr=[] po4a_cfg_arr \ << "[po4a_langs] #{language.translation_languages_selected_that_are_available_str}" po4a_cfg_arr \ << "[po4a_paths] #{dir.pot}/$master.pot $lang:#{dir.po}/$lang/$master.po" doc_import_list.each do |file_src| file_src_fn= file_src.gsub(/#{language.source_language_selected_str}\//,'') po4a_cfg_arr \ << "[type: text] #{file_src} $lang:$lang/#{file_src_fn}" end file=@file.write_file.po4a_cfg po4a_cfg_arr.each do |txt| puts txt file << txt << "\n" end file.close end
po4a_cfg_file()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1091 def po4a_cfg_file File.open("#{Dir.pwd}/#{po4a_cfg_filename}",'w') end
po4a_cfg_filename()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1073 def po4a_cfg_filename 'po4a.cfg' end
pot()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1083 def pot po4a_ + 'pot' end
pwd()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1077 def pwd Dir.pwd end
sisu_languages_available()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1095 def sisu_languages_available Px[:lng_lst] end
source_language_selected_str()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1106 def source_language_selected_str @opt.act[:po4a_lang_trans][:src] \ ? @opt.act[:po4a_lang_trans][:src] : 'en' end
translation_languages_selected()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1098 def translation_languages_selected @opt.act[:po4a_lang_trans][:trn] \ ? @opt.act[:po4a_lang_trans][:trn] : [] end
translation_languages_selected_str()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1114 def translation_languages_selected_str @opt.act[:po4a_lang_trans][:trn].join(' ') end
translation_languages_selected_that_are_available()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1103 def translation_languages_selected_that_are_available translation_languages_selected & sisu_languages_available end
translation_languages_selected_that_are_available_str()
click to toggle source
# File lib/sisu/src_po4a_shelf.rb, line 1111 def translation_languages_selected_that_are_available_str translation_languages_selected_that_are_available.join(' ') end