aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/include/check_integrity.class.php8
-rw-r--r--themes/default/template/mail/text/html/footer.tpl4
-rw-r--r--themes/default/template/mail/text/html/notification_by_mail.tpl24
-rw-r--r--themes/default/template/mail/text/plain/footer.tpl2
-rw-r--r--themes/default/template/mail/text/plain/notification_by_mail.tpl24
-rwxr-xr-xtools/replace.php53
6 files changed, 84 insertions, 31 deletions
diff --git a/admin/include/check_integrity.class.php b/admin/include/check_integrity.class.php
index a4ea52d7c..70c8d73ac 100644
--- a/admin/include/check_integrity.class.php
+++ b/admin/include/check_integrity.class.php
@@ -72,7 +72,7 @@ class check_integrity
if (count($this->retrieve_list) > 0)
{
$header_notes[] =
- l10n_dec('c13y_anomaly_count', 'c13y_anomalies_count',
+ l10n_dec('%d anomaly has been detected.', '%d anomalies have been detected.',
count($this->retrieve_list));
}
@@ -119,13 +119,13 @@ class check_integrity
if ($corrected_count > 0)
{
$page['infos'][] =
- l10n_dec('c13y_anomaly_corrected_count', 'c13y_anomalies_corrected_count',
+ l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.',
$corrected_count);
}
if ($not_corrected_count > 0)
{
$page['errors'][] =
- l10n_dec('c13y_anomaly_not_corrected_count', 'c13y_anomalies_not_corrected_count',
+ l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.',
$not_corrected_count);
}
}
@@ -148,7 +148,7 @@ class check_integrity
if ($ignored_count > 0)
{
$page['infos'][] =
- l10n_dec('c13y_anomaly_ignored_count', 'c13y_anomalies_ignored_count',
+ l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.',
$ignored_count);
}
}
diff --git a/themes/default/template/mail/text/html/footer.tpl b/themes/default/template/mail/text/html/footer.tpl
index 92e69b089..b1f1b9317 100644
--- a/themes/default/template/mail/text/html/footer.tpl
+++ b/themes/default/template/mail/text/html/footer.tpl
@@ -7,12 +7,12 @@
{* Please, do not remove this copyright. If you really want to,
contact us on http://piwigo.org to find a solution on how
to show the origin of the script...*}
- - {'powered_by'|@translate}
+ - {'Powered by'|@translate}
<a href="http://piwigo.org" class="Piwigo">
<span class="Piwigo">Piwigo</span></a>
{$VERSION}
- - {'send_mail'|@translate}
+ - {'Contact'|@translate}
<a href="mailto:{$MAIL}?subject={$TITLE_MAIL}">{'Webmaster'|@translate}</a>
</div> <!-- copyright -->
diff --git a/themes/default/template/mail/text/html/notification_by_mail.tpl b/themes/default/template/mail/text/html/notification_by_mail.tpl
index 5a0115e2f..7a749fe8b 100644
--- a/themes/default/template/mail/text/html/notification_by_mail.tpl
+++ b/themes/default/template/mail/text/html/notification_by_mail.tpl
@@ -1,24 +1,24 @@
<div id="nbm_message">
<h2>{'Notification'|@translate}</h2>
-<p>{'nbm_content_hello_1'|@translate}{$USERNAME}{'nbm_content_hello_2'|@translate}</p>
+<p>{'Hello '|@translate}{$USERNAME},</p>
{if isset($subscribe_by_admin)}
-<p>{'nbm_content_subscribe_by_admin'|@translate}</p>
+<p>{'The webmaster has subscribed you to receiving notifications by mail.'|@translate}</p>
{/if}
{if isset($subscribe_by_himself)}
-<p>{'nbm_content_subscribe_by_himself'|@translate}</p>
+<p>{'You have subscribed to receiving notifications by mail.'|@translate}</p>
{/if}
{if isset($unsubscribe_by_admin)}
-<p>{'nbm_content_unsubscribe_by_admin'|@translate}</p>
+<p>{'The webmaster has unsubscribed you from receiving notifications by mail.'|@translate}</p>
{/if}
{if isset($unsubscribe_by_himself)}
-<p>{'nbm_content_unsubscribe_by_himself'|@translate}</p>
+<p>{'You have unsubscribed from receiving notifications by mail.'|@translate}</p>
{/if}
{if isset($content_new_elements_single)}
-<p>{'nbm_content_new_elements'|@translate}{'nbm_content_new_elements_single'|@translate}{$content_new_elements_single.DATE_SINGLE}.</p>
+<p>{'New elements were added '|@translate}{' on '|@translate}{$content_new_elements_single.DATE_SINGLE}.</p>
{/if}
{if isset($content_new_elements_between)}
-<p>{'nbm_content_new_elements'|@translate}{'nbm_content_new_elements_between_1'|@translate}{$content_new_elements_between.DATE_BETWEEN_1}{'nbm_content_new_elements_between_2'|@translate}{$content_new_elements_between.DATE_BETWEEN_2}.</p>
+<p>{'New elements were added '|@translate}{' between '|@translate}{$content_new_elements_between.DATE_BETWEEN_1}{' and '|@translate}{$content_new_elements_between.DATE_BETWEEN_2}.</p>
{/if}
{if not empty($global_new_lines)}
@@ -34,15 +34,15 @@
{/if}
{if not empty($GOTO_GALLERY_TITLE)}
-<p>{'nbm_content_goto_1'|@translate}<a href="{$GOTO_GALLERY_URL}">{$GOTO_GALLERY_TITLE}</a>{'nbm_content_goto_2'|@translate}</p>
+<p>{'Go to '|@translate}<a href="{$GOTO_GALLERY_URL}">{$GOTO_GALLERY_TITLE}</a>.</p>
{/if}
-<p>{'nbm_content_byebye'|@translate}</p>
+<p>{'See you soon,'|@translate}</p>
<p style="text-align:center">{$SEND_AS_NAME}</p>
<p>
<br><hr>
-{'nbm_content_unsubscribe_link'|@translate}{'nbm_content_click_on'|@translate}<a href="{$UNSUBSCRIBE_LINK}">{$UNSUBSCRIBE_LINK}</a><br>
-{'nbm_content_subscribe_link'|@translate}{'nbm_content_click_on'|@translate}<a href="{$SUBSCRIBE_LINK}">{$SUBSCRIBE_LINK}</a><br>
-{'nbm_content_problem_contact'|@translate}<a href="mailto:{$CONTACT_EMAIL}?subject={'nbm_content_pb_contact_object'|@translate}">{$CONTACT_EMAIL}</a><br>
+{'To unsubscribe'|@translate}{', click on '|@translate}<a href="{$UNSUBSCRIBE_LINK}">{$UNSUBSCRIBE_LINK}</a><br>
+{'To subscribe '|@translate}{', click on '|@translate}<a href="{$SUBSCRIBE_LINK}">{$SUBSCRIBE_LINK}</a><br>
+{'If you encounter problems or have any question, please send a message to '|@translate}<a href="mailto:{$CONTACT_EMAIL}?subject={'[NBM] Problems or questions'|@translate}">{$CONTACT_EMAIL}</a><br>
<hr><br>
</p>
{if not empty($recent_posts)}
diff --git a/themes/default/template/mail/text/plain/footer.tpl b/themes/default/template/mail/text/plain/footer.tpl
index c386f0962..9c6ea62fb 100644
--- a/themes/default/template/mail/text/plain/footer.tpl
+++ b/themes/default/template/mail/text/plain/footer.tpl
@@ -1,3 +1,3 @@
------------------------------------------------------------------------------
-{'Sent by'|@translate} {$GALLERY_URL} - {'powered_by'|@translate} Piwigo {$VERSION} - {'send_mail'|@translate} {$MAIL}
+{'Contact'|@translate} {$GALLERY_URL} - {'Contact'|@translate} Piwigo {$VERSION} - {'Contact'|@translate} {$MAIL}
diff --git a/themes/default/template/mail/text/plain/notification_by_mail.tpl b/themes/default/template/mail/text/plain/notification_by_mail.tpl
index b1928853f..be527da64 100644
--- a/themes/default/template/mail/text/plain/notification_by_mail.tpl
+++ b/themes/default/template/mail/text/plain/notification_by_mail.tpl
@@ -1,22 +1,22 @@
-{'nbm_content_hello_1'|@translate}{$USERNAME}{'nbm_content_hello_2'|@translate}
+{'Hello '|@translate}{$USERNAME},
{if isset($subscribe_by_admin)}
-{'nbm_content_subscribe_by_admin'|@translate}
+{'The webmaster has subscribed you to receiving notifications by mail.'|@translate}
{/if}
{if isset($subscribe_by_himself)}
-{'nbm_content_subscribe_by_himself'|@translate}
+{'You have subscribed to receiving notifications by mail.'|@translate}
{/if}
{if isset($unsubscribe_by_admin)}
-{'nbm_content_unsubscribe_by_admin'|@translate}
+{'The webmaster has unsubscribed you from receiving notifications by mail.'|@translate}
{/if}
{if isset($unsubscribe_by_himself)}
-{'nbm_content_unsubscribe_by_himself'|@translate}
+{'You have unsubscribed from receiving notifications by mail.'|@translate}
{/if}
{if isset($content_new_elements_single)}
-{'nbm_content_new_elements'|@translate}{'nbm_content_new_elements_single'|@translate}{$content_new_elements_single.DATE_SINGLE}.
+{'New elements were added '|@translate}{' on '|@translate}{$content_new_elements_single.DATE_SINGLE}.
{/if}
{if isset($content_new_elements_between)}
-{'nbm_content_new_elements'|@translate}{'nbm_content_new_elements_between_1'|@translate}{$content_new_elements_between.DATE_BETWEEN_1}{'nbm_content_new_elements_between_2'|@translate}{$content_new_elements_between.DATE_BETWEEN_2}.
+{'New elements were added '|@translate}{' between '|@translate}{$content_new_elements_between.DATE_BETWEEN_1}{' and '|@translate}{$content_new_elements_between.DATE_BETWEEN_2}.
{/if}
{if not empty($global_new_lines)}
{foreach from=$global_new_lines item=line}
@@ -27,15 +27,15 @@
{$custom_mail_content}
{/if}
{if not empty($GOTO_GALLERY_TITLE)}
-{'nbm_content_goto_1'|@translate}{$GOTO_GALLERY_TITLE} {$GOTO_GALLERY_URL} {'nbm_content_goto_2'|@translate}
+{'.'|@translate}{$GOTO_GALLERY_TITLE} {$GOTO_GALLERY_URL} {'.'|@translate}
{/if}
-{'nbm_content_byebye'|@translate}
+{'See you soon,'|@translate}
{$SEND_AS_NAME}
______________________________________________________________________________
-{'nbm_content_unsubscribe_link'|@translate}{'nbm_content_click_on'|@translate}{$UNSUBSCRIBE_LINK}
-{'nbm_content_subscribe_link'|@translate}{'nbm_content_click_on'|@translate}{$SUBSCRIBE_LINK}
-{'nbm_content_problem_contact'|@translate}{$CONTACT_EMAIL}
+{'To unsubscribe'|@translate}{', click on '|@translate}{$UNSUBSCRIBE_LINK}
+{'To subscribe'|@translate}{', click on '|@translate}{$SUBSCRIBE_LINK}
+{'If you encounter problems or have any question, please send a message to '|@translate}{$CONTACT_EMAIL}
______________________________________________________________________________
diff --git a/tools/replace.php b/tools/replace.php
new file mode 100755
index 000000000..21d38c0e4
--- /dev/null
+++ b/tools/replace.php
@@ -0,0 +1,53 @@
+#!/usr/bin/php -qn
+<?php
+if (isset($_SERVER['argc']) && $_SERVER['argc']<=1)
+{
+ echo "\n";
+ echo 'usage : ', basename($_SERVER['argv'][0]), " <filename>\n";
+ echo "\n";
+ exit(1);
+}
+
+$filename = trim($_SERVER['argv'][1]);
+$lines = file($filename);
+$content = file_get_contents($filename);
+
+$n = 0;
+$nbLines = count($lines);
+
+$pattern = "`(.*{')(.*)('\|@translate}.*)`Um";
+$replace = "'{\''.keyReplace('\\1').'\'|@translate}'";
+
+include "language/en_UK/common.lang.php";
+include "language/en_UK/admin.lang.php";
+include "language/en_UK/upgrade.lang.php";
+include "language/en_UK/install.lang.php";
+
+while ($n < $nbLines) {
+ preg_match_all($pattern, $lines[$n], $matches);
+ echo str_replace($matches[2], keyReplace($matches[2]), $lines[$n]);
+ $n++;
+}
+
+function keyReplace($key) {
+ global $lang;
+
+ if (is_array($key)) {
+ $translation = array();
+ foreach ($key as $i => $k) {
+ if (isset($lang[$k])) {
+ $translation = addslashes($lang[$k]);
+ } else {
+ $translation = "$k";
+ }
+ }
+ } else {
+ if (isset($lang[$key])) {
+ $translation = addslashes($lang[$key]);
+ } else {
+ $translation = "$key";
+ }
+ }
+ return $translation;
+}
+?> \ No newline at end of file