From b5b64d1ebf203b04c5484020d02c354b18d30224 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 23 May 2011 21:50:23 -0400 Subject: v3: texpdf, filenames --- data/doc/sisu/CHANGELOG_v3 | 2 ++ lib/sisu/v3/texpdf.rb | 25 +++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 0958b687..a17ce05b 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -30,6 +30,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.10.orig.tar.gz (language code occurs in fixed location within file-name, could previously be configured to occur in 1 of 3 locations within file-name) + * texpdf filenames + * i18n, add language name translation column to hash/table * prog_text_translation: diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb index ebd68d6d..eff07f19 100644 --- a/lib/sisu/v3/texpdf.rb +++ b/lib/sisu/v3/texpdf.rb @@ -149,6 +149,7 @@ module SiSU_TeX @@n_lpdf||=0 #change def initialize(md,env) @md,@env=md,env + @f=SiSU_Env::SiSU_file.new(@md).base_filename end def latex_do(texfilename,papersize) @texfilename=texfilename @@ -175,12 +176,12 @@ module SiSU_TeX portrait_pdf="#{pwd}/#{tex_fn_base}.pdf" landscape_pdf="#{pwd}/#{tex_fn_base}.landscape.pdf" case papersize - when /a4/; pdf_p=@md.file.base_filename.pdf_p_a4; pdf_l=@md.file.base_filename.pdf_l_a4 - when /a5/; pdf_p=@md.file.base_filename.pdf_p_a5; pdf_l=@md.file.base_filename.pdf_l_a5 - when /b5/; pdf_p=@md.file.base_filename.pdf_p_b5; pdf_l=@md.file.base_filename.pdf_l_b5 - when /letter/; pdf_p=@md.file.base_filename.pdf_p_letter; pdf_l=@md.file.base_filename.pdf_l_letter - when /legal/; pdf_p=@md.file.base_filename.pdf_p_legal; pdf_l=@md.file.base_filename.pdf_l_legal - else pdf_p=@md.file.base_filename.pdf_p_a4; pdf_l=@md.file.base_filename.pdf_l_a4 + when /a4/; pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4 + when /a5/; pdf_p=@f.pdf_p_a5; pdf_l=@f.pdf_l_a5 + when /b5/; pdf_p=@f.pdf_p_b5; pdf_l=@f.pdf_l_b5 + when /letter/; pdf_p=@f.pdf_p_letter; pdf_l=@f.pdf_l_letter + when /legal/; pdf_p=@f.pdf_p_legal; pdf_l=@f.pdf_l_legal + else pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4 end Dir.mkdir(@md.file.output_path.pdf.dir) unless FileTest.directory?(@md.file.output_path.pdf.dir) if FileTest.file?(portrait_pdf) @@ -223,12 +224,12 @@ module SiSU_TeX end end case @md.papersize_array[0] #default pdf - when /a4/; pdf_p=@md.file.base_filename.pdf_p_a4; pdf_l=@md.file.base_filename.pdf_l_a4 - when /a5/; pdf_p=@md.file.base_filename.pdf_p_a5; pdf_l=@md.file.base_filename.pdf_l_a5 - when /b5/; pdf_p=@md.file.base_filename.pdf_p_b5; pdf_l=@md.file.base_filename.pdf_l_b5 - when /letter/; pdf_p=@md.file.base_filename.pdf_p_letter; pdf_l=@md.file.base_filename.pdf_l_letter - when /legal/; pdf_p=@md.file.base_filename.pdf_p_legal; pdf_l=@md.file.base_filename.pdf_l_legal - else pdf_p=@md.file.base_filename.pdf_p_a4; pdf_l=@md.file.base_filename.pdf_l_a4 + when /a4/; pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4 + when /a5/; pdf_p=@f.pdf_p_a5; pdf_l=@f.pdf_l_a5 + when /b5/; pdf_p=@f.pdf_p_b5; pdf_l=@f.pdf_l_b5 + when /letter/; pdf_p=@f.pdf_p_letter; pdf_l=@f.pdf_l_letter + when /legal/; pdf_p=@f.pdf_p_legal; pdf_l=@f.pdf_l_legal + else pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4 end if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{pdf_p}") mklnk=if @md.file.output_dir_structure.by_language_code? \ -- cgit v1.2.3