Class: SiSU_Po4a_Project::Po4aCfg
Instance Method Summary
collapse
#language, #sisu_languages_available, #source_language_selected_str, #translation_languages_available, #translation_languages_selected, #translation_languages_selected_str, #translation_languages_selected_that_are_available, #translation_languages_selected_that_are_available_str
#answer?, #available_selections_, #query, #response?, #response_short, #response_strict, #selection_options, #selections_available_
#composite_and_imported_filenames_array, #extract_filenames, #insert_filename?, #inserts_array
Constructor Details
#initialize(opt, file) ⇒ Po4aCfg
Returns a new instance of Po4aCfg.
94
95
96
|
# File 'lib/sisu/src_po4a_share.rb', line 94
def initialize(opt,file)
@opt,@file=opt,file
end
|
Instance Method Details
#dir ⇒ Object
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
# File 'lib/sisu/src_po4a_share.rb', line 108
def dir
def pwd
Dir.pwd
end
def po4a_
'po4a/' end
def pot
'pot'
end
def po
'po'
end
self
end
|
#po ⇒ Object
119
120
121
122
|
# File 'lib/sisu/src_po4a_share.rb', line 119
def po
'po'
end
|
#po4a_ ⇒ Object
112
113
114
|
# File 'lib/sisu/src_po4a_share.rb', line 112
def po4a_
'po4a/' end
|
#po4a_cfg ⇒ Object
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
# File 'lib/sisu/src_po4a_share.rb', line 128
def po4a_cfg
lng=language.source_language_selected_str
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] #{lng}/#{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 ⇒ Object
125
126
127
|
# File 'lib/sisu/src_po4a_share.rb', line 125
def po4a_cfg_file
File.open("#{Dir.pwd}/#{po4a_cfg_filename}",'w')
end
|
#po4a_cfg_filename ⇒ Object
105
106
107
|
# File 'lib/sisu/src_po4a_share.rb', line 105
def po4a_cfg_filename
'po4a.cfg'
end
|
#pot ⇒ Object
115
116
117
118
|
# File 'lib/sisu/src_po4a_share.rb', line 115
def pot
'pot'
end
|
#pwd ⇒ Object
109
110
111
|
# File 'lib/sisu/src_po4a_share.rb', line 109
def pwd
Dir.pwd
end
|
#song ⇒ Object
97
98
99
100
101
102
103
104
|
# File 'lib/sisu/src_po4a_share.rb', line 97
def song
if @opt.lng==language.source_language_selected_str
ans=response?('po4a config file')
if ans
po4a_cfg
end
end
end
|