diff --git a/doc/smarty3-templates.md b/doc/smarty3-templates.md
index 5c096d2c2..d44f26325 100644
--- a/doc/smarty3-templates.md
+++ b/doc/smarty3-templates.md
@@ -39,7 +39,7 @@ They are initialized with an array of data, depending on the tyle of the field.
All of these take an array holding the values, e.g. for a one line text input field, which is required and should be used to type email addesses use something along the lines of:
- '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.'), 'required', '', 'email'),
+ '$adminmail' => array('adminmail', L10n::t('Site administrator email address'), $adminmail, L10n::t('Your account email address must match this in order to use the web admin panel.'), 'required', '', 'email'),
To evaluate the input value, you can then use the $_POST array, more precisely the $_POST['adminemail'] variable.
diff --git a/doc/themes.md b/doc/themes.md
index 531ff9c16..7407a0ca1 100644
--- a/doc/themes.md
+++ b/doc/themes.md
@@ -109,17 +109,17 @@ The _post functions handle the processing of the send form, in this case they sa
To make your own variation appear in the menu, all you need to do is to create a new CSS file in the deriv directoy and include it in the array in the config.php:
$colorset = array(
- 'default'=>t('default'),
- 'greenzero'=>t('greenzero'),
- 'purplezero'=>t('purplezero'),
- 'easterbunny'=>t('easterbunny'),
- 'darkzero'=>t('darkzero'),
- 'comix'=>t('comix'),
- 'slackr'=>t('slackr'),
+ 'default'=>L10n::t('default'),
+ 'greenzero'=>L10n::t('greenzero'),
+ 'purplezero'=>L10n::t('purplezero'),
+ 'easterbunny'=>L10n::t('easterbunny'),
+ 'darkzero'=>L10n::t('darkzero'),
+ 'comix'=>L10n::t('comix'),
+ 'slackr'=>L10n::t('slackr'),
);
the 1st part of the line is the name of the CSS file (without the .css) the 2nd part is the common name of the variant.
-Calling the t() function with the common name makes the string translateable.
+Calling the L10n::t() function with the common name makes the string translateable.
The selected 1st part will be saved in the database by the theme_post function.
function theme_post(App $a){
diff --git a/include/acl_selectors.php b/include/acl_selectors.php
index caa3e98c2..31d074276 100644
--- a/include/acl_selectors.php
+++ b/include/acl_selectors.php
@@ -7,6 +7,7 @@ use Friendica\Content\Feature;
use Friendica\Content\Widget;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
@@ -351,31 +352,31 @@ function populate_acl($user = null, $show_jotnets = false) {
if (!$user['hidewall']) {
if ($mail_enabled) {
$selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
- $jotnets .= '
' . t("Post to Email") . '
';
+ $jotnets .= '
' . L10n::t("Post to Email") . '
';
}
Addon::callHooks('jot_networks', $jotnets);
} else {
- $jotnets .= sprintf(t('Connectors disabled, since "%s" is enabled.'),
- t('Hide your profile details from unknown viewers?'));
+ $jotnets .= sprintf(L10n::t('Connectors disabled, since "%s" is enabled.'),
+ L10n::t('Hide your profile details from unknown viewers?'));
}
}
$tpl = get_markup_template("acl_selector.tpl");
$o = replace_macros($tpl, [
- '$showall'=> t("Visible to everybody"),
- '$show' => t("show"),
- '$hide' => t("don't show"),
+ '$showall'=> L10n::t("Visible to everybody"),
+ '$show' => L10n::t("show"),
+ '$hide' => L10n::t("don't show"),
'$allowcid' => json_encode($perms['allow_cid']),
'$allowgid' => json_encode($perms['allow_gid']),
'$denycid' => json_encode($perms['deny_cid']),
'$denygid' => json_encode($perms['deny_gid']),
'$networks' => $show_jotnets,
- '$emailcc' => t('CC: email addresses'),
- '$emtitle' => t('Example: bob@example.com, mary@example.com'),
+ '$emailcc' => L10n::t('CC: email addresses'),
+ '$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'),
'$jotnets' => $jotnets,
- '$aclModalTitle' => t('Permissions'),
- '$aclModalDismiss' => t('Close'),
+ '$aclModalTitle' => L10n::t('Permissions'),
+ '$aclModalDismiss' => L10n::t('Close'),
'$features' => [
'aclautomention' => (Feature::isEnabled($user['uid'], "aclautomention") ? "true" : "false")
],
diff --git a/include/api.php b/include/api.php
index 15ec2db12..aeab06cf1 100644
--- a/include/api.php
+++ b/include/api.php
@@ -12,6 +12,7 @@ use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\NotificationsManager;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@@ -1176,8 +1177,8 @@ function api_statuses_update($type)
if ($posts_day > $throttle_day) {
logger('Daily posting limit reached for user '.api_user(), LOGGER_DEBUG);
- // die(api_error($type, sprintf(t("Daily posting limit of %d posts reached. The post was rejected."), $throttle_day)));
- throw new TooManyRequestsException(sprintf(t("Daily posting limit of %d posts reached. The post was rejected."), $throttle_day));
+ // die(api_error($type, sprintf(L10n::t("Daily posting limit of %d posts reached. The post was rejected."), $throttle_day)));
+ throw new TooManyRequestsException(sprintf(L10n::t("Daily posting limit of %d posts reached. The post was rejected."), $throttle_day));
}
}
@@ -1200,8 +1201,8 @@ function api_statuses_update($type)
if ($posts_week > $throttle_week) {
logger('Weekly posting limit reached for user '.api_user(), LOGGER_DEBUG);
- // die(api_error($type, sprintf(t("Weekly posting limit of %d posts reached. The post was rejected."), $throttle_week)));
- throw new TooManyRequestsException(sprintf(t("Weekly posting limit of %d posts reached. The post was rejected."), $throttle_week));
+ // die(api_error($type, sprintf(L10n::t("Weekly posting limit of %d posts reached. The post was rejected."), $throttle_week)));
+ throw new TooManyRequestsException(sprintf(L10n::t("Weekly posting limit of %d posts reached. The post was rejected."), $throttle_week));
}
}
@@ -1224,8 +1225,8 @@ function api_statuses_update($type)
if ($posts_month > $throttle_month) {
logger('Monthly posting limit reached for user '.api_user(), LOGGER_DEBUG);
- // die(api_error($type, sprintf(t("Monthly posting limit of %d posts reached. The post was rejected."), $throttle_month)));
- throw new TooManyRequestsException(sprintf(t("Monthly posting limit of %d posts reached. The post was rejected."), $throttle_month));
+ // die(api_error($type, sprintf(L10n::t("Monthly posting limit of %d posts reached. The post was rejected."), $throttle_month)));
+ throw new TooManyRequestsException(sprintf(L10n::t("Monthly posting limit of %d posts reached. The post was rejected."), $throttle_month));
}
}
@@ -4374,7 +4375,7 @@ function api_account_update_profile_image($type)
$media = $_FILES['media'];
}
// save new profile image
- $data = save_media_to_database("profileimage", $media, $type, t('Profile Photos'), "", "", "", "", "", $is_default_profile);
+ $data = save_media_to_database("profileimage", $media, $type, L10n::t('Profile Photos'), "", "", "", "", "", $is_default_profile);
// get filetype
if (is_array($media['type'])) {
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 4856d18ab..2673750ee 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -234,13 +234,13 @@ function format_event_diaspora($ev) {
return '';
}
- $bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
+ $bd_format = L10n::t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
$o = 'Friendica event notification:' . "\n";
$o .= '**' . (($ev['summary']) ? bb2diaspora($ev['summary']) : bb2diaspora($ev['desc'])) . '**' . "\n";
- $o .= t('Starts:') . ' ' . '['
+ $o .= L10n::t('Starts:') . ' ' . '['
. (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC',
$ev['start'] , $bd_format ))
: day_translate(datetime_convert('UTC', 'UTC',
@@ -248,7 +248,7 @@ function format_event_diaspora($ev) {
. '](' . System::baseUrl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['start'])) . ")\n";
if (! $ev['nofinish']) {
- $o .= t('Finishes:') . ' ' . '['
+ $o .= L10n::t('Finishes:') . ' ' . '['
. (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC',
$ev['finish'] , $bd_format ))
: day_translate(datetime_convert('UTC', 'UTC',
@@ -257,7 +257,7 @@ function format_event_diaspora($ev) {
}
if (strlen($ev['location'])) {
- $o .= t('Location:') . bb2diaspora($ev['location'])
+ $o .= L10n::t('Location:') . bb2diaspora($ev['location'])
. "\n";
}
diff --git a/include/bbcode.php b/include/bbcode.php
index 3a187c281..7fa6d05f8 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -411,7 +411,7 @@ function bb_replace_images($body, $images) {
// We're depending on the property of 'foreach' (specified on the PHP website) that
// it loops over the array starting from the first element and going sequentially
// to the last element
- $newbody = str_replace('[$#saved_image' . $cnt . '#$]', '', $newbody);
+ $newbody = str_replace('[$#saved_image' . $cnt . '#$]', '', $newbody);
$cnt++;
}
@@ -549,7 +549,7 @@ function bb_ShareAttributes($share, $simplehtml)
break;
case 4:
$headline .= ' ' . html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8');
- $headline .= t('%2$s %3$s', $link, $userid, $posted);
+ $headline .= L10n::t('%2$s %3$s', $link, $userid, $posted);
$headline .= ": ";
$text = trim($share[1]);
@@ -1180,7 +1180,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
// Check for [spoiler=Author] text
- $t_wrote = t('$1 wrote:');
+ $t_wrote = L10n::t('$1 wrote:');
// handle nested quotes
$endlessloop = 0;
@@ -1202,7 +1202,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
// Check for [quote=Author] text
- $t_wrote = t('$1 wrote:');
+ $t_wrote = L10n::t('$1 wrote:');
// handle nested quotes
$endlessloop = 0;
@@ -1223,8 +1223,8 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
// [img]pathtoimage[/img]
$Text = preg_replace_callback("/\[img\](.*?)\[\/img\]/ism", 'bb_PictureCache', $Text);
- $Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '', $Text);
- $Text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '', $Text);
+ $Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '', $Text);
+ $Text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '', $Text);
// Shared content
$Text = preg_replace_callback("/(.*?)\[share(.*?)\](.*?)\[\/share\]/ism",
@@ -1232,9 +1232,9 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
return bb_ShareAttributes($match, $simplehtml);
}, $Text);
- $Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism", '