From 12266213d098a53c5f005b9afcbbe62771fd580c Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 9 May 2017 18:12:15 +0200 Subject: Shaarli's translation * translation system and unit tests * Translations everywhere Dont use translation merge It is not available with PHP builtin gettext, so it would have lead to inconsistency. --- application/NetscapeBookmarkUtils.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'application/NetscapeBookmarkUtils.php') diff --git a/application/NetscapeBookmarkUtils.php b/application/NetscapeBookmarkUtils.php index 31796367..31a14537 100644 --- a/application/NetscapeBookmarkUtils.php +++ b/application/NetscapeBookmarkUtils.php @@ -32,11 +32,11 @@ class NetscapeBookmarkUtils { // see tpl/export.html for possible values if (! in_array($selection, array('all', 'public', 'private'))) { - throw new Exception('Invalid export selection: "'.$selection.'"'); + throw new Exception(t('Invalid export selection:') .' "'.$selection.'"'); } $bookmarkLinks = array(); - +7 foreach ($linkDb as $link) { if ($link['private'] != 0 && $selection == 'public') { continue; @@ -79,14 +79,14 @@ class NetscapeBookmarkUtils $duration=0 ) { - $status = 'File '.$filename.' ('.$filesize.' bytes) '; + $status = sprintf(t('File %s (%d bytes) '), $filename, $filesize); if ($importCount == 0 && $overwriteCount == 0 && $skipCount == 0) { - $status .= 'has an unknown file format. Nothing was imported.'; + $status .= t('has an unknown file format. Nothing was imported.'); } else { - $status .= 'was successfully processed in '. $duration .' seconds: '; - $status .= $importCount.' links imported, '; - $status .= $overwriteCount.' links overwritten, '; - $status .= $skipCount.' links skipped.'; + $status .= vsprintf( + t('was successfully processed in %d seconds: %d links imported, %d links overwritten, %d links skipped.'), + [$duration, $importCount, $overwriteCount, $skipCount] + ); } return $status; } -- cgit v1.2.3 From f39580c6fd171b849cec5832b4912182696341f2 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Thu, 25 May 2017 13:26:05 +0200 Subject: Add language selection in the configure page of the default theme --- application/NetscapeBookmarkUtils.php | 1 - 1 file changed, 1 deletion(-) (limited to 'application/NetscapeBookmarkUtils.php') diff --git a/application/NetscapeBookmarkUtils.php b/application/NetscapeBookmarkUtils.php index 31a14537..dd7057f8 100644 --- a/application/NetscapeBookmarkUtils.php +++ b/application/NetscapeBookmarkUtils.php @@ -36,7 +36,6 @@ class NetscapeBookmarkUtils } $bookmarkLinks = array(); -7 foreach ($linkDb as $link) { if ($link['private'] != 0 && $selection == 'public') { continue; -- cgit v1.2.3