From 3be326f0a482ed350f193094247d88055cfd5844 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sun, 10 Apr 2011 08:34:52 +0000 Subject: [PATCH] PDF: switch FPDF ANSI or TCPDF UTF-8 with general_pdf_encoding value instead of language value such as 'ja' (#61). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5385 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/export/pdf.rb | 12 ++---------- lib/redmine/helpers/gantt.rb | 6 +----- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/lib/redmine/export/pdf.rb b/lib/redmine/export/pdf.rb index 395624881..24f66cebd 100644 --- a/lib/redmine/export/pdf.rb +++ b/lib/redmine/export/pdf.rb @@ -189,11 +189,7 @@ module Redmine # Returns a PDF string of a list of issues def issues_to_pdf(issues, project, query) - if ( current_language.to_s.downcase == 'ko' || - current_language.to_s.downcase == 'ja' || - current_language.to_s.downcase == 'zh' || - current_language.to_s.downcase == 'zh-tw' || - current_language.to_s.downcase == 'th' ) + if l(:general_pdf_encoding).upcase != 'UTF-8' pdf = IFPDF.new(current_language) else pdf = ITCPDF.new(current_language) @@ -269,11 +265,7 @@ module Redmine # Returns a PDF string of a single issue def issue_to_pdf(issue) - if ( current_language.to_s.downcase == 'ko' || - current_language.to_s.downcase == 'ja' || - current_language.to_s.downcase == 'zh' || - current_language.to_s.downcase == 'zh-tw' || - current_language.to_s.downcase == 'th' ) + if l(:general_pdf_encoding).upcase != 'UTF-8' pdf = IFPDF.new(current_language) else pdf = ITCPDF.new(current_language) diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb index d6600bfe7..83fdcb025 100644 --- a/lib/redmine/helpers/gantt.rb +++ b/lib/redmine/helpers/gantt.rb @@ -507,11 +507,7 @@ module Redmine end if Object.const_defined?(:Magick) def to_pdf - if ( current_language.to_s.downcase == 'ko' || - current_language.to_s.downcase == 'ja' || - current_language.to_s.downcase == 'zh' || - current_language.to_s.downcase == 'zh-tw' || - current_language.to_s.downcase == 'th' ) + if l(:general_pdf_encoding).upcase != 'UTF-8' pdf = ::Redmine::Export::PDF::IFPDF.new(current_language) else pdf = ::Redmine::Export::PDF::ITCPDF.new(current_language) -- 2.39.5