From 5378cf37d8d3dde29a2e7a67e94f3966696288e6 Mon Sep 17 00:00:00 2001 From: Pascal Chevrel Date: Mon, 12 Mar 2012 15:40:15 +0100 Subject: l10n support for moonmoon --- admin/administration.php | 14 +-- admin/index.php | 30 +++---- admin/template.php | 10 +-- app/app.php | 25 +++++- app/classes/PlanetConfig.php | 1 + app/classes/Simplel10n.class.php | 40 +++++++++ app/l10n/fr.lang | 169 +++++++++++++++++++++++++++++++++++ custom/views/archive/footer.tpl.php | 4 +- custom/views/archive/index.tpl.php | 42 ++++----- custom/views/archive/sidebar.tpl.php | 20 ++--- custom/views/default/footer.tpl.php | 4 +- custom/views/default/index.tpl.php | 20 ++--- custom/views/default/sidebar.tpl.php | 20 ++--- index.php | 8 +- install.php | 82 +++++++---------- 15 files changed, 353 insertions(+), 136 deletions(-) mode change 100644 => 100755 admin/administration.php mode change 100644 => 100755 app/app.php create mode 100644 app/classes/Simplel10n.class.php create mode 100644 app/l10n/fr.lang mode change 100644 => 100755 custom/views/archive/footer.tpl.php mode change 100644 => 100755 custom/views/archive/index.tpl.php mode change 100644 => 100755 custom/views/archive/sidebar.tpl.php mode change 100644 => 100755 custom/views/default/footer.tpl.php mode change 100644 => 100755 custom/views/default/index.tpl.php mode change 100644 => 100755 custom/views/default/sidebar.tpl.php mode change 100644 => 100755 index.php diff --git a/admin/administration.php b/admin/administration.php old mode 100644 new mode 100755 index 894ebd3..1202e91 --- a/admin/administration.php +++ b/admin/administration.php @@ -1,7 +1,7 @@ getPeople(); @@ -11,7 +11,7 @@ $header_extra = <<<"HTML" window.onload = function(){ var formManage = document.getElementById('frmPurge'); formManage.onsubmit = function(){ - return confirm('Are you sure you want to purge the cache?'); + return confirm("{$l10n->getString('Are you sure you want to purge the cache?')}"); } } @@ -21,17 +21,17 @@ HTML; $page_content = <<<"FRAGMENT"
-

Clear cache

+

{$l10n->getString('Clear cache')}

-

-

Clearing the cache will make moonmoon reload all feeds.

+

+

{$l10n->getString('Clearing the cache will make moonmoon reload all feeds.')}

-

Change administrator password

+

{$l10n->getString('Change administrator password')}

-

+

diff --git a/admin/index.php b/admin/index.php index 77ba04d..28f7198 100755 --- a/admin/index.php +++ b/admin/index.php @@ -71,34 +71,34 @@ ob_start(); ?>
-

Add a new feed

+

- + - +
-

Accepted formats are RSS and ATOM. If the link is not a feed, moonmoon will try to autodiscover the feed.

+

-

Manage existing feeds

+

- Number of feeds: - - + + +

-

Select : All, None

+

,

- - - - - + + + + + @@ -116,7 +116,7 @@ ob_start(); if (count($items) > 0) { echo $items[0]->get_date(); } else { - echo "Not in cache"; + echo _g('Not in cache'); } ?> diff --git a/admin/template.php b/admin/template.php index 6a3c2ea..d5641f9 100755 --- a/admin/template.php +++ b/admin/template.php @@ -3,7 +3,7 @@ - moonmoon administration + <?=_g('moonmoon administration')?>"; \ No newline at end of file +echo "-->"; diff --git a/install.php b/install.php index 482a8d0..3a3eae7 100755 --- a/install.php +++ b/install.php @@ -1,5 +1,7 @@ filter_var($_REQUEST['url'], FILTER_SANITIZE_ENCODED), 'name' => filter_var($_REQUEST['title'], FILTER_SANITIZE_SPECIAL_CHARS), + 'locale' => filter_var($_REQUEST['locale'], FILTER_SANITIZE_SPECIAL_CHARS), 'items' => 10, 'shuffle' => 0, 'refresh' => 240, @@ -37,53 +39,30 @@ if (file_exists(dirname(__FILE__) . '/custom/config.yml') } } else { - // Server requirements with advices in case there is something wrong - $tests = array( - 'php5' => array( - 'file' => false, - 'label' => 'Server is running PHP5', - 'solution' => 'Check your server documentation to activate PHP5.', - ), - 'custom' => array( - 'file' => '/custom', - 'label' => './custom is writable', - 'solution' => 'Change the access rights for ./custom with CHMOD' - ), - 'opml' => array( - 'file' => '/custom/people.opml', - 'label' => './custom/people.opml is writable', - 'solution' => 'Change the access rights for ./custom/people.opml with CHMOD' - ), - 'changepassword' => array( - 'file' => '/admin/inc/pwd.inc.php', - 'label' => 'Administrator password can be changed', - 'solution' => 'Change the access right for ./admin/inc/pwd.inc.php with CHMOD' - ), - 'cache' => array( - 'file' => '/cache', - 'label' => './cache is writable', - 'solution' => 'Make ./cache writable with CHMOD' - ), - ); - // We start by malking sure we have PHP5 as a base requirement if(phpversion() >= 5) { - $strInstall = installStatus($tests['php5']['label'], 'OK',true); + $strInstall = installStatus('Server is running PHP5', 'OK',true); $strRecommendation = ''; } else { - $strInstall = installStatus($tests['php5']['label'], 'FAIL',false); - $strRecommendation = '
  • ' . $tests['php5']['solution'] . '
  • '; + $strInstall = installStatus('Server is running PHP5', 'FAIL',false); + $strRecommendation = '
  • Check your server documentation to activate PHP5
  • '; } + // Writable file requirements + $tests = array( + '/custom', + '/custom/people.opml', + '/admin/inc/pwd.inc.php', + '/cache', + ); + // We now test that all required files are writable - foreach ($tests as $k => $v) { - if ($tests[$k]['file']) { - if(is_writable(dirname(__FILE__) . $tests[$k]['file'])) { - $strInstall .= installStatus($tests[$k]['label'], 'OK', true); - } else { - $strInstall .= installStatus($tests[$k]['label'], 'FAIL',false); - $strRecommendation .= '
  • ' . $tests[$k]['solution'] . '
  • '; - } + foreach ($tests as $v) { + if(is_writable(dirname(__FILE__) . $v)) { + $strInstall .= installStatus("$v is writable", 'OK', true); + } else { + $strInstall .= installStatus("$v is writable", 'FAIL',false); + $strRecommendation .= "
  • Make $v writable with CHMOD
  • "; } } @@ -94,8 +73,9 @@ if (file_exists(dirname(__FILE__) . '/custom/config.yml') ?> + - moonmoon install + <?=_g('moonmoon installation')?>
    SelectionNameLast entryWebsite linkFeed link