aboutsummaryrefslogtreecommitdiff
path: root/app/views/helpers
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-05 15:55:20 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-05 15:55:20 +0200
commit6c8b36f04ea1bc2c022c331bb0980b6c9dccb83c (patch)
tree61a6b28b6041642faa32d04b4869afa774bda72d /app/views/helpers
parent5a9b08e084b376af9b65699f9868d66a46f8c170 (diff)
Let's begin the big refactoring!
Minz_Translate::t\s? replaces by _t See https://github.com/marienfressinaud/FreshRSS/issues/655
Diffstat (limited to 'app/views/helpers')
-rw-r--r--app/views/helpers/feed/update.phtml60
-rw-r--r--app/views/helpers/javascript_vars.phtml8
-rwxr-xr-xapp/views/helpers/logs_pagination.phtml8
-rw-r--r--app/views/helpers/view/normal_view.phtml14
-rw-r--r--app/views/helpers/view/reader_view.phtml2
-rwxr-xr-xapp/views/helpers/view/rss_view.phtml2
6 files changed, 47 insertions, 47 deletions
diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml
index 678c5f132..8bd645d11 100644
--- a/app/views/helpers/feed/update.phtml
+++ b/app/views/helpers/feed/update.phtml
@@ -12,27 +12,27 @@
<?php $nbEntries = $this->feed->nbEntries (); ?>
<?php if ($this->feed->inError ()) { ?>
- <p class="alert alert-error"><span class="alert-head"><?php echo Minz_Translate::t ('damn'); ?></span> <?php echo Minz_Translate::t ('feed_in_error'); ?></p>
+ <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('feed_in_error'); ?></p>
<?php } elseif ($nbEntries === 0) { ?>
- <p class="alert alert-warn"><?php echo Minz_Translate::t ('feed_empty'); ?></p>
+ <p class="alert alert-warn"><?php echo _t('feed_empty'); ?></p>
<?php } ?>
<form method="post" action="<?php echo _url ('subscription', 'feed', 'id', $this->feed->id ()); ?>" autocomplete="off">
- <legend><?php echo Minz_Translate::t ('informations'); ?></legend>
+ <legend><?php echo _t('informations'); ?></legend>
<div class="form-group">
- <label class="group-name" for="name"><?php echo Minz_Translate::t ('title'); ?></label>
+ <label class="group-name" for="name"><?php echo _t('title'); ?></label>
<div class="group-controls">
<input type="text" name="name" id="name" class="extend" value="<?php echo $this->feed->name () ; ?>" />
</div>
</div>
<div class="form-group">
- <label class="group-name" for="description"><?php echo Minz_Translate::t ('feed_description'); ?></label>
+ <label class="group-name" for="description"><?php echo _t('feed_description'); ?></label>
<div class="group-controls">
<textarea name="description" id="description"><?php echo htmlspecialchars($this->feed->description(), ENT_NOQUOTES, 'UTF-8'); ?></textarea>
</div>
</div>
<div class="form-group">
- <label class="group-name" for="website"><?php echo Minz_Translate::t ('website_url'); ?></label>
+ <label class="group-name" for="website"><?php echo _t('website_url'); ?></label>
<div class="group-controls">
<div class="stick">
<input type="text" name="website" id="website" class="extend" value="<?php echo $this->feed->website (); ?>" />
@@ -41,18 +41,18 @@
</div>
</div>
<div class="form-group">
- <label class="group-name" for="url"><?php echo Minz_Translate::t ('feed_url'); ?></label>
+ <label class="group-name" for="url"><?php echo _t('feed_url'); ?></label>
<div class="group-controls">
<div class="stick">
<input type="text" name="url" id="url" class="extend" value="<?php echo $this->feed->url (); ?>" />
<a class="btn" target="_blank" href="<?php echo $this->feed->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
</div>
- <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->feed->url (); ?>"><?php echo Minz_Translate::t ('feed_validator'); ?></a>
+ <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->feed->url (); ?>"><?php echo _t('feed_validator'); ?></a>
</div>
</div>
<div class="form-group">
- <label class="group-name" for="category"><?php echo Minz_Translate::t ('category'); ?></label>
+ <label class="group-name" for="category"><?php echo _t('category'); ?></label>
<div class="group-controls">
<select name="category" id="category">
<?php foreach ($this->categories as $cat) { ?>
@@ -64,11 +64,11 @@
</div>
</div>
<div class="form-group">
- <label class="group-name" for="priority"><?php echo Minz_Translate::t ('show_in_all_flux'); ?></label>
+ <label class="group-name" for="priority"><?php echo _t('show_in_all_flux'); ?></label>
<div class="group-controls">
<label class="checkbox" for="priority">
<input type="checkbox" name="priority" id="priority" value="10"<?php echo $this->feed->priority () > 0 ? ' checked="checked"' : ''; ?> />
- <?php echo Minz_Translate::t ('yes'); ?>
+ <?php echo _t('yes'); ?>
</label>
</div>
</div>
@@ -83,7 +83,7 @@
</div>
</div>
- <legend><?php echo Minz_Translate::t ('archiving_configuration'); ?></legend>
+ <legend><?php echo _t('archiving_configuration'); ?></legend>
<div class="form-group">
<div class="group-controls">
@@ -96,21 +96,21 @@
</div>
</div>
<div class="form-group">
- <label class="group-name" for="keep_history"><?php echo Minz_Translate::t ('keep_history'); ?></label>
+ <label class="group-name" for="keep_history"><?php echo _t('keep_history'); ?></label>
<div class="group-controls">
<select class="number" name="keep_history" id="keep_history" required="required"><?php
- foreach (array('' => '', -2 => Minz_Translate::t('by_default'), 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) {
+ foreach (array('' => '', -2 => _t('by_default'), 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) {
echo '<option value="' . $v . ($this->feed->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>';
}
?></select>
</div>
</div>
<div class="form-group">
- <label class="group-name" for="ttl"><?php echo Minz_Translate::t('ttl'); ?></label>
+ <label class="group-name" for="ttl"><?php echo _t('ttl'); ?></label>
<div class="group-controls">
<select class="number" name="ttl" id="ttl" required="required"><?php
$found = false;
- foreach (array(-2 => Minz_Translate::t('by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min',
+ foreach (array(-2 => _t('by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min',
3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h',
36000 => '10h', 43200 => '12h', 64800 => '18h',
86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d',
@@ -128,21 +128,21 @@
</div>
<div class="form-group form-actions">
<div class="group-controls">
- <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
- <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'truncate', 'params' => array ('id' => $this->feed->id ()))); ?>"><?php echo Minz_Translate::t ('truncate'); ?></button>
+ <button class="btn btn-important"><?php echo _t('save'); ?></button>
+ <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'truncate', 'params' => array ('id' => $this->feed->id ()))); ?>"><?php echo _t('truncate'); ?></button>
</div>
</div>
- <legend><?php echo Minz_Translate::t ('login_configuration'); ?></legend>
+ <legend><?php echo _t('login_configuration'); ?></legend>
<?php $auth = $this->feed->httpAuth (false); ?>
<div class="form-group">
- <label class="group-name" for="http_user"><?php echo Minz_Translate::t ('http_username'); ?></label>
+ <label class="group-name" for="http_user"><?php echo _t('http_username'); ?></label>
<div class="group-controls">
<input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" />
- <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('access_protected_feeds'); ?>
+ <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo _t('access_protected_feeds'); ?>
</div>
- <label class="group-name" for="http_pass"><?php echo Minz_Translate::t ('http_password'); ?></label>
+ <label class="group-name" for="http_pass"><?php echo _t('http_password'); ?></label>
<div class="group-controls">
<input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" />
</div>
@@ -150,24 +150,24 @@
<div class="form-group form-actions">
<div class="group-controls">
- <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
- <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>
+ <button type="submit" class="btn btn-important"><?php echo _t('save'); ?></button>
+ <button type="reset" class="btn"><?php echo _t('cancel'); ?></button>
</div>
</div>
- <legend><?php echo Minz_Translate::t ('advanced'); ?></legend>
+ <legend><?php echo _t('advanced'); ?></legend>
<div class="form-group">
- <label class="group-name" for="path_entries"><?php echo Minz_Translate::t ('css_path_on_website'); ?></label>
+ <label class="group-name" for="path_entries"><?php echo _t('css_path_on_website'); ?></label>
<div class="group-controls">
- <input type="text" name="path_entries" id="path_entries" class="extend" value="<?php echo $this->feed->pathEntries (); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" />
- <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('retrieve_truncated_feeds'); ?>
+ <input type="text" name="path_entries" id="path_entries" class="extend" value="<?php echo $this->feed->pathEntries (); ?>" placeholder="<?php echo _t('blank_to_disable'); ?>" />
+ <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo _t('retrieve_truncated_feeds'); ?>
</div>
</div>
<div class="form-group form-actions">
<div class="group-controls">
- <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
- <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>
+ <button type="submit" class="btn btn-important"><?php echo _t('save'); ?></button>
+ <button type="reset" class="btn"><?php echo _t('cancel'); ?></button>
</div>
</div>
</form>
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml
index 4f7e3db0c..ba02b9fad 100644
--- a/app/views/helpers/javascript_vars.phtml
+++ b/app/views/helpers/javascript_vars.phtml
@@ -52,10 +52,10 @@ echo 'authType="', $authType, '",',
'url_login="', _url ('index', 'login'), '",',
'url_logout="', _url ('index', 'logout'), '",';
-echo 'str_confirmation_default="', Minz_Translate::t('confirm_action'), '"', ",\n";
-echo 'str_notif_title_articles="', Minz_Translate::t('notif_title_new_articles'), '"', ",\n";
-echo 'str_notif_body_articles="', Minz_Translate::t('notif_body_new_articles'), '"', ",\n";
-echo 'str_category_empty="', Minz_Translate::t('category_empty'), '"', ",\n";
+echo 'str_confirmation_default="', _t('confirm_action'), '"', ",\n";
+echo 'str_notif_title_articles="', _t('notif_title_new_articles'), '"', ",\n";
+echo 'str_notif_body_articles="', _t('notif_body_new_articles'), '"', ",\n";
+echo 'str_category_empty="', _t('category_empty'), '"', ",\n";
echo 'html5_notif_timeout=', $this->conf->html5_notif_timeout,",\n";
diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml
index e3d14810e..191cfa8de 100755
--- a/app/views/helpers/logs_pagination.phtml
+++ b/app/views/helpers/logs_pagination.phtml
@@ -9,14 +9,14 @@
<?php $params[$getteur] = 1; ?>
<li class="item pager-first">
<?php if ($this->currentPage > 1) { ?>
- <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« <?php echo Minz_Translate::t('first'); ?></a>
+ <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« <?php echo _t('first'); ?></a>
<?php } ?>
</li>
<?php $params[$getteur] = $this->currentPage - 1; ?>
<li class="item pager-previous">
<?php if ($this->currentPage > 1) { ?>
- <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ <?php echo Minz_Translate::t('previous'); ?></a>
+ <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ <?php echo _t('previous'); ?></a>
<?php } ?>
</li>
@@ -34,13 +34,13 @@
<?php $params[$getteur] = $this->currentPage + 1; ?>
<li class="item pager-next">
<?php if ($this->currentPage < $this->nbPage) { ?>
- <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t('next'); ?> ›</a>
+ <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo _t('next'); ?> ›</a>
<?php } ?>
</li>
<?php $params[$getteur] = $this->nbPage; ?>
<li class="item pager-last">
<?php if ($this->currentPage < $this->nbPage) { ?>
- <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t('last'); ?> »</a>
+ <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo _t('last'); ?> »</a>
<?php } ?>
</li>
</ul>
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml
index e469edf58..ee745144f 100644
--- a/app/views/helpers/view/normal_view.phtml
+++ b/app/views/helpers/view/normal_view.phtml
@@ -30,12 +30,12 @@ if (!empty($this->entries)) {
<div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php
?><div id="new-article">
- <a href="<?php echo Minz_Url::display ($this->url); ?>"><?php echo Minz_Translate::t ('new_article'); ?></a>
+ <a href="<?php echo Minz_Url::display ($this->url); ?>"><?php echo _t('new_article'); ?></a>
</div><?php
foreach ($this->entries as $item) {
if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) {
?><div class="day" id="day_today"><?php
- echo Minz_Translate::t ('today');
+ echo _t('today');
?><span class="date"> — <?php echo timestamptodate (time (), false); ?></span><?php
?><span class="name"><?php echo $this->currentName; ?></span><?php
?></div><?php
@@ -43,7 +43,7 @@ if (!empty($this->entries)) {
}
if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $this->today)) {
?><div class="day" id="day_yesterday"><?php
- echo Minz_Translate::t ('yesterday');
+ echo _t('yesterday');
?><span class="date"> — <?php echo timestamptodate (time () - 86400, false); ?></span><?php
?><span class="name"><?php echo $this->currentName; ?></span><?php
?></div><?php
@@ -51,7 +51,7 @@ if (!empty($this->entries)) {
}
if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) {
?><div class="day" id="day_before_yesterday"><?php
- echo Minz_Translate::t ('before_yesterday');
+ echo _t('before_yesterday');
?><span class="name"><?php echo $this->currentName; ?></span><?php
?></div><?php
$display_others = false;
@@ -98,7 +98,7 @@ if (!empty($this->entries)) {
<h1 class="title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></h1>
<?php
$author = $item->author();
- echo $author != '' ? '<div class="author">' . Minz_Translate::t('by_author', $author) . '</div>' : '',
+ echo $author != '' ? '<div class="author">' . _t('by_author', $author) . '</div>' : '',
$lazyload && $hidePosts ? lazyimg($item->content()) : $item->content();
?>
</div>
@@ -133,7 +133,7 @@ if (!empty($this->entries)) {
<div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div>
<a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>">
<?php echo FreshRSS_Themes::icon('share'); ?>
- <?php echo Minz_Translate::t ('share'); ?>
+ <?php echo _t('share'); ?>
</a>
<ul class="dropdown-menu">
@@ -141,7 +141,7 @@ if (!empty($this->entries)) {
<?php foreach ($sharing as $share) :?>
<li class="item share">
<a target="_blank" href="<?php echo FreshRSS_Share::generateUrl($this->conf->shares, $share, $item->link(), $item->title() . ' . ' . $feed->name())?>">
- <?php echo Minz_Translate::t ($share['name']);?>
+ <?php echo _t($share['name']);?>
</a>
</li>
<?php endforeach;?>
diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml
index 413094239..368bf7fdc 100644
--- a/app/views/helpers/view/reader_view.phtml
+++ b/app/views/helpers/view/reader_view.phtml
@@ -23,7 +23,7 @@ if (!empty($this->entries)) {
<div class="author"><?php
$author = $item->author();
- echo $author != '' ? Minz_Translate::t('by_author', $author) . ' — ' : '',
+ echo $author != '' ? _t('by_author', $author) . ' — ' : '',
$item->date();
?></div>
diff --git a/app/views/helpers/view/rss_view.phtml b/app/views/helpers/view/rss_view.phtml
index 2c6ca610b..fd8a8af63 100755
--- a/app/views/helpers/view/rss_view.phtml
+++ b/app/views/helpers/view/rss_view.phtml
@@ -3,7 +3,7 @@
<channel>
<title><?php echo $this->rss_title; ?></title>
<link><?php echo Minz_Url::display(null, 'html', true); ?></link>
- <description><?php echo Minz_Translate::t ('rss_feeds_of', $this->rss_title); ?></description>
+ <description><?php echo _t('rss_feeds_of', $this->rss_title); ?></description>
<pubDate><?php echo date('D, d M Y H:i:s O'); ?></pubDate>
<lastBuildDate><?php echo gmdate('D, d M Y H:i:s'); ?> GMT</lastBuildDate>
<atom:link href="<?php echo Minz_Url::display ($this->url, 'html', true); ?>" rel="self" type="application/rss+xml" />