From da1736600c488f35a9b900a79ed4fe9b53d909a5 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 10 Nov 2018 12:12:17 +0000 Subject: [PATCH] Localized xml parsing error string. --- WEB-INF/lib/ttOrgImportHelper.class.php | 12 ++++++------ WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 1 + WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 1 + WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 1 + WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 1 + WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 1 + WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 1 + WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + WEB-INF/templates/footer.tpl | 2 +- 32 files changed, 37 insertions(+), 7 deletions(-) diff --git a/WEB-INF/lib/ttOrgImportHelper.class.php b/WEB-INF/lib/ttOrgImportHelper.class.php index 015579c0..57f22108 100644 --- a/WEB-INF/lib/ttOrgImportHelper.class.php +++ b/WEB-INF/lib/ttOrgImportHelper.class.php @@ -171,9 +171,9 @@ class ttOrgImportHelper { $file = fopen($filename, 'r'); while ($data = fread($file, 4096)) { if (!xml_parse($parser, $data, feof($file))) { - $this->errors->add(sprintf("XML error: %s at line %d", - xml_error_string(xml_get_error_code($parser)), - xml_get_current_line_number($parser))); + $this->errors->add(sprintf($i18n->get('error.xml'), + xml_get_current_line_number($parser), + xml_error_string(xml_get_error_code($parser)))); } } if ($this->conflicting_entities) { @@ -199,9 +199,9 @@ class ttOrgImportHelper { $file = fopen($filename, 'r'); while ($data = fread($file, 4096)) { if (!xml_parse($parser, $data, feof($file))) { - $this->errors->add(sprintf("XML error: %s at line %d", - xml_error_string(xml_get_error_code($parser)), - xml_get_current_line_number($parser))); + $this->errors->add(sprintf($i18n->get('error.xml'), + xml_get_current_line_number($parser), + xml_error_string(xml_get_error_code($parser)))); } } xml_parser_free($parser); diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 2a74077e..5bfd796e 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -116,6 +116,7 @@ $i18n_key_words = array( // 'error.goto_uncompleted' => 'Go to uncompleted entry.', // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 4d593749..d407dccf 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -118,6 +118,7 @@ $i18n_key_words = array( // 'error.goto_uncompleted' => 'Go to uncompleted entry.', // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 914bba6d..f475e06f 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -109,6 +109,7 @@ $i18n_key_words = array( 'error.overlap' => 'Tidsinterval overlapper eksisterende poster.', 'error.future_date' => 'Datoen er ud i fremtiden.', // TODO: translate the following. +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 9e118e4a..ea58b9a4 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -102,6 +102,7 @@ $i18n_key_words = array( 'error.overlap' => 'Der Zeitinterval überschneidet sich mit vorhandenen Einträgen.', 'error.future_date' => 'Datum ist in der Zukunft.', // TODO: translate the following. +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 16f61f22..82059051 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -100,6 +100,7 @@ $i18n_key_words = array( 'error.goto_uncompleted' => 'Go to uncompleted entry.', 'error.overlap' => 'Time interval overlaps with existing records.', 'error.future_date' => 'Date is in future.', +'error.xml' => 'Error in XML file at line %d: %s.', 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 2ee7de8c..740be123 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -114,6 +114,7 @@ $i18n_key_words = array( // 'error.goto_uncompleted' => 'Go to uncompleted entry.', // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 86cde2a3..b9f784f7 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -119,6 +119,7 @@ $i18n_key_words = array( // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', // TODO: translate the following. +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 55625a88..e6d54ee9 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -116,6 +116,7 @@ $i18n_key_words = array( 'error.overlap' => 'بازه زمانی با سوابق موجود هم پوشانی دارد.', // TODO: translate the following. // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 36b4d0bd..316b3f8f 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -111,6 +111,7 @@ $i18n_key_words = array( 'error.overlap' => 'Aikavälillä on päällekkäisiä syötteitä.', 'error.future_date' => 'Aika on tulevaisuudessa.', // TODO: translate the following. +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 6290479f..529fc2da 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -109,6 +109,7 @@ $i18n_key_words = array( 'error.overlap' => 'Les heures des projets ne peuvent se chevaucher.', 'error.future_date' => 'Date ultérieure.', // TODO: translate the following. +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index f2de6f51..2b523141 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -103,6 +103,7 @@ $i18n_key_words = array( 'error.overlap' => 'Το χρονικό διάστημα επικαλύπτει υπάρχουσες καταχωρήσεις.', 'error.future_date' => 'Η ημερομηνία είναι στο μέλλον.', // TODO: translate the following. +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 66cbea76..878e5ba9 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -126,6 +126,7 @@ $i18n_key_words = array( 'error.overlap' => 'טווח הזמן מתנגש עם רישומים קיימים.', // TODO: translate the following. // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index b740fe35..f98dffa1 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -115,6 +115,7 @@ $i18n_key_words = array( // 'error.goto_uncompleted' => 'Go to uncompleted entry.', // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 5d0600aa..07ed67c5 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -107,6 +107,7 @@ $i18n_key_words = array( 'error.overlap' => 'Intervallo temporale sovrapposto a voci esistenti.', 'error.future_date' => 'La data è nel futuro.', // TODO: translate the following. +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 6149e7c4..0d077507 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -120,6 +120,7 @@ $i18n_key_words = array( // 'error.goto_uncompleted' => 'Go to uncompleted entry.', // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index fa41f2ca..0bc21ee8 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -119,6 +119,7 @@ $i18n_key_words = array( // 'error.goto_uncompleted' => 'Go to uncompleted entry.', // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 8c4a5244..02e0ab32 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -100,6 +100,7 @@ $i18n_key_words = array( 'error.overlap' => 'De huidige registratie overlapt een reeds bestaande registratie.', 'error.future_date' => 'Datum ligt in de toekomst.', // TODO: translate the following. +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 044a6f33..c7f0fe25 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -120,6 +120,7 @@ $i18n_key_words = array( // TODO: translate the following. // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index c94ae1c9..ffc6d37b 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -113,6 +113,7 @@ $i18n_key_words = array( 'error.overlap' => 'Okres czasowy nakłada się z istniejącymi wpisami.', 'error.future_date' => 'Data jest w przyszłości.', // TODO: translate the following. +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index f40b5f01..9b5bf759 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -110,6 +110,7 @@ $i18n_key_words = array( 'error.overlap' => 'O intervalo se sobrepõe com entradas já existentes.', 'error.future_date' => 'Data é no futuro.', // TODO: translate the following. +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 4f7d748b..e2e95a8a 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -112,6 +112,7 @@ $i18n_key_words = array( // 'error.goto_uncompleted' => 'Go to uncompleted entry.', // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 82d5d3e6..6840977e 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -120,6 +120,7 @@ $i18n_key_words = array( // 'error.goto_uncompleted' => 'Go to uncompleted entry.', // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 3974d167..3354eaaa 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -99,6 +99,7 @@ $i18n_key_words = array( 'error.goto_uncompleted' => 'Посмотреть неоконченную запись.', 'error.overlap' => 'Интервал времени перекрывается с существующими записями.', 'error.future_date' => 'Дата в будущем.', +'error.xml' => 'Ошибка в файле XML на строке %d: %s.', 'error.cannot_import' => 'Невозможно импортировать: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index cfca9b0a..18fa470d 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -115,6 +115,7 @@ $i18n_key_words = array( // TODO: translate the following. // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index e07b2089..7f09aac4 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -109,6 +109,7 @@ $i18n_key_words = array( // 'error.goto_uncompleted' => 'Go to uncompleted entry.', // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 6bc886a0..890b8ee9 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -110,6 +110,7 @@ $i18n_key_words = array( 'error.overlap' => 'Navedeni vremenski interval se podudara sa već unetim vremenom.', 'error.future_date' => 'Naveli ste budući datum.', // TODO: translate the following. +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index a646aab5..d2e227dc 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -107,6 +107,7 @@ $i18n_key_words = array( 'error.overlap' => 'Tidsintervallet överlappar med en redan existerande tidsregistrering.', 'error.future_date' => 'Det går inte att registrera tider framåt i tiden.', // TODO: translate the following. +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index eb488754..7f34cb37 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -123,6 +123,7 @@ $i18n_key_words = array( // 'error.goto_uncompleted' => 'Go to uncompleted entry.', // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index e37138ba..96e43164 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -112,6 +112,7 @@ $i18n_key_words = array( // TODO: translate the following. // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index f46f4562..8664f193 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -117,6 +117,7 @@ $i18n_key_words = array( // 'error.goto_uncompleted' => 'Go to uncompleted entry.', // 'error.overlap' => 'Time interval overlaps with existing records.', // 'error.future_date' => 'Date is in future.', +// 'error.xml' => 'Error in XML file at line %d: %s.', // 'error.cannot_import' => 'Cannot import: %s.', // Labels for buttons. diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 9e7af7c9..3789b25c 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.12.4399 | Copyright © Anuko | +  Anuko Time Tracker 1.18.12.4400 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1