From 8a3dcc22484e01a06a0576cd47c88d9e99e7da77 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 6 Mar 2016 22:55:30 -0800 Subject: [PATCH] Fixed PDF for Russian language helvetica in TCPDF displays Russian incorrectly, had to use freeserif instead --- WEB-INF/resources/ca.lang.php | 2 ++ WEB-INF/resources/cs.lang.php | 2 ++ WEB-INF/resources/da.lang.php | 2 ++ WEB-INF/resources/de.lang.php | 2 ++ WEB-INF/resources/es.lang.php | 2 ++ WEB-INF/resources/et.lang.php | 2 ++ WEB-INF/resources/fa.lang.php | 2 ++ WEB-INF/resources/fi.lang.php | 2 ++ WEB-INF/resources/fr.lang.php | 2 ++ WEB-INF/resources/he.lang.php | 2 ++ WEB-INF/resources/hu.lang.php | 2 ++ WEB-INF/resources/it.lang.php | 2 ++ WEB-INF/resources/ja.lang.php | 2 ++ WEB-INF/resources/ko.lang.php | 2 ++ WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 2 ++ WEB-INF/resources/pl.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 2 ++ WEB-INF/resources/ro.lang.php | 2 ++ WEB-INF/resources/sk.lang.php | 2 ++ WEB-INF/resources/sl.lang.php | 2 ++ WEB-INF/resources/sv.lang.php | 2 ++ WEB-INF/resources/tr.lang.php | 2 ++ WEB-INF/resources/zh-cn.lang.php | 2 ++ WEB-INF/resources/zh-tw.lang.php | 2 ++ WEB-INF/templates/footer.tpl | 2 +- topdf.php | 8 +++----- 27 files changed, 54 insertions(+), 6 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 70657b1c..17ab223a 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -122,6 +122,8 @@ $i18n_key_words = array( 'label.password' => 'Paraula de pas', 'label.confirm_password' => 'Confirmar paraula de pas', 'label.email' => 'e-mail', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => 'Projecte', "form.filter.filter" => 'Report favorit', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 96d7b7d5..1acdf167 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -122,6 +122,8 @@ $i18n_key_words = array( 'label.confirm_password' => 'potvrdit heslo', // 'label.email' => 'email', 'label.total' => 'celkem', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => 'projekt', "form.filter.filter" => 'oblíbená sestava', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index c6ddba46..4d4de61e 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -123,6 +123,8 @@ $i18n_key_words = array( 'label.password' => 'adgangskode', 'label.confirm_password' => 'gentag adgangskode', 'label.email' => 'email', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => 'projekt', "form.filter.filter" => 'favorit rapport', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index ee6901a5..fb7cba90 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -182,6 +182,8 @@ $i18n_key_words = array( 'label.role_manager' => '(Manager)', 'label.role_comanager' => '(Co-Manager)', 'label.role_admin' => '(Administrator)', +// Translate the following string. +// 'label.page' => 'Page', // Labels for plugins (extensions to Time Tracker that provide additional features). 'label.custom_fields' => 'Benutzerfelder', 'label.type' => 'Typ', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index e7f88665..32cccd63 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -215,6 +215,8 @@ $i18n_key_words = array( 'label.role_manager' =>'(manejador)', 'label.role_comanager' => '(auxiliar del manejador)', 'label.role_admin' => '(administrador)', +// Translate the following string. +// 'label.page' => 'Page', // Labels for plugins (extensions to Time Tracker that provide additional features). // TODO: translate the following strings. // 'label.custom_fields' => 'Custom fields', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 3d709b22..1f8cdc54 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -122,6 +122,8 @@ $i18n_key_words = array( 'label.confirm_password' => 'kinnita salasõna', // 'label.email' => 'email', 'label.total' => 'kokku', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => 'projekt', "form.filter.filter" => 'lemmikraport', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 5cbfa9e9..c710c22c 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -191,6 +191,8 @@ $i18n_key_words = array( 'label.role_manager' => '(مدیر)', 'label.role_comanager' => '(دستیار مدیر)', 'label.role_admin' => '(مدیر ارشد)', +// Translate the following string. +// 'label.page' => 'Page', // Labels for plugins (extensions to Time Tracker that provide additional features). 'label.custom_fields' => 'فیلدهای سفارشی', 'label.type' => 'نوع', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 9315a545..aebd958c 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -182,6 +182,8 @@ $i18n_key_words = array( 'label.role_manager' => '(esimies)', 'label.role_comanager' => '(apu-esimies)', 'label.role_admin' => '(ylläpitäjä)', +// Translate the following string. +// 'label.page' => 'Page', // Labels for plugins (extensions to Time Tracker that provide additional features). 'label.custom_fields' => 'Omat kentät', 'label.type' => 'Tyyppi', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 09f38aa6..06532afe 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -193,6 +193,8 @@ $i18n_key_words = array( 'label.role_manager' => '(responsable)', 'label.role_comanager' => '(co-responsable)', 'label.role_admin' => '(administrateur)', +// Translate the following string. +// 'label.page' => 'Page', // Labels for plugins (extensions to Time Tracker that provide additional features). 'label.custom_fields' => 'Champs personalisés', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 389ac056..0f8019dc 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -194,6 +194,8 @@ $i18n_key_words = array( 'label.role_manager' => '(מנהל)', 'label.role_comanager' => '(מנהל משנה)', 'label.role_admin' => '(מנהל המערכת)', +// Translate the following string. +// 'label.page' => 'Page', // Labels for plugins (extensions to Time Tracker that provide additional features). 'label.custom_fields' => 'שדות אישיים', 'label.type' => 'סוג', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index bc498b82..7874436e 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -119,6 +119,8 @@ $i18n_key_words = array( 'label.confirm_password' => 'jelszó megerősítése', // 'label.email' => 'email', 'label.total' => 'összesen', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => 'projekt', "form.filter.filter" => 'előre definiált riport formátum', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 1e83f63b..b1a1aebf 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -121,6 +121,8 @@ $i18n_key_words = array( 'label.confirm_password' => 'conferma password', 'label.email' => 'e-mail', 'label.total' => 'totale', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => 'progetto', "form.filter.filter" => 'report preferiti', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 43349492..5ad54108 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -122,6 +122,8 @@ $i18n_key_words = array( 'label.confirm_password' => 'パスワードの確認', 'label.email' => 'Eメール', 'label.total' => '合計', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => 'プロジェクト', "form.filter.filter" => 'お気に入りレポート', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index cc50132c..eb8fa82a 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -120,6 +120,8 @@ $i18n_key_words = array( 'label.confirm_password' => '암호 확인', 'label.email' => '이메일', 'label.total' => '합계', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => '프로젝트', "form.filter.filter" => '좋아하는 보고서', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index e0352a1d..21903db3 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -182,6 +182,8 @@ $i18n_key_words = array( 'label.role_manager' => '(manager)', 'label.role_comanager' => '(co-manager)', 'label.role_admin' => '(beheerder)', +// Translate the following string. +// 'label.page' => 'Page', // Labels for plugins (extensions to Time Tracker that provide additional features). 'label.custom_fields' => 'Eigen velden', 'label.type' => 'Type', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index ca05af0a..a751b58c 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -120,6 +120,8 @@ $i18n_key_words = array( 'label.confirm_password' => 'Bekreft passord', // 'label.email' => 'email', 'label.total' => 'totalt', +// Translate the following string. +// 'label.page' => 'Page', // TODO: Please check the translation against the current English file as many things are being refactored. For example, many labels have been added after label.email. diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 141dcaec..b4ece7f7 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -182,6 +182,8 @@ $i18n_key_words = array( 'label.role_manager' => '(Manager)', 'label.role_comanager' => '(Co-manager)', 'label.role_admin' => '(Administrator)', +// Translate the following string. +// 'label.page' => 'Page', // Labels for plugins (extensions to Time Tracker that provide additional features). 'label.custom_fields' => 'Niestandardowe pola', 'label.type' => 'Rodzaj', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index be9fc017..041b91a2 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -117,6 +117,8 @@ $i18n_key_words = array( 'label.password' => 'senha', 'label.confirm_password' => 'confirme a senha', // 'label.email' => 'email', +// Translate the following string. +// 'label.page' => 'Page', // "form.filter.project" => 'project', // "form.filter.filter" => 'favorite report', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index b1671cfb..043ccb4e 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -122,6 +122,8 @@ $i18n_key_words = array( 'label.confirm_password' => 'confirma parola', // 'label.email' => 'email', 'label.total' => 'total', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => 'proiect', "form.filter.filter" => 'rapoarte favorite', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 25da5294..0ca2a6a4 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -191,6 +191,8 @@ $i18n_key_words = array( 'label.role_manager' => '(manažér)', 'label.role_comanager' => '(spolu-manažér)', 'label.role_admin' => '(administrátor)', +// Translate the following string. +// 'label.page' => 'Page', // Labels for plugins (extensions to Time Tracker that provide additional features). 'label.custom_fields' => 'Vlastné polia', 'label.type' => 'Typ', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 389f8172..b44cc646 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -116,6 +116,8 @@ $i18n_key_words = array( // 'label.confirm_password' => 'confirm password', 'label.email' => 'email', 'label.total' => 'total', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => 'projekt', "form.filter.filter" => 'favorite report', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 18a4f79b..a6bfa059 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -122,6 +122,8 @@ $i18n_key_words = array( 'label.confirm_password' => 'bekräfta lösenord', 'label.email' => 'e-post', 'label.total' => 'total', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => 'projekt', "form.filter.filter" => 'favorit rapport', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 5b45df0a..b397aab5 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -122,6 +122,8 @@ $i18n_key_words = array( 'label.confirm_password' => 'parolayı tekrala', 'label.email' => 'e-posta', 'label.total' => 'toplam', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => 'proje', "form.filter.filter" => 'sık kullanılan rapor', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index ae604cbf..7eaabc2f 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -120,6 +120,8 @@ $i18n_key_words = array( 'label.confirm_password' => '确认密码', 'label.email' => '电子邮件', 'label.total' => '总计', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => '项目', "form.filter.filter" => '收藏的报告', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index ddc96d07..6a946dd0 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -120,6 +120,8 @@ $i18n_key_words = array( 'label.confirm_password' => '確認密碼', 'label.email' => '電子郵件', 'label.total' => '總計', +// Translate the following string. +// 'label.page' => 'Page', "form.filter.project" => '項目', "form.filter.filter" => '收藏的報告', diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index b0711e0d..68f3af13 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -14,7 +14,7 @@
- diff --git a/topdf.php b/topdf.php index 744ef4a2..7aed32d7 100644 --- a/topdf.php +++ b/topdf.php @@ -354,7 +354,7 @@ class MyyPDF extends TCPDF { // Position at 15 mm from bottom. $this->SetY(-15); // Set font. - $this->SetFont('helvetica', 'I', 8); + $this->SetFont('freeserif', 'I', 8); // Print localized page number. $this->Cell(0, 10, $this->page_word.' '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M'); } @@ -369,8 +369,6 @@ if (file_exists('images/'.$user->team_id.'.png')) // Set page word for the footer. $pdf->SetPageWord($i18n->getKey('label.page')); -// TODO: currently, we have problems rendering PDF in some languages such as Russian (headers, page word). -// Not sure how to fix it... One option is to switch to mPDF - consider. // Set document information. $pdf->SetCreator(PDF_CREATOR); @@ -393,8 +391,8 @@ $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // Add a page. $pdf->AddPage(); -// Set font. -$pdf->SetFont('helvetica', '', 10); +// Set font (freeserif seems to work for all languages). +$pdf->SetFont('freeserif', '', 10); // helvetica here does not work for Russian. // Write HTML. $pdf->writeHTML($html, true, false, false, false, ''); -- 2.20.1
 Anuko Time Tracker 1.9.13.3390 | Copyright © Anuko | +  Anuko Time Tracker 1.9.13.3391 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license}