';
diff --git a/mod/register.php b/mod/register.php
index 2bd09aca9..a2f5ddc51 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -1,8 +1,11 @@
config['sitename'], System::baseUrl(), $user['username'], $result['password']);
if ($res) {
- info(t('Registration successful. Please check your email for further instructions.') . EOL);
+ info(L10n::t('Registration successful. Please check your email for further instructions.') . EOL);
goaway(System::baseUrl());
} else {
notice(
- t('Failed to send email message. Here your accout details:
login: %s
password: %s
You can change your password after login.',
+ L10n::t('Failed to send email message. Here your accout details:
login: %s
password: %s
You can change your password after login.',
$user['email'],
$result['password'])
. EOL
);
}
} else {
- info(t('Registration successful.') . EOL);
+ info(L10n::t('Registration successful.') . EOL);
goaway(System::baseUrl());
}
} elseif ($a->config['register_policy'] == REGISTER_APPROVE) {
if (!strlen($a->config['admin_email'])) {
- notice(t('Your registration can not be processed.') . EOL);
+ notice(L10n::t('Your registration can not be processed.') . EOL);
goaway(System::baseUrl());
}
@@ -153,7 +156,7 @@ function register_post(App $a)
User::sendRegisterPendingEmail(
$user['email'], $a->config['sitename'], $user['username']);
- info(t('Your registration is pending approval by the site owner.') . EOL);
+ info(L10n::t('Your registration is pending approval by the site owner.') . EOL);
goaway(System::baseUrl());
}
@@ -182,7 +185,7 @@ function register_content(App $a)
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
if ($r && $r[0]['total'] >= $max_dailies) {
logger('max daily registrations exceeded.');
- notice(t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
+ notice(L10n::t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
return;
}
}
@@ -211,13 +214,13 @@ function register_content(App $a)
$oidlabel = '';
} else {
$oidhtml = '
$oidlabel ';
- $fillwith = t("You may \x28optionally\x29 fill in this form via OpenID by supplying your OpenID and clicking 'Register'.");
- $fillext = t('If you are not familiar with OpenID, please leave that field blank and fill in the rest of the items.');
- $oidlabel = t("Your OpenID \x28optional\x29: ");
+ $fillwith = L10n::t("You may \x28optionally\x29 fill in this form via OpenID by supplying your OpenID and clicking 'Register'.");
+ $fillext = L10n::t('If you are not familiar with OpenID, please leave that field blank and fill in the rest of the items.');
+ $oidlabel = L10n::t("Your OpenID \x28optional\x29: ");
}
// I set this and got even more fake names than before...
- $realpeople = ''; // t('Members of this network prefer to communicate with real people who use their real names.');
+ $realpeople = ''; // L10n::t('Members of this network prefer to communicate with real people who use their real names.');
if (Config::get('system', 'publish_all')) {
$profile_publish = '
';
@@ -225,11 +228,11 @@ function register_content(App $a)
$publish_tpl = get_markup_template("profile_publish.tpl");
$profile_publish = replace_macros($publish_tpl, [
'$instance' => 'reg',
- '$pubdesc' => t('Include your profile in member directory?'),
+ '$pubdesc' => L10n::t('Include your profile in member directory?'),
'$yes_selected' => ' checked="checked" ',
'$no_selected' => '',
- '$str_yes' => t('Yes'),
- '$str_no' => t('No'),
+ '$str_yes' => L10n::t('Yes'),
+ '$str_no' => L10n::t('No'),
]);
}
@@ -250,34 +253,34 @@ function register_content(App $a)
'$oidhtml' => $oidhtml,
'$invitations' => Config::get('system', 'invitation_only'),
'$permonly' => $a->config['register_policy'] == REGISTER_APPROVE,
- '$permonlybox' => ['permonlybox', t('Note for the admin'), '', t('Leave a message for the admin, why you want to join this node')],
- '$invite_desc' => t('Membership on this site is by invitation only.'),
- '$invite_label' => t('Your invitation ID: '),
+ '$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node')],
+ '$invite_desc' => L10n::t('Membership on this site is by invitation only.'),
+ '$invite_label' => L10n::t('Your invitation ID: '),
'$invite_id' => $invite_id,
'$realpeople' => $realpeople,
- '$regtitle' => t('Registration'),
+ '$regtitle' => L10n::t('Registration'),
'$registertext' => x($a->config, 'register_text') ? bbcode($a->config['register_text']) : "",
'$fillwith' => $fillwith,
'$fillext' => $fillext,
'$oidlabel' => $oidlabel,
'$openid' => $openid_url,
- '$namelabel' => t('Your Full Name ' . "\x28" . 'e.g. Joe Smith, real or real-looking' . "\x29" . ': '),
- '$addrlabel' => t('Your Email Address: (Initial information will be send there, so this has to be an existing address.)'),
+ '$namelabel' => L10n::t('Your Full Name ' . "\x28" . 'e.g. Joe Smith, real or real-looking' . "\x29" . ': '),
+ '$addrlabel' => L10n::t('Your Email Address: (Initial information will be send there, so this has to be an existing address.)'),
'$passwords' => $passwords,
- '$password1' => ['password1', t('New Password:'), '', t('Leave empty for an auto generated password.')],
- '$password2' => ['confirm', t('Confirm:'), '', ''],
- '$nickdesc' => t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'
nickname@%s \'.', $a->get_hostname()),
- '$nicklabel' => t('Choose a nickname: '),
+ '$password1' => ['password1', L10n::t('New Password:'), '', L10n::t('Leave empty for an auto generated password.')],
+ '$password2' => ['confirm', L10n::t('Confirm:'), '', ''],
+ '$nickdesc' => L10n::t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'
nickname@%s \'.', $a->get_hostname()),
+ '$nicklabel' => L10n::t('Choose a nickname: '),
'$photo' => $photo,
'$publish' => $profile_publish,
- '$regbutt' => t('Register'),
+ '$regbutt' => L10n::t('Register'),
'$username' => $username,
'$email' => $email,
'$nickname' => $nickname,
'$license' => $license,
'$sitename' => $a->get_hostname(),
- '$importh' => t('Import'),
- '$importt' => t('Import your profile to this friendica instance'),
+ '$importh' => L10n::t('Import'),
+ '$importt' => L10n::t('Import your profile to this friendica instance'),
'$form_security_token' => get_form_security_token("register")
]);
return $o;
diff --git a/mod/regmod.php b/mod/regmod.php
index f5bba6dea..89e348d50 100644
--- a/mod/regmod.php
+++ b/mod/regmod.php
@@ -1,7 +1,10 @@
$register[0]['uid']]);
dba::delete('register', ['hash' => $register[0]['hash']]);
- notice(sprintf(t('Registration revoked for %s'), $user[0]['username']) . EOL);
+ notice(L10n::t('Registration revoked for %s', $user[0]['username']) . EOL);
return true;
}
@@ -96,13 +99,13 @@ function regmod_content(App $a)
global $lang;
if (!local_user()) {
- info(t('Please login.') . EOL);
+ info(L10n::t('Please login.') . EOL);
$o .= '
' . Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? 0 : 1);
return $o;
}
if ((!is_site_admin()) || (x($_SESSION, 'submanage') && intval($_SESSION['submanage']))) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return '';
}
diff --git a/mod/removeme.php b/mod/removeme.php
index 5912a6e31..ac13da2f1 100644
--- a/mod/removeme.php
+++ b/mod/removeme.php
@@ -1,6 +1,9 @@
System::baseUrl(),
'$hash' => $hash,
- '$title' => t('Remove My Account'),
- '$desc' => t('This will completely remove your account. Once this has been done it is not recoverable.'),
- '$passwd' => t('Please enter your password for verification:'),
- '$submit' => t('Remove My Account')
+ '$title' => L10n::t('Remove My Account'),
+ '$desc' => L10n::t('This will completely remove your account. Once this has been done it is not recoverable.'),
+ '$passwd' => L10n::t('Please enter your password for verification:'),
+ '$submit' => L10n::t('Remove My Account')
]);
return $o;
diff --git a/mod/repair_ostatus.php b/mod/repair_ostatus.php
index 5b207c286..b8f6fc523 100644
--- a/mod/repair_ostatus.php
+++ b/mod/repair_ostatus.php
@@ -3,18 +3,19 @@
* @file mod/repair_ostatus.php
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Model\Contact;
function repair_ostatus_content(App $a) {
if (! local_user()) {
- notice( t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}
- $o = "
".t("Resubscribing to OStatus contacts")." ";
+ $o = "
".L10n::t("Resubscribing to OStatus contacts")." ";
$uid = local_user();
@@ -30,7 +31,7 @@ function repair_ostatus_content(App $a) {
intval(CONTACT_IS_SHARING));
if (!$r)
- return($o.t("Error"));
+ return($o.L10n::t("Error"));
$total = $r[0]["total"];
@@ -44,15 +45,15 @@ function repair_ostatus_content(App $a) {
intval(CONTACT_IS_SHARING), $counter++);
if (!$r) {
- $o .= t("Done");
+ $o .= L10n::t("Done");
return $o;
}
$o .= "
".$counter."/".$total.": ".$r[0]["url"]."
";
- $o .= "
".t("Keep this window open until done.")."
";
+ $o .= "
".L10n::t("Keep this window open until done.")."
";
- $result = Contact::createFromProbe($uid,$r[0]["url"],true);
+ $result = Contact::createFromProbe($uid, $r[0]["url"], true);
$a->page['htmlhead'] = '
';
diff --git a/mod/search.php b/mod/search.php
index af9dd9956..b48fafe78 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -7,6 +7,7 @@ use Friendica\Content\Feature;
use Friendica\Content\Nav;
use Friendica\Core\Cache;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
require_once "include/bbcode.php";
@@ -32,7 +33,7 @@ function search_saved_searches() {
'id' => $rr['id'],
'term' => $rr['term'],
'encodedterm' => urlencode($rr['term']),
- 'delete' => t('Remove term'),
+ 'delete' => L10n::t('Remove term'),
'selected' => ($search==$rr['term']),
];
}
@@ -41,7 +42,7 @@ function search_saved_searches() {
$tpl = get_markup_template("saved_searches_aside.tpl");
$o .= replace_macros($tpl, [
- '$title' => t('Saved Searches'),
+ '$title' => L10n::t('Saved Searches'),
'$add' => '',
'$searchbox' => '',
'$saved' => $saved,
@@ -93,16 +94,16 @@ function search_post(App $a) {
function search_content(App $a) {
if (Config::get('system','block_public') && !local_user() && !remote_user()) {
- notice(t('Public access denied.') . EOL);
+ notice(L10n::t('Public access denied.') . EOL);
return;
}
if (Config::get('system','local_search') && !local_user() && !remote_user()) {
http_status_exit(403,
- ["title" => t("Public access denied."),
- "description" => t("Only logged in users are permitted to perform a search.")]);
+ ["title" => L10n::t("Public access denied."),
+ "description" => L10n::t("Only logged in users are permitted to perform a search.")]);
killme();
- //notice(t('Public access denied.').EOL);
+ //notice(L10n::t('Public access denied.').EOL);
//return;
}
@@ -124,8 +125,8 @@ function search_content(App $a) {
$resultdata = json_decode($result);
if (($resultdata->time > (time() - $crawl_permit_period)) && ($resultdata->accesses > $free_crawls)) {
http_status_exit(429,
- ["title" => t("Too Many Requests"),
- "description" => t("Only one search per minute is permitted for not logged in users.")]);
+ ["title" => L10n::t("Too Many Requests"),
+ "description" => L10n::t("Only one search per minute is permitted for not logged in users.")]);
killme();
}
Cache::set("remote_search:".$remote, json_encode(["time" => time(), "accesses" => $resultdata->accesses + 1]), CACHE_HOUR);
@@ -150,7 +151,7 @@ function search_content(App $a) {
// contruct a wrapper for the search header
$o .= replace_macros(get_markup_template("content_wrapper.tpl"),[
'name' => "search-header",
- '$title' => t("Search"),
+ '$title' => L10n::t("Search"),
'$title_size' => 3,
'$content' => search($search,'search-box','search',((local_user()) ? true : false), false)
]);
@@ -220,15 +221,16 @@ function search_content(App $a) {
}
if (! DBM::is_result($r)) {
- info( t('No results.') . EOL);
+ info(L10n::t('No results.') . EOL);
return $o;
}
- if ($tag)
- $title = sprintf( t('Items tagged with: %s'), $search);
- else
- $title = sprintf( t('Results for: %s'), $search);
+ if ($tag) {
+ $title = L10n::t('Items tagged with: %s', $search);
+ } else {
+ $title = L10n::t('Results for: %s', $search);
+ }
$o .= replace_macros(get_markup_template("section_title.tpl"),[
'$title' => $title
diff --git a/mod/settings.php b/mod/settings.php
index 5193c4a04..2d8d3a605 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -8,6 +8,7 @@ use Friendica\Content\Feature;
use Friendica\Content\Nav;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Core\Worker;
@@ -34,20 +35,20 @@ function get_theme_config_file($theme)
function settings_init(App $a)
{
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
// These lines provide the javascript needed by the acl selector
$tpl = get_markup_template('settings/head.tpl');
- $a->page['htmlhead'] .= replace_macros($tpl,[
- '$ispublic' => t('everybody')
+ $a->page['htmlhead'] .= replace_macros($tpl, [
+ '$ispublic' => L10n::t('everybody')
]);
$tabs = [
[
- 'label' => t('Account'),
+ 'label' => L10n::t('Account'),
'url' => 'settings',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'settings')?'active':''),
'accesskey' => 'o',
@@ -56,7 +57,7 @@ function settings_init(App $a)
if (Feature::get()) {
$tabs[] = [
- 'label' => t('Additional features'),
+ 'label' => L10n::t('Additional features'),
'url' => 'settings/features',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''),
'accesskey' => 't',
@@ -64,49 +65,49 @@ function settings_init(App $a)
}
$tabs[] = [
- 'label' => t('Display'),
+ 'label' => L10n::t('Display'),
'url' => 'settings/display',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''),
'accesskey' => 'i',
];
$tabs[] = [
- 'label' => t('Social Networks'),
+ 'label' => L10n::t('Social Networks'),
'url' => 'settings/connectors',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
'accesskey' => 'w',
];
$tabs[] = [
- 'label' => t('Addons'),
+ 'label' => L10n::t('Addons'),
'url' => 'settings/addon',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
'accesskey' => 'l',
];
$tabs[] = [
- 'label' => t('Delegations'),
+ 'label' => L10n::t('Delegations'),
'url' => 'delegate',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'delegate')?'active':''),
'accesskey' => 'd',
];
$tabs[] = [
- 'label' => t('Connected apps'),
+ 'label' => L10n::t('Connected apps'),
'url' => 'settings/oauth',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
'accesskey' => 'b',
];
$tabs[] = [
- 'label' => t('Export personal data'),
+ 'label' => L10n::t('Export personal data'),
'url' => 'uexport',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'uexport')?'active':''),
'accesskey' => 'e',
];
$tabs[] = [
- 'label' => t('Remove account'),
+ 'label' => L10n::t('Remove account'),
'url' => 'removeme',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme')?'active':''),
'accesskey' => 'r',
@@ -115,7 +116,7 @@ function settings_init(App $a)
$tabtpl = get_markup_template("generic_links_widget.tpl");
$a->page['aside'] = replace_macros($tabtpl, [
- '$title' => t('Settings'),
+ '$title' => L10n::t('Settings'),
'$class' => 'settings-widget',
'$items' => $tabs,
]);
@@ -133,7 +134,7 @@ function settings_post(App $a)
}
if (count($a->user) && x($a->user, 'uid') && $a->user['uid'] != local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
@@ -160,9 +161,9 @@ function settings_post(App $a)
$icon = defaults($_POST, 'icon' , '');
if ($name == "" || $key == "" || $secret == "") {
- notice(t("Missing some important data!"));
+ notice(L10n::t("Missing some important data!"));
} else {
- if ($_POST['submit']==t("Update")) {
+ if ($_POST['submit'] == L10n::t("Update")) {
q("UPDATE clients SET
client_id='%s',
pw='%s',
@@ -271,12 +272,12 @@ function settings_post(App $a)
unset($dcrpass);
if (!$mbox) {
$failed = true;
- notice(t('Failed to connect with email account using the settings provided.') . EOL);
+ notice(L10n::t('Failed to connect with email account using the settings provided.') . EOL);
}
}
}
if (!$failed) {
- info(t('Email settings updated.') . EOL);
+ info(L10n::t('Email settings updated.') . EOL);
}
}
}
@@ -292,7 +293,7 @@ function settings_post(App $a)
PConfig::set(local_user(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0));
}
}
- info(t('Features updated') . EOL);
+ info(L10n::t('Features updated') . EOL);
return;
}
@@ -364,7 +365,7 @@ function settings_post(App $a)
if (x($_POST,'resend_relocate')) {
Worker::add(PRIORITY_HIGH, 'Notifier', 'relocate', local_user());
- info(t("Relocate message has been send to your contacts"));
+ info(L10n::t("Relocate message has been send to your contacts"));
goaway('settings');
}
@@ -376,27 +377,27 @@ function settings_post(App $a)
$err = false;
if ($newpass != $confirm) {
- notice(t('Passwords do not match. Password unchanged.') . EOL);
+ notice(L10n::t('Passwords do not match. Password unchanged.') . EOL);
$err = true;
}
if (!x($newpass) || !x($confirm)) {
- notice(t('Empty passwords are not allowed. Password unchanged.') . EOL);
+ notice(L10n::t('Empty passwords are not allowed. Password unchanged.') . EOL);
$err = true;
}
// check if the old password was supplied correctly before changing it to the new value
if (!User::authenticate(intval(local_user()), $_POST['opassword'])) {
- notice(t('Wrong password.') . EOL);
+ notice(L10n::t('Wrong password.') . EOL);
$err = true;
}
if (!$err) {
$result = User::updatePassword(local_user(), $newpass);
if (DBM::is_result($result)) {
- info(t('Password changed.') . EOL);
+ info(L10n::t('Password changed.') . EOL);
} else {
- notice(t('Password update failed. Please try again.') . EOL);
+ notice(L10n::t('Password update failed. Please try again.') . EOL);
}
}
}
@@ -486,10 +487,10 @@ function settings_post(App $a)
if ($username != $a->user['username']) {
$name_change = true;
if (strlen($username) > 40) {
- $err .= t(' Please use a shorter name.');
+ $err .= L10n::t(' Please use a shorter name.');
}
if (strlen($username) < 3) {
- $err .= t(' Name too short.');
+ $err .= L10n::t(' Name too short.');
}
}
@@ -497,19 +498,19 @@ function settings_post(App $a)
$email_changed = true;
// check for the correct password
if (!User::authenticate(intval(local_user()), $_POST['mpassword'])) {
- $err .= t('Wrong Password') . EOL;
+ $err .= L10n::t('Wrong Password') . EOL;
$email = $a->user['email'];
}
// check the email is valid
if (!valid_email($email)) {
- $err .= t('Invalid email.');
+ $err .= L10n::t('Invalid email.');
}
// ensure new email is not the admin mail
//if ((x($a->config, 'admin_email')) && (strcasecmp($email, $a->config['admin_email']) == 0)) {
if (x($a->config, 'admin_email')) {
$adminlist = explode(",", str_replace(" ", "", strtolower($a->config['admin_email'])));
if (in_array(strtolower($email), $adminlist)) {
- $err .= t('Cannot change to that email.');
+ $err .= L10n::t('Cannot change to that email.');
$email = $a->user['email'];
}
}
@@ -563,10 +564,10 @@ function settings_post(App $a)
$hidewall = 1;
if (!$str_contact_allow && !$str_group_allow && !$str_contact_deny && !$str_group_deny) {
if ($def_gid) {
- info(t('Private forum has no privacy permissions. Using default privacy group.'). EOL);
+ info(L10n::t('Private forum has no privacy permissions. Using default privacy group.'). EOL);
$str_group_allow = '<' . $def_gid . '>';
} else {
- notice(t('Private forum has no privacy permissions and no default privacy group.') . EOL);
+ notice(L10n::t('Private forum has no privacy permissions and no default privacy group.') . EOL);
}
}
}
@@ -606,7 +607,7 @@ function settings_post(App $a)
intval(local_user())
);
if (DBM::is_result($r)) {
- info(t('Settings updated.') . EOL);
+ info(L10n::t('Settings updated.') . EOL);
}
// clear session language
@@ -658,12 +659,12 @@ function settings_content(App $a)
Nav::setSelected('settings');
if (!local_user()) {
- //notice(t('Permission denied.') . EOL);
+ //notice(L10n::t('Permission denied.') . EOL);
return;
}
if (x($_SESSION, 'submanage') && intval($_SESSION['submanage'])) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
@@ -672,14 +673,14 @@ function settings_content(App $a)
$tpl = get_markup_template('settings/oauth_edit.tpl');
$o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_oauth"),
- '$title' => t('Add application'),
- '$submit' => t('Save Settings'),
- '$cancel' => t('Cancel'),
- '$name' => ['name', t('Name'), '', ''],
- '$key' => ['key', t('Consumer Key'), '', ''],
- '$secret' => ['secret', t('Consumer Secret'), '', ''],
- '$redirect' => ['redirect', t('Redirect'), '', ''],
- '$icon' => ['icon', t('Icon url'), '', ''],
+ '$title' => L10n::t('Add application'),
+ '$submit' => L10n::t('Save Settings'),
+ '$cancel' => L10n::t('Cancel'),
+ '$name' => ['name', L10n::t('Name'), '', ''],
+ '$key' => ['key', L10n::t('Consumer Key'), '', ''],
+ '$secret' => ['secret', L10n::t('Consumer Secret'), '', ''],
+ '$redirect' => ['redirect', L10n::t('Redirect'), '', ''],
+ '$icon' => ['icon', L10n::t('Icon url'), '', ''],
]);
return $o;
}
@@ -690,7 +691,7 @@ function settings_content(App $a)
local_user());
if (!DBM::is_result($r)) {
- notice(t("You can't edit this application."));
+ notice(L10n::t("You can't edit this application."));
return;
}
$app = $r[0];
@@ -698,14 +699,14 @@ function settings_content(App $a)
$tpl = get_markup_template('settings/oauth_edit.tpl');
$o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_oauth"),
- '$title' => t('Add application'),
- '$submit' => t('Update'),
- '$cancel' => t('Cancel'),
- '$name' => ['name', t('Name'), $app['name'] , ''],
- '$key' => ['key', t('Consumer Key'), $app['client_id'], ''],
- '$secret' => ['secret', t('Consumer Secret'), $app['pw'], ''],
- '$redirect' => ['redirect', t('Redirect'), $app['redirect_uri'], ''],
- '$icon' => ['icon', t('Icon url'), $app['icon'], ''],
+ '$title' => L10n::t('Add application'),
+ '$submit' => L10n::t('Update'),
+ '$cancel' => L10n::t('Cancel'),
+ '$name' => ['name', L10n::t('Name'), $app['name'] , ''],
+ '$key' => ['key', L10n::t('Consumer Key'), $app['client_id'], ''],
+ '$secret' => ['secret', L10n::t('Consumer Secret'), $app['pw'], ''],
+ '$redirect' => ['redirect', L10n::t('Redirect'), $app['redirect_uri'], ''],
+ '$icon' => ['icon', L10n::t('Icon url'), $app['icon'], ''],
]);
return $o;
}
@@ -733,13 +734,13 @@ function settings_content(App $a)
$o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_oauth"),
'$baseurl' => System::baseUrl(true),
- '$title' => t('Connected Apps'),
- '$add' => t('Add application'),
- '$edit' => t('Edit'),
- '$delete' => t('Delete'),
- '$consumerkey' => t('Client key starts with'),
- '$noname' => t('No name'),
- '$remove' => t('Remove authorization'),
+ '$title' => L10n::t('Connected Apps'),
+ '$add' => L10n::t('Add application'),
+ '$edit' => L10n::t('Edit'),
+ '$delete' => L10n::t('Delete'),
+ '$consumerkey' => L10n::t('Client key starts with'),
+ '$noname' => L10n::t('No name'),
+ '$remove' => L10n::t('Remove authorization'),
'$apps' => $r,
]);
return $o;
@@ -750,7 +751,7 @@ function settings_content(App $a)
$r = q("SELECT * FROM `hook` WHERE `hook` = 'addon_settings' ");
if (!DBM::is_result($r)) {
- $settings_addons = t('No Addon settings configured');
+ $settings_addons = L10n::t('No Addon settings configured');
}
Addon::callHooks('addon_settings', $settings_addons);
@@ -759,7 +760,7 @@ function settings_content(App $a)
$tpl = get_markup_template('settings/addons.tpl');
$o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_addon"),
- '$title' => t('Addon Settings'),
+ '$title' => L10n::t('Addon Settings'),
'$settings_addons' => $settings_addons
]);
return $o;
@@ -773,16 +774,16 @@ function settings_content(App $a)
$arr[$fname] = [];
$arr[$fname][0] = $fdata[0];
foreach (array_slice($fdata,1) as $f) {
- $arr[$fname][1][] = ['feature_' .$f[0], $f[1],((intval(Feature::isEnabled(local_user(), $f[0]))) ? "1" : ''), $f[2],[t('Off'), t('On')]];
+ $arr[$fname][1][] = ['feature_' .$f[0], $f[1],((intval(Feature::isEnabled(local_user(), $f[0]))) ? "1" : ''), $f[2],[L10n::t('Off'), L10n::t('On')]];
}
}
$tpl = get_markup_template('settings/features.tpl');
$o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_features"),
- '$title' => t('Additional Features'),
+ '$title' => L10n::t('Additional Features'),
'$features' => $arr,
- '$submit' => t('Save Settings'),
+ '$submit' => L10n::t('Save Settings'),
]);
return $o;
}
@@ -802,8 +803,8 @@ function settings_content(App $a)
Addon::callHooks('connector_settings', $settings_connectors);
if (is_site_admin()) {
- $diasp_enabled = t('Built-in support for %s connectivity is %s', t('Diaspora'), ((Config::get('system', 'diaspora_enabled')) ? t('enabled') : t('disabled')));
- $ostat_enabled = t('Built-in support for %s connectivity is %s', t('GNU Social (OStatus)'), ((Config::get('system', 'ostatus_disabled')) ? t('disabled') : t('enabled')));
+ $diasp_enabled = L10n::t('Built-in support for %s connectivity is %s', L10n::t('Diaspora'), ((Config::get('system', 'diaspora_enabled')) ? L10n::t('enabled') : L10n::t('disabled')));
+ $ostat_enabled = L10n::t('Built-in support for %s connectivity is %s', L10n::t('GNU Social (OStatus)'), ((Config::get('system', 'ostatus_disabled')) ? L10n::t('disabled') : L10n::t('enabled')));
} else {
$diasp_enabled = "";
$ostat_enabled = "";
@@ -834,41 +835,41 @@ function settings_content(App $a)
$tpl = get_markup_template('settings/connectors.tpl');
- $mail_disabled_message = (($mail_disabled) ? t('Email access is disabled on this site.') : '');
+ $mail_disabled_message = (($mail_disabled) ? L10n::t('Email access is disabled on this site.') : '');
$o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_connectors"),
- '$title' => t('Social Networks'),
+ '$title' => L10n::t('Social Networks'),
'$diasp_enabled' => $diasp_enabled,
'$ostat_enabled' => $ostat_enabled,
- '$general_settings' => t('General Social Media Settings'),
- '$no_intelligent_shortening' => ['no_intelligent_shortening', t('Disable intelligent shortening'), $no_intelligent_shortening, t('Normally the system tries to find the best link to add to shortened posts. If this option is enabled then every shortened post will always point to the original friendica post.')],
- '$ostatus_autofriend' => ['snautofollow', t('Automatically follow any GNU Social (OStatus) followers/mentioners'), $ostatus_autofriend, t('If you receive a message from an unknown OStatus user, this option decides what to do. If it is checked, a new contact will be created for every unknown user.')],
- '$default_group' => Group::displayGroupSelection(local_user(), $default_group, t("Default group for OStatus contacts")),
- '$legacy_contact' => ['legacy_contact', t('Your legacy GNU Social account'), $legacy_contact, t('If you enter your old GNU Social/Statusnet account name here (in the format user@domain.tld), your contacts will be added automatically. The field will be emptied when done.')],
+ '$general_settings' => L10n::t('General Social Media Settings'),
+ '$no_intelligent_shortening' => ['no_intelligent_shortening', L10n::t('Disable intelligent shortening'), $no_intelligent_shortening, L10n::t('Normally the system tries to find the best link to add to shortened posts. If this option is enabled then every shortened post will always point to the original friendica post.')],
+ '$ostatus_autofriend' => ['snautofollow', L10n::t('Automatically follow any GNU Social (OStatus) followers/mentioners'), $ostatus_autofriend, L10n::t('If you receive a message from an unknown OStatus user, this option decides what to do. If it is checked, a new contact will be created for every unknown user.')],
+ '$default_group' => Group::displayGroupSelection(local_user(), $default_group, L10n::t("Default group for OStatus contacts")),
+ '$legacy_contact' => ['legacy_contact', L10n::t('Your legacy GNU Social account'), $legacy_contact, L10n::t('If you enter your old GNU Social/Statusnet account name here (in the format user@domain.tld), your contacts will be added automatically. The field will be emptied when done.')],
'$repair_ostatus_url' => System::baseUrl() . '/repair_ostatus',
- '$repair_ostatus_text' => t('Repair OStatus subscriptions'),
+ '$repair_ostatus_text' => L10n::t('Repair OStatus subscriptions'),
'$settings_connectors' => $settings_connectors,
- '$h_imap' => t('Email/Mailbox Setup'),
- '$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
- '$imap_lastcheck' => ['imap_lastcheck', t('Last successful email check:'), $mail_chk, ''],
+ '$h_imap' => L10n::t('Email/Mailbox Setup'),
+ '$imap_desc' => L10n::t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
+ '$imap_lastcheck' => ['imap_lastcheck', L10n::t('Last successful email check:'), $mail_chk, ''],
'$mail_disabled' => $mail_disabled_message,
- '$mail_server' => ['mail_server', t('IMAP server name:'), $mail_server, ''],
- '$mail_port' => ['mail_port', t('IMAP port:'), $mail_port, ''],
- '$mail_ssl' => ['mail_ssl', t('Security:'), strtoupper($mail_ssl), '', ['notls'=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL']],
- '$mail_user' => ['mail_user', t('Email login name:'), $mail_user, ''],
- '$mail_pass' => ['mail_pass', t('Email password:'), '', ''],
- '$mail_replyto' => ['mail_replyto', t('Reply-to address:'), $mail_replyto, 'Optional'],
- '$mail_pubmail' => ['mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''],
- '$mail_action' => ['mail_action', t('Action after import:'), $mail_action, '', [0=>t('None'), /*1=>t('Delete'),*/ 2=>t('Mark as seen'), 3=>t('Move to folder')]],
- '$mail_movetofolder' => ['mail_movetofolder', t('Move to folder:'), $mail_movetofolder, ''],
- '$submit' => t('Save Settings'),
+ '$mail_server' => ['mail_server', L10n::t('IMAP server name:'), $mail_server, ''],
+ '$mail_port' => ['mail_port', L10n::t('IMAP port:'), $mail_port, ''],
+ '$mail_ssl' => ['mail_ssl', L10n::t('Security:'), strtoupper($mail_ssl), '', ['notls'=>L10n::t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL']],
+ '$mail_user' => ['mail_user', L10n::t('Email login name:'), $mail_user, ''],
+ '$mail_pass' => ['mail_pass', L10n::t('Email password:'), '', ''],
+ '$mail_replyto' => ['mail_replyto', L10n::t('Reply-to address:'), $mail_replyto, 'Optional'],
+ '$mail_pubmail' => ['mail_pubmail', L10n::t('Send public posts to all email contacts:'), $mail_pubmail, ''],
+ '$mail_action' => ['mail_action', L10n::t('Action after import:'), $mail_action, '', [0=>L10n::t('None'), /*1=>L10n::t('Delete'),*/ 2=>L10n::t('Mark as seen'), 3=>L10n::t('Move to folder')]],
+ '$mail_movetofolder' => ['mail_movetofolder', L10n::t('Move to folder:'), $mail_movetofolder, ''],
+ '$submit' => L10n::t('Save Settings'),
]);
Addon::callHooks('display_settings', $o);
@@ -901,7 +902,7 @@ function settings_content(App $a)
$themes = [];
- $mobile_themes = ["---" => t('No special theme for mobile devices')];
+ $mobile_themes = ["---" => L10n::t('No special theme for mobile devices')];
if ($allowed_themes) {
foreach ($allowed_themes as $theme) {
$is_experimental = file_exists('view/theme/' . $theme . '/experimental');
@@ -910,9 +911,9 @@ function settings_content(App $a)
if (!$is_experimental || ($is_experimental && (Config::get('experimentals', 'exp_themes')==1 || is_null(Config::get('experimentals', 'exp_themes'))))) {
$theme_name = ucfirst($theme);
if ($is_unsupported) {
- $theme_name = t("%s - (Unsupported)", $theme_name);
+ $theme_name = L10n::t("%s - (Unsupported)", $theme_name);
} elseif ($is_experimental) {
- $theme_name = t("%s - (Experimental)", $theme_name);
+ $theme_name = L10n::t("%s - (Experimental)", $theme_name);
}
if ($is_mobile) {
$mobile_themes[$theme] = $theme_name;
@@ -939,7 +940,7 @@ function settings_content(App $a)
$nosmile = PConfig::get(local_user(), 'system', 'no_smilies', 0);
$first_day_of_week = PConfig::get(local_user(), 'system', 'first_day_of_week', 0);
- $weekdays = [0 => t("Sunday"), 1 => t("Monday")];
+ $weekdays = [0 => L10n::t("Sunday"), 1 => L10n::t("Monday")];
$noinfo = PConfig::get(local_user(), 'system', 'ignore_info', 0);
$infinite_scroll = PConfig::get(local_user(), 'system', 'infinite_scroll', 0);
@@ -955,37 +956,37 @@ function settings_content(App $a)
$tpl = get_markup_template('settings/display.tpl');
$o = replace_macros($tpl, [
- '$ptitle' => t('Display Settings'),
+ '$ptitle' => L10n::t('Display Settings'),
'$form_security_token' => get_form_security_token("settings_display"),
- '$submit' => t('Save Settings'),
+ '$submit' => L10n::t('Save Settings'),
'$baseurl' => System::baseUrl(true),
'$uid' => local_user(),
- '$theme' => ['theme', t('Display Theme:'), $theme_selected, '', $themes, true],
- '$mobile_theme' => ['mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false],
- '$nowarn_insecure' => ['nowarn_insecure', t('Suppress warning of insecure networks'), $nowarn_insecure, t("Should the system suppress the warning that the current group contains members of networks that can't receive non public postings.")],
- '$ajaxint' => ['browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds. Enter -1 to disable it.')],
- '$itemspage_network' => ['itemspage_network', t("Number of items to display per page:"), $itemspage_network, t('Maximum of 100 items')],
- '$itemspage_mobile_network' => ['itemspage_mobile_network', t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, t('Maximum of 100 items')],
- '$nosmile' => ['nosmile', t("Don't show emoticons"), $nosmile, ''],
- '$calendar_title' => t('Calendar'),
- '$first_day_of_week' => ['first_day_of_week', t('Beginning of week:'), $first_day_of_week, '', $weekdays, false],
- '$noinfo' => ['noinfo', t("Don't show notices"), $noinfo, ''],
- '$infinite_scroll' => ['infinite_scroll', t("Infinite scroll"), $infinite_scroll, ''],
- '$no_auto_update' => ['no_auto_update', t("Automatic updates only at the top of the network page"), $no_auto_update, t('When disabled, the network page is updated all the time, which could be confusing while reading.')],
- '$bandwidth_saver' => ['bandwidth_saver', t('Bandwith Saver Mode'), $bandwidth_saver, t('When enabled, embedded content is not displayed on automatic updates, they only show on page reload.')],
- '$smart_threading' => ['smart_threading', t('Smart Threading'), $smart_threading, t('When enabled, suppress extraneous thread indentation while keeping it where it matters. Only works if threading is available and enabled.')],
+ '$theme' => ['theme', L10n::t('Display Theme:'), $theme_selected, '', $themes, true],
+ '$mobile_theme' => ['mobile_theme', L10n::t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false],
+ '$nowarn_insecure' => ['nowarn_insecure', L10n::t('Suppress warning of insecure networks'), $nowarn_insecure, L10n::t("Should the system suppress the warning that the current group contains members of networks that can't receive non public postings.")],
+ '$ajaxint' => ['browser_update', L10n::t("Update browser every xx seconds"), $browser_update, L10n::t('Minimum of 10 seconds. Enter -1 to disable it.')],
+ '$itemspage_network' => ['itemspage_network', L10n::t("Number of items to display per page:"), $itemspage_network, L10n::t('Maximum of 100 items')],
+ '$itemspage_mobile_network' => ['itemspage_mobile_network', L10n::t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, L10n::t('Maximum of 100 items')],
+ '$nosmile' => ['nosmile', L10n::t("Don't show emoticons"), $nosmile, ''],
+ '$calendar_title' => L10n::t('Calendar'),
+ '$first_day_of_week' => ['first_day_of_week', L10n::t('Beginning of week:'), $first_day_of_week, '', $weekdays, false],
+ '$noinfo' => ['noinfo', L10n::t("Don't show notices"), $noinfo, ''],
+ '$infinite_scroll' => ['infinite_scroll', L10n::t("Infinite scroll"), $infinite_scroll, ''],
+ '$no_auto_update' => ['no_auto_update', L10n::t("Automatic updates only at the top of the network page"), $no_auto_update, L10n::t('When disabled, the network page is updated all the time, which could be confusing while reading.')],
+ '$bandwidth_saver' => ['bandwidth_saver', L10n::t('Bandwith Saver Mode'), $bandwidth_saver, L10n::t('When enabled, embedded content is not displayed on automatic updates, they only show on page reload.')],
+ '$smart_threading' => ['smart_threading', L10n::t('Smart Threading'), $smart_threading, L10n::t('When enabled, suppress extraneous thread indentation while keeping it where it matters. Only works if threading is available and enabled.')],
- '$d_tset' => t('General Theme Settings'),
- '$d_ctset' => t('Custom Theme Settings'),
- '$d_cset' => t('Content Settings'),
- 'stitle' => t('Theme settings'),
+ '$d_tset' => L10n::t('General Theme Settings'),
+ '$d_ctset' => L10n::t('Custom Theme Settings'),
+ '$d_cset' => L10n::t('Content Settings'),
+ 'stitle' => L10n::t('Theme settings'),
'$theme_config' => $theme_config,
]);
$tpl = get_markup_template('settings/display_end.tpl');
$a->page['end'] .= replace_macros($tpl, [
- '$theme' => ['theme', t('Display Theme:'), $theme_selected, '', $themes]
+ '$theme' => ['theme', L10n::t('Display Theme:'), $theme_selected, '', $themes]
]);
return $o;
@@ -1000,7 +1001,7 @@ function settings_content(App $a)
$profile = dba::selectFirst('profile', [], ['is-default' => true, 'uid' => local_user()]);
if (!DBM::is_result($profile)) {
- notice(t('Unable to find your profile. Please contact your admin.') . EOL);
+ notice(L10n::t('Unable to find your profile. Please contact your admin.') . EOL);
return;
}
@@ -1042,49 +1043,49 @@ function settings_content(App $a)
$pageset_tpl = get_markup_template('settings/pagetypes.tpl');
$pagetype = replace_macros($pageset_tpl, [
- '$account_types' => t("Account Types"),
- '$user' => t("Personal Page Subtypes"),
- '$community' => t("Community Forum Subtypes"),
+ '$account_types' => L10n::t("Account Types"),
+ '$user' => L10n::t("Personal Page Subtypes"),
+ '$community' => L10n::t("Community Forum Subtypes"),
'$account_type' => $a->user['account-type'],
'$type_person' => ACCOUNT_TYPE_PERSON,
'$type_organisation' => ACCOUNT_TYPE_ORGANISATION,
'$type_news' => ACCOUNT_TYPE_NEWS,
'$type_community' => ACCOUNT_TYPE_COMMUNITY,
- '$account_person' => ['account-type', t('Personal Page'), ACCOUNT_TYPE_PERSON,
- t('Account for a personal profile.'),
+ '$account_person' => ['account-type', L10n::t('Personal Page'), ACCOUNT_TYPE_PERSON,
+ L10n::t('Account for a personal profile.'),
($a->user['account-type'] == ACCOUNT_TYPE_PERSON)],
- '$account_organisation' => ['account-type', t('Organisation Page'), ACCOUNT_TYPE_ORGANISATION,
- t('Account for an organisation that automatically approves contact requests as "Followers".'),
+ '$account_organisation' => ['account-type', L10n::t('Organisation Page'), ACCOUNT_TYPE_ORGANISATION,
+ L10n::t('Account for an organisation that automatically approves contact requests as "Followers".'),
($a->user['account-type'] == ACCOUNT_TYPE_ORGANISATION)],
- '$account_news' => ['account-type', t('News Page'), ACCOUNT_TYPE_NEWS,
- t('Account for a news reflector that automatically approves contact requests as "Followers".'),
+ '$account_news' => ['account-type', L10n::t('News Page'), ACCOUNT_TYPE_NEWS,
+ L10n::t('Account for a news reflector that automatically approves contact requests as "Followers".'),
($a->user['account-type'] == ACCOUNT_TYPE_NEWS)],
- '$account_community' => ['account-type', t('Community Forum'), ACCOUNT_TYPE_COMMUNITY,
- t('Account for community discussions.'),
+ '$account_community' => ['account-type', L10n::t('Community Forum'), ACCOUNT_TYPE_COMMUNITY,
+ L10n::t('Account for community discussions.'),
($a->user['account-type'] == ACCOUNT_TYPE_COMMUNITY)],
- '$page_normal' => ['page-flags', t('Normal Account Page'), PAGE_NORMAL,
- t('Account for a regular personal profile that requires manual approval of "Friends" and "Followers".'),
+ '$page_normal' => ['page-flags', L10n::t('Normal Account Page'), PAGE_NORMAL,
+ L10n::t('Account for a regular personal profile that requires manual approval of "Friends" and "Followers".'),
($a->user['page-flags'] == PAGE_NORMAL)],
- '$page_soapbox' => ['page-flags', t('Soapbox Page'), PAGE_SOAPBOX,
- t('Account for a public profile that automatically approves contact requests as "Followers".'),
+ '$page_soapbox' => ['page-flags', L10n::t('Soapbox Page'), PAGE_SOAPBOX,
+ L10n::t('Account for a public profile that automatically approves contact requests as "Followers".'),
($a->user['page-flags'] == PAGE_SOAPBOX)],
- '$page_community' => ['page-flags', t('Public Forum'), PAGE_COMMUNITY,
- t('Automatically approves all contact requests.'),
+ '$page_community' => ['page-flags', L10n::t('Public Forum'), PAGE_COMMUNITY,
+ L10n::t('Automatically approves all contact requests.'),
($a->user['page-flags'] == PAGE_COMMUNITY)],
- '$page_freelove' => ['page-flags', t('Automatic Friend Page'), PAGE_FREELOVE,
- t('Account for a popular profile that automatically approves contact requests as "Friends".'),
+ '$page_freelove' => ['page-flags', L10n::t('Automatic Friend Page'), PAGE_FREELOVE,
+ L10n::t('Account for a popular profile that automatically approves contact requests as "Friends".'),
($a->user['page-flags'] == PAGE_FREELOVE)],
- '$page_prvgroup' => ['page-flags', t('Private Forum [Experimental]'), PAGE_PRVGROUP,
- t('Requires manual approval of contact requests.'),
+ '$page_prvgroup' => ['page-flags', L10n::t('Private Forum [Experimental]'), PAGE_PRVGROUP,
+ L10n::t('Requires manual approval of contact requests.'),
($a->user['page-flags'] == PAGE_PRVGROUP)],
@@ -1095,7 +1096,7 @@ function settings_content(App $a)
if ($noid) {
$openid_field = false;
} else {
- $openid_field = ['openid_url', t('OpenID:'), $openid, t("\x28Optional\x29 Allow this OpenID to login to this account."), "", "", "url"];
+ $openid_field = ['openid_url', L10n::t('OpenID:'), $openid, L10n::t("\x28Optional\x29 Allow this OpenID to login to this account."), "", "", "url"];
}
$opt_tpl = get_markup_template("field_yesno.tpl");
@@ -1103,64 +1104,64 @@ function settings_content(App $a)
$profile_in_dir = '
';
} else {
$profile_in_dir = replace_macros($opt_tpl, [
- '$field' => ['profile_in_directory', t('Publish your default profile in your local site directory?'), $profile['publish'], t("Your profile may be visible in public."), [t('No'), t('Yes')]]
+ '$field' => ['profile_in_directory', L10n::t('Publish your default profile in your local site directory?'), $profile['publish'], L10n::t("Your profile may be visible in public."), [L10n::t('No'), L10n::t('Yes')]]
]);
}
if (strlen(Config::get('system', 'directory'))) {
$profile_in_net_dir = replace_macros($opt_tpl, [
- '$field' => ['profile_in_netdirectory', t('Publish your default profile in the global social directory?'), $profile['net-publish'], '', [t('No'), t('Yes')]]
+ '$field' => ['profile_in_netdirectory', L10n::t('Publish your default profile in the global social directory?'), $profile['net-publish'], '', [L10n::t('No'), L10n::t('Yes')]]
]);
} else {
$profile_in_net_dir = '';
}
$hide_friends = replace_macros($opt_tpl, [
- '$field' => ['hide-friends', t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], '', [t('No'), t('Yes')]],
+ '$field' => ['hide-friends', L10n::t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], '', [L10n::t('No'), L10n::t('Yes')]],
]);
$hide_wall = replace_macros($opt_tpl, [
- '$field' => ['hidewall', t('Hide your profile details from unknown viewers?'), $a->user['hidewall'], t("If enabled, posting public messages to Diaspora and other networks isn't possible."), [t('No'), t('Yes')]],
+ '$field' => ['hidewall', L10n::t('Hide your profile details from unknown viewers?'), $a->user['hidewall'], L10n::t("If enabled, posting public messages to Diaspora and other networks isn't possible."), [L10n::t('No'), L10n::t('Yes')]],
]);
$blockwall = replace_macros($opt_tpl, [
- '$field' => ['blockwall', t('Allow friends to post to your profile page?'), (intval($a->user['blockwall']) ? '0' : '1'), '', [t('No'), t('Yes')]],
+ '$field' => ['blockwall', L10n::t('Allow friends to post to your profile page?'), (intval($a->user['blockwall']) ? '0' : '1'), '', [L10n::t('No'), L10n::t('Yes')]],
]);
$blocktags = replace_macros($opt_tpl, [
- '$field' => ['blocktags', t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), '', [t('No'), t('Yes')]],
+ '$field' => ['blocktags', L10n::t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), '', [L10n::t('No'), L10n::t('Yes')]],
]);
$suggestme = replace_macros($opt_tpl, [
- '$field' => ['suggestme', t('Allow us to suggest you as a potential friend to new members?'), $suggestme, '', [t('No'), t('Yes')]],
+ '$field' => ['suggestme', L10n::t('Allow us to suggest you as a potential friend to new members?'), $suggestme, '', [L10n::t('No'), L10n::t('Yes')]],
]);
$unkmail = replace_macros($opt_tpl, [
- '$field' => ['unkmail', t('Permit unknown people to send you private mail?'), $unkmail, '', [t('No'), t('Yes')]],
+ '$field' => ['unkmail', L10n::t('Permit unknown people to send you private mail?'), $unkmail, '', [L10n::t('No'), L10n::t('Yes')]],
]);
if (!$profile['publish'] && !$profile['net-publish']) {
- info(t('Profile is
not published .') . EOL);
+ info(L10n::t('Profile is
not published .') . EOL);
}
$tpl_addr = get_markup_template('settings/nick_set.tpl');
$prof_addr = replace_macros($tpl_addr,[
- '$desc' => t("Your Identity Address is
'%s' or '%s'.", $nickname . '@' . $a->get_hostname() . $a->get_path(), System::baseUrl() . '/profile/' . $nickname),
+ '$desc' => L10n::t("Your Identity Address is
'%s' or '%s'.", $nickname . '@' . $a->get_hostname() . $a->get_path(), System::baseUrl() . '/profile/' . $nickname),
'$basepath' => $a->get_hostname()
]);
$stpl = get_markup_template('settings/settings.tpl');
$expire_arr = [
- 'days' => ['expire', t("Automatically expire posts after this many days:"), $expire, t('If empty, posts will not expire. Expired posts will be deleted')],
- 'advanced' => t('Advanced expiration settings'),
- 'label' => t('Advanced Expiration'),
- 'items' => ['expire_items', t("Expire posts:"), $expire_items, '', [t('No'), t('Yes')]],
- 'notes' => ['expire_notes', t("Expire personal notes:"), $expire_notes, '', [t('No'), t('Yes')]],
- 'starred' => ['expire_starred', t("Expire starred posts:"), $expire_starred, '', [t('No'), t('Yes')]],
- 'photos' => ['expire_photos', t("Expire photos:"), $expire_photos, '', [t('No'), t('Yes')]],
- 'network_only' => ['expire_network_only', t("Only expire posts by others:"), $expire_network_only, '', [t('No'), t('Yes')]],
+ 'days' => ['expire', L10n::t("Automatically expire posts after this many days:"), $expire, L10n::t('If empty, posts will not expire. Expired posts will be deleted')],
+ 'advanced' => L10n::t('Advanced expiration settings'),
+ 'label' => L10n::t('Advanced Expiration'),
+ 'items' => ['expire_items', L10n::t("Expire posts:"), $expire_items, '', [L10n::t('No'), L10n::t('Yes')]],
+ 'notes' => ['expire_notes', L10n::t("Expire personal notes:"), $expire_notes, '', [L10n::t('No'), L10n::t('Yes')]],
+ 'starred' => ['expire_starred', L10n::t("Expire starred posts:"), $expire_starred, '', [L10n::t('No'), L10n::t('Yes')]],
+ 'photos' => ['expire_photos', L10n::t("Expire photos:"), $expire_photos, '', [L10n::t('No'), L10n::t('Yes')]],
+ 'network_only' => ['expire_network_only', L10n::t("Only expire posts by others:"), $expire_network_only, '', [L10n::t('No'), L10n::t('Yes')]],
];
$group_select = Group::displayGroupSelection(local_user(), $a->user['def_gid']);
@@ -1186,55 +1187,55 @@ function settings_content(App $a)
}
/* Installed langs */
- $lang_choices = get_available_languages();
+ $lang_choices = L10n::getAvailableLanguages();
/// @TODO Fix indending (or so)
$o .= replace_macros($stpl, [
- '$ptitle' => t('Account Settings'),
+ '$ptitle' => L10n::t('Account Settings'),
- '$submit' => t('Save Settings'),
+ '$submit' => L10n::t('Save Settings'),
'$baseurl' => System::baseUrl(true),
'$uid' => local_user(),
'$form_security_token' => get_form_security_token("settings"),
'$nickname_block' => $prof_addr,
- '$h_pass' => t('Password Settings'),
- '$password1'=> ['password', t('New Password:'), '', ''],
- '$password2'=> ['confirm', t('Confirm:'), '', t('Leave password fields blank unless changing')],
- '$password3'=> ['opassword', t('Current Password:'), '', t('Your current password to confirm the changes')],
- '$password4'=> ['mpassword', t('Password:'), '', t('Your current password to confirm the changes')],
+ '$h_pass' => L10n::t('Password Settings'),
+ '$password1'=> ['password', L10n::t('New Password:'), '', ''],
+ '$password2'=> ['confirm', L10n::t('Confirm:'), '', L10n::t('Leave password fields blank unless changing')],
+ '$password3'=> ['opassword', L10n::t('Current Password:'), '', L10n::t('Your current password to confirm the changes')],
+ '$password4'=> ['mpassword', L10n::t('Password:'), '', L10n::t('Your current password to confirm the changes')],
'$oid_enable' => (!Config::get('system', 'no_openid')),
'$openid' => $openid_field,
- '$h_basic' => t('Basic Settings'),
- '$username' => ['username', t('Full Name:'), $username, ''],
- '$email' => ['email', t('Email Address:'), $email, '', '', '', 'email'],
- '$timezone' => ['timezone_select' , t('Your Timezone:'), select_timezone($timezone), ''],
- '$language' => ['language', t('Your Language:'), $language, t('Set the language we use to show you friendica interface and to send you emails'), $lang_choices],
- '$defloc' => ['defloc', t('Default Post Location:'), $defloc, ''],
- '$allowloc' => ['allow_location', t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''],
+ '$h_basic' => L10n::t('Basic Settings'),
+ '$username' => ['username', L10n::t('Full Name:'), $username, ''],
+ '$email' => ['email', L10n::t('Email Address:'), $email, '', '', '', 'email'],
+ '$timezone' => ['timezone_select' , L10n::t('Your Timezone:'), select_timezone($timezone), ''],
+ '$language' => ['language', L10n::t('Your Language:'), $language, L10n::t('Set the language we use to show you friendica interface and to send you emails'), $lang_choices],
+ '$defloc' => ['defloc', L10n::t('Default Post Location:'), $defloc, ''],
+ '$allowloc' => ['allow_location', L10n::t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''],
- '$h_prv' => t('Security and Privacy Settings'),
+ '$h_prv' => L10n::t('Security and Privacy Settings'),
- '$maxreq' => ['maxreq', t('Maximum Friend Requests/Day:'), $maxreq , t("\x28to prevent spam abuse\x29")],
- '$permissions' => t('Default Post Permissions'),
- '$permdesc' => t("\x28click to open/close\x29"),
+ '$maxreq' => ['maxreq', L10n::t('Maximum Friend Requests/Day:'), $maxreq , L10n::t("\x28to prevent spam abuse\x29")],
+ '$permissions' => L10n::t('Default Post Permissions'),
+ '$permdesc' => L10n::t("\x28click to open/close\x29"),
'$visibility' => $profile['net-publish'],
'$aclselect' => populate_acl($a->user),
'$suggestme' => $suggestme,
- '$blockwall'=> $blockwall, // array('blockwall', t('Allow friends to post to your profile page:'), !$blockwall, ''),
- '$blocktags'=> $blocktags, // array('blocktags', t('Allow friends to tag your posts:'), !$blocktags, ''),
+ '$blockwall'=> $blockwall, // array('blockwall', L10n::t('Allow friends to post to your profile page:'), !$blockwall, ''),
+ '$blocktags'=> $blocktags, // array('blocktags', L10n::t('Allow friends to tag your posts:'), !$blocktags, ''),
// ACL permissions box
- '$group_perms' => t('Show to Groups'),
- '$contact_perms' => t('Show to Contacts'),
- '$private' => t('Default Private Post'),
- '$public' => t('Default Public Post'),
+ '$group_perms' => L10n::t('Show to Groups'),
+ '$contact_perms' => L10n::t('Show to Contacts'),
+ '$private' => L10n::t('Default Private Post'),
+ '$public' => L10n::t('Default Public Post'),
'$is_private' => $private_post,
'$return_path' => $query_str,
'$public_link' => $public_post_link,
- '$settings_perms' => t('Default Permissions for New Posts'),
+ '$settings_perms' => L10n::t('Default Permissions for New Posts'),
'$group_select' => $group_select,
@@ -1246,41 +1247,41 @@ function settings_content(App $a)
'$hide_friends' => $hide_friends,
'$hide_wall' => $hide_wall,
'$unkmail' => $unkmail,
- '$cntunkmail' => ['cntunkmail', t('Maximum private messages per day from unknown people:'), $cntunkmail , t("\x28to prevent spam abuse\x29")],
+ '$cntunkmail' => ['cntunkmail', L10n::t('Maximum private messages per day from unknown people:'), $cntunkmail , L10n::t("\x28to prevent spam abuse\x29")],
- '$h_not' => t('Notification Settings'),
- '$activity_options' => t('By default post a status message when:'),
- '$post_newfriend' => ['post_newfriend', t('accepting a friend request'), $post_newfriend, ''],
- '$post_joingroup' => ['post_joingroup', t('joining a forum/community'), $post_joingroup, ''],
- '$post_profilechange' => ['post_profilechange', t('making an
interesting profile change'), $post_profilechange, ''],
- '$lbl_not' => t('Send a notification email when:'),
- '$notify1' => ['notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''],
- '$notify2' => ['notify2', t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''],
- '$notify3' => ['notify3', t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''],
- '$notify4' => ['notify4', t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''],
- '$notify5' => ['notify5', t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''],
- '$notify6' => ['notify6', t('You receive a friend suggestion'), ($notify & NOTIFY_SUGGEST), NOTIFY_SUGGEST, ''],
- '$notify7' => ['notify7', t('You are tagged in a post'), ($notify & NOTIFY_TAGSELF), NOTIFY_TAGSELF, ''],
- '$notify8' => ['notify8', t('You are poked/prodded/etc. in a post'), ($notify & NOTIFY_POKE), NOTIFY_POKE, ''],
+ '$h_not' => L10n::t('Notification Settings'),
+ '$activity_options' => L10n::t('By default post a status message when:'),
+ '$post_newfriend' => ['post_newfriend', L10n::t('accepting a friend request'), $post_newfriend, ''],
+ '$post_joingroup' => ['post_joingroup', L10n::t('joining a forum/community'), $post_joingroup, ''],
+ '$post_profilechange' => ['post_profilechange', L10n::t('making an
interesting profile change'), $post_profilechange, ''],
+ '$lbl_not' => L10n::t('Send a notification email when:'),
+ '$notify1' => ['notify1', L10n::t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''],
+ '$notify2' => ['notify2', L10n::t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''],
+ '$notify3' => ['notify3', L10n::t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''],
+ '$notify4' => ['notify4', L10n::t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''],
+ '$notify5' => ['notify5', L10n::t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''],
+ '$notify6' => ['notify6', L10n::t('You receive a friend suggestion'), ($notify & NOTIFY_SUGGEST), NOTIFY_SUGGEST, ''],
+ '$notify7' => ['notify7', L10n::t('You are tagged in a post'), ($notify & NOTIFY_TAGSELF), NOTIFY_TAGSELF, ''],
+ '$notify8' => ['notify8', L10n::t('You are poked/prodded/etc. in a post'), ($notify & NOTIFY_POKE), NOTIFY_POKE, ''],
- '$desktop_notifications' => ['desktop_notifications', t('Activate desktop notifications') , false, t('Show desktop popup on new notifications')],
+ '$desktop_notifications' => ['desktop_notifications', L10n::t('Activate desktop notifications') , false, L10n::t('Show desktop popup on new notifications')],
- '$email_textonly' => ['email_textonly', t('Text-only notification emails'),
+ '$email_textonly' => ['email_textonly', L10n::t('Text-only notification emails'),
PConfig::get(local_user(), 'system', 'email_textonly'),
- t('Send text only notification emails, without the html part')],
+ L10n::t('Send text only notification emails, without the html part')],
- '$detailed_notif' => ['detailed_notif', t('Show detailled notifications'),
+ '$detailed_notif' => ['detailed_notif', L10n::t('Show detailled notifications'),
PConfig::get(local_user(), 'system', 'detailed_notif'),
- t('Per default the notificiation are condensed to a single notification per item. When enabled, every notification is displayed.')],
+ L10n::t('Per default the notificiation are condensed to a single notification per item. When enabled, every notification is displayed.')],
- '$h_advn' => t('Advanced Account/Page Type Settings'),
- '$h_descadvn' => t('Change the behaviour of this account for special situations'),
+ '$h_advn' => L10n::t('Advanced Account/Page Type Settings'),
+ '$h_descadvn' => L10n::t('Change the behaviour of this account for special situations'),
'$pagetype' => $pagetype,
- '$relocate' => t('Relocate'),
- '$relocate_text' => t("If you have moved this profile from another server, and some of your contacts don't receive your updates, try pushing this button."),
- '$relocate_button' => t("Resend relocate message to contacts"),
+ '$relocate' => L10n::t('Relocate'),
+ '$relocate_text' => L10n::t("If you have moved this profile from another server, and some of your contacts don't receive your updates, try pushing this button."),
+ '$relocate_button' => L10n::t("Resend relocate message to contacts"),
]);
diff --git a/mod/subthread.php b/mod/subthread.php
index af7f0b492..9502b7f8d 100644
--- a/mod/subthread.php
+++ b/mod/subthread.php
@@ -1,13 +1,16 @@
get_hostname(),$owner_uid);
- $post_type = (($item['resource-id']) ? t('photo') : t('status'));
+ $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
$objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
$link = xmlify('
' . "\n") ;
$body = $item['body'];
@@ -105,7 +108,7 @@ function subthread_content(App $a) {
$body
EOT;
- $bodyverb = t('%1$s is following %2$s\'s %3$s');
+ $bodyverb = L10n::t('%1$s is following %2$s\'s %3$s');
if (! isset($bodyverb)) {
return;
diff --git a/mod/suggest.php b/mod/suggest.php
index 8a25fb0b2..5e8dcc5fb 100644
--- a/mod/suggest.php
+++ b/mod/suggest.php
@@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Widget;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
@@ -32,12 +33,12 @@ function suggest_init(App $a) {
$a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'get',
- '$message' => t('Do you really want to delete this suggestion?'),
+ '$message' => L10n::t('Do you really want to delete this suggestion?'),
'$extra_inputs' => $inputs,
- '$confirm' => t('Yes'),
+ '$confirm' => L10n::t('Yes'),
'$confirm_url' => $query['base'],
'$confirm_name' => 'confirmed',
- '$cancel' => t('Cancel'),
+ '$cancel' => L10n::t('Cancel'),
]);
$a->error = 1; // Set $a->error so the other module functions don't execute
return;
@@ -56,7 +57,7 @@ function suggest_content(App $a) {
$o = '';
if (! local_user()) {
- notice( t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
@@ -69,7 +70,7 @@ function suggest_content(App $a) {
$r = GContact::suggestionQuery(local_user());
if (! DBM::is_result($r)) {
- $o .= t('No suggestions available. If this is a new site, please try again in 24 hours.');
+ $o .= L10n::t('No suggestions available. If this is a new site, please try again in 24 hours.');
return $o;
}
@@ -78,9 +79,9 @@ function suggest_content(App $a) {
$connlnk = System::baseUrl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
$ignlnk = System::baseUrl() . '/suggest?ignore=' . $rr['id'];
$photo_menu = [
- 'profile' => [t("View Profile"), Profile::zrl($rr["url"])],
- 'follow' => [t("Connect/Follow"), $connlnk],
- 'hide' => [t('Ignore/Hide'), $ignlnk]
+ 'profile' => [L10n::t("View Profile"), Profile::zrl($rr["url"])],
+ 'follow' => [L10n::t("Connect/Follow"), $connlnk],
+ 'hide' => [L10n::t('Ignore/Hide'), $ignlnk]
];
$contact_details = Contact::getDetailsByURL($rr["url"], local_user(), $rr);
@@ -97,10 +98,10 @@ function suggest_content(App $a) {
'account_type' => Contact::getAccountType($contact_details),
'ignlnk' => $ignlnk,
'ignid' => $rr['id'],
- 'conntxt' => t('Connect'),
+ 'conntxt' => L10n::t('Connect'),
'connlnk' => $connlnk,
'photo_menu' => $photo_menu,
- 'ignore' => t('Ignore/Hide'),
+ 'ignore' => L10n::t('Ignore/Hide'),
'network' => ContactSelector::networkToName($rr['network'], $rr['url']),
'id' => ++$id,
];
@@ -110,7 +111,7 @@ function suggest_content(App $a) {
$tpl = get_markup_template('viewcontact_template.tpl');
$o .= replace_macros($tpl,[
- '$title' => t('Friend Suggestions'),
+ '$title' => L10n::t('Friend Suggestions'),
'$contacts' => $entries,
]);
diff --git a/mod/tagger.php b/mod/tagger.php
index 74cbd658f..942cad2ad 100644
--- a/mod/tagger.php
+++ b/mod/tagger.php
@@ -1,14 +1,17 @@
get_hostname(),$owner_uid);
$xterm = xmlify($term);
- $post_type = (($item['resource-id']) ? t('photo') : t('status'));
+ $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
$targettype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
$link = xmlify('
' . t('Select a tag to remove: ') . '';
+ $o .= '
' . L10n::t('Select a tag to remove: ') . '
';
$o .= '
';
return $o;
diff --git a/mod/uexport.php b/mod/uexport.php
index 29ea19c20..c6f76cfce 100644
--- a/mod/uexport.php
+++ b/mod/uexport.php
@@ -1,7 +1,10 @@
System::baseUrl(),
- '$title' => t('Export personal data'),
+ '$title' => L10n::t('Export personal data'),
'$options' => $options
]);
}
diff --git a/mod/uimport.php b/mod/uimport.php
index 851661341..a1b0e4d14 100644
--- a/mod/uimport.php
+++ b/mod/uimport.php
@@ -6,9 +6,11 @@
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\UserImport;
-function uimport_post(App $a) {
+function uimport_post(App $a)
+{
switch ($a->config['register_policy']) {
case REGISTER_OPEN:
$blocked = 0;
@@ -23,7 +25,7 @@ function uimport_post(App $a) {
default:
case REGISTER_CLOSED:
if ((!x($_SESSION, 'authenticated') && (!x($_SESSION, 'administrator')))) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
$blocked = 1;
@@ -50,7 +52,7 @@ function uimport_content(App $a) {
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
if ($r && $r[0]['total'] >= $max_dailies) {
logger('max daily registrations exceeded.');
- notice(t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
+ notice(L10n::t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
return;
}
}
@@ -65,13 +67,13 @@ function uimport_content(App $a) {
$tpl = get_markup_template("uimport.tpl");
return replace_macros($tpl, [
- '$regbutt' => t('Import'),
+ '$regbutt' => L10n::t('Import'),
'$import' => [
- 'title' => t("Move account"),
- 'intro' => t("You can import an account from another Friendica server."),
- 'instruct' => t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
- 'warn' => t("This feature is experimental. We can't import contacts from the OStatus network (GNU Social/Statusnet) or from Diaspora"),
- 'field' => ['accountfile', t('Account file'), '
', t('To export your account, go to "Settings->Export your personal data" and select "Export account"')],
+ 'title' => L10n::t("Move account"),
+ 'intro' => L10n::t("You can import an account from another Friendica server."),
+ 'instruct' => L10n::t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
+ 'warn' => L10n::t("This feature is experimental. We can't import contacts from the OStatus network (GNU Social/Statusnet) or from Diaspora"),
+ 'field' => ['accountfile', L10n::t('Account file'), '
', L10n::t('To export your account, go to "Settings->Export your personal data" and select "Export account"')],
],
]);
}
diff --git a/mod/unfollow.php b/mod/unfollow.php
index 246cb8bad..8caf94245 100644
--- a/mod/unfollow.php
+++ b/mod/unfollow.php
@@ -3,6 +3,7 @@
* @file mod/unfollow.php
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
@@ -11,7 +12,7 @@ use Friendica\Model\Profile;
function unfollow_post(App $a)
{
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}
@@ -30,30 +31,30 @@ function unfollow_post(App $a)
$contact = dba::selectFirst('contact', [], $condition);
if (!DBM::is_result($contact)) {
- notice(t("Contact wasn't found or can't be unfollowed."));
+ notice(L10n::t("Contact wasn't found or can't be unfollowed."));
} else {
if (in_array($contact['network'], [NETWORK_OSTATUS, NETWORK_DIASPORA])) {
$r = q("SELECT `contact`.*, `user`.* FROM `contact` INNER JOIN `user` ON `contact`.`uid` = `user`.`uid`
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
intval($uid)
);
- if (DBM::is_result($r)) {
+ if (DBM::is_result($r)) {
Contact::terminateFriendship($r[0], $contact);
}
}
dba::update('contact', ['rel' => CONTACT_IS_FOLLOWER], ['id' => $contact['id']]);
- info(t('Contact unfollowed').EOL);
+ info(L10n::t('Contact unfollowed').EOL);
goaway(System::baseUrl().'/contacts/'.$contact['id']);
}
goaway($return_url);
// NOTREACHED
}
-function unfollow_content(App $a) {
-
+function unfollow_content(App $a)
+{
if (! local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}
@@ -61,7 +62,7 @@ function unfollow_content(App $a) {
$uid = local_user();
$url = notags(trim($_REQUEST['url']));
- $submit = t('Submit Request');
+ $submit = L10n::t('Submit Request');
$condition = ["`uid` = ? AND `rel` = ? AND (`nurl` = ? OR `alias` = ? OR `alias` = ?) AND `network` != ?",
local_user(), CONTACT_IS_FRIEND, normalise_link($url),
@@ -69,13 +70,13 @@ function unfollow_content(App $a) {
$contact = dba::selectFirst('contact', ['url', 'network', 'addr', 'name'], $condition);
if (!DBM::is_result($contact)) {
- notice(t("You aren't a friend of this contact.").EOL);
+ notice(L10n::t("You aren't a friend of this contact.").EOL);
$submit = "";
// NOTREACHED
}
if (!in_array($contact['network'], [NETWORK_DIASPORA, NETWORK_OSTATUS])) {
- notice(t("Unfollowing is currently not supported by your network.").EOL);
+ notice(L10n::t("Unfollowing is currently not supported by your network.").EOL);
$submit = "";
// NOTREACHED
}
@@ -86,7 +87,7 @@ function unfollow_content(App $a) {
$r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1", intval($uid));
if (!$r) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}
@@ -96,9 +97,9 @@ function unfollow_content(App $a) {
// Makes the connection request for friendica contacts easier
$_SESSION["fastlane"] = $contact["url"];
- $header = t("Disconnect/Unfollow");
+ $header = L10n::t("Disconnect/Unfollow");
- $o = replace_macros($tpl,[
+ $o = replace_macros($tpl, [
'$header' => htmlentities($header),
'$desc' => "",
'$pls_answer' => "",
@@ -109,16 +110,16 @@ function unfollow_content(App $a) {
'$statusnet' => "",
'$diaspora' => "",
'$diasnote' => "",
- '$your_address' => t('Your Identity Address:'),
+ '$your_address' => L10n::t('Your Identity Address:'),
'$invite_desc' => "",
'$emailnet' => "",
'$submit' => $submit,
- '$cancel' => t('Cancel'),
+ '$cancel' => L10n::t('Cancel'),
'$nickname' => "",
'$name' => $contact["name"],
'$url' => $contact["url"],
'$zrl' => Profile::zrl($contact["url"]),
- '$url_label' => t("Profile URL"),
+ '$url_label' => L10n::t("Profile URL"),
'$myaddr' => $myaddr,
'$request' => $request,
'$keywords' => "",
@@ -128,7 +129,7 @@ function unfollow_content(App $a) {
$a->page['aside'] = "";
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
- $o .= replace_macros(get_markup_template('section_title.tpl'), ['$title' => t('Status Messages and Posts')]);
+ $o .= replace_macros(get_markup_template('section_title.tpl'), ['$title' => L10n::t('Status Messages and Posts')]);
// Show last public posts
$o .= Contact::getPostsFromUrl($contact["url"]);
diff --git a/mod/update_community.php b/mod/update_community.php
index 037c72489..d5f2b4cb2 100644
--- a/mod/update_community.php
+++ b/mod/update_community.php
@@ -3,9 +3,10 @@
// See update_profile.php for documentation
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
-require_once("mod/community.php");
+require_once 'mod/community.php';
function update_community_content(App $a) {
header("Content-type: text/html");
@@ -23,7 +24,7 @@ function update_community_content(App $a) {
$text = preg_replace($pattern, $replace, $text);
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
- $replace = "
".t("[Embedded content - reload page to view]")."
";
+ $replace = "
".L10n::t("[Embedded content - reload page to view]")."
";
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
diff --git a/mod/update_display.php b/mod/update_display.php
index 0fbb3f942..1341d3052 100644
--- a/mod/update_display.php
+++ b/mod/update_display.php
@@ -1,8 +1,11 @@
" . t("[Embedded content - reload page to view]") . "
";
+ $replace = "
" . L10n::t("[Embedded content - reload page to view]") . "
";
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
diff --git a/mod/update_network.php b/mod/update_network.php
index 3a5741f6a..fddbeba39 100644
--- a/mod/update_network.php
+++ b/mod/update_network.php
@@ -1,8 +1,11 @@
" . t("[Embedded content - reload page to view]") . "
";
+ $replace = "
" . L10n::t("[Embedded content - reload page to view]") . "
";
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
diff --git a/mod/update_notes.php b/mod/update_notes.php
index b81c2fbe7..e36926112 100644
--- a/mod/update_notes.php
+++ b/mod/update_notes.php
@@ -6,6 +6,7 @@
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
require_once("mod/notes.php");
@@ -36,7 +37,7 @@ function update_notes_content(App $a) {
$text = preg_replace($pattern, $replace, $text);
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
- $replace = "
".t("[Embedded content - reload page to view]")."
";
+ $replace = "
".L10n::t("[Embedded content - reload page to view]")."
";
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
diff --git a/mod/update_profile.php b/mod/update_profile.php
index f293088a9..4d1f158b3 100644
--- a/mod/update_profile.php
+++ b/mod/update_profile.php
@@ -6,9 +6,10 @@
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
-require_once("mod/profile.php");
+require_once 'mod/profile.php';
function update_profile_content(App $a) {
@@ -35,7 +36,7 @@ function update_profile_content(App $a) {
$text = preg_replace($pattern, $replace, $text);
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
- $replace = "
".t("[Embedded content - reload page to view]")."
";
+ $replace = "
".L10n::t("[Embedded content - reload page to view]")."
";
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
diff --git a/mod/videos.php b/mod/videos.php
index 239d86168..ac7d0f34e 100644
--- a/mod/videos.php
+++ b/mod/videos.php
@@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@@ -71,7 +72,7 @@ function videos_init(App $a) {
if($albums_visible) {
$o .= '';
@@ -133,15 +134,15 @@ function videos_post(App $a) {
$drop_url = $a->query_string;
$a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'post',
- '$message' => t('Do you really want to delete this video?'),
+ '$message' => L10n::t('Do you really want to delete this video?'),
'$extra_inputs' => [
['name'=>'id', 'value'=> $_POST['id']],
['name'=>'delete', 'value'=>'x']
],
- '$confirm' => t('Delete Video'),
+ '$confirm' => L10n::t('Delete Video'),
'$confirm_url' => $drop_url,
'$confirm_name' => 'confirm', // Needed so that confirmation will bring us back into this if statement
- '$cancel' => t('Cancel'),
+ '$cancel' => L10n::t('Cancel'),
]);
$a->error = 1; // Set $a->error so the other module functions don't execute
@@ -207,7 +208,7 @@ function videos_content(App $a) {
if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
- notice( t('Public access denied.') . EOL);
+ notice(L10n::t('Public access denied.') . EOL);
return;
}
@@ -217,7 +218,7 @@ function videos_content(App $a) {
require_once('include/conversation.php');
if(! x($a->data,'user')) {
- notice( t('No videos selected') . EOL );
+ notice(L10n::t('No videos selected') . EOL );
return;
}
@@ -319,7 +320,7 @@ function videos_content(App $a) {
}
if($a->data['user']['hidewall'] && (local_user() != $owner_uid) && (! $remote_contact)) {
- notice( t('Access to this item is restricted.') . EOL);
+ notice(L10n::t('Access to this item is restricted.') . EOL);
return;
}
@@ -390,14 +391,14 @@ function videos_content(App $a) {
$videos[] = [
'id' => $rr['id'],
'link' => System::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/video/' . $rr['resource-id'],
- 'title' => t('View Video'),
+ 'title' => L10n::t('View Video'),
'src' => System::baseUrl() . '/attach/' . $rr['id'] . '?attachment=0',
'alt' => $alt_e,
'mime' => $rr['filetype'],
'album' => [
'link' => System::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
'name' => $name_e,
- 'alt' => t('View Album'),
+ 'alt' => L10n::t('View Album'),
],
];
@@ -406,9 +407,9 @@ function videos_content(App $a) {
$tpl = get_markup_template('videos_recent.tpl');
$o .= replace_macros($tpl, [
- '$title' => t('Recent Videos'),
+ '$title' => L10n::t('Recent Videos'),
'$can_post' => $can_post,
- '$upload' => [t('Upload New Videos'), System::baseUrl().'/videos/'.$a->data['user']['nickname'].'/upload'],
+ '$upload' => [L10n::t('Upload New Videos'), System::baseUrl().'/videos/'.$a->data['user']['nickname'].'/upload'],
'$videos' => $videos,
'$delete_url' => (($can_post)?System::baseUrl().'/videos/'.$a->data['user']['nickname']:False)
]);
diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php
index 22ab555b3..b45980fec 100644
--- a/mod/viewcontacts.php
+++ b/mod/viewcontacts.php
@@ -6,19 +6,20 @@ use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Nav;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
-function viewcontacts_init(App $a) {
-
- if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
+function viewcontacts_init(App $a)
+{
+ if ((Config::get('system', 'block_public')) && (! local_user()) && (! remote_user())) {
return;
}
Nav::setSelected('home');
- if($a->argc > 1) {
+ if ($a->argc > 1) {
$nick = $a->argv[1];
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `blocked` = 0 LIMIT 1",
dbesc($nick)
@@ -36,12 +37,12 @@ function viewcontacts_init(App $a) {
}
}
-
-function viewcontacts_content(App $a) {
+function viewcontacts_content(App $a)
+{
require_once("mod/proxy.php");
- if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
- notice( t('Public access denied.') . EOL);
+ if ((Config::get('system', 'block_public')) && (! local_user()) && (! remote_user())) {
+ notice(L10n::t('Public access denied.') . EOL);
return;
}
@@ -50,8 +51,8 @@ function viewcontacts_content(App $a) {
// tabs
$o .= Profile::getTabs($a, $is_owner, $a->data['user']['nickname']);
- if(((! count($a->profile)) || ($a->profile['hide-friends']))) {
- notice( t('Permission denied.') . EOL);
+ if (((! count($a->profile)) || ($a->profile['hide-friends']))) {
+ notice(L10n::t('Permission denied.') . EOL);
return $o;
}
@@ -64,8 +65,9 @@ function viewcontacts_content(App $a) {
dbesc(NETWORK_DIASPORA),
dbesc(NETWORK_OSTATUS)
);
- if (DBM::is_result($r))
+ if (DBM::is_result($r)) {
$a->set_pager_total($r[0]['total']);
+ }
$r = q("SELECT * FROM `contact`
WHERE `uid` = %d AND NOT `blocked` AND NOT `pending`
@@ -80,7 +82,7 @@ function viewcontacts_content(App $a) {
intval($a->pager['itemspage'])
);
if (!DBM::is_result($r)) {
- info(t('No contacts.').EOL);
+ info(L10n::t('No contacts.').EOL);
return $o;
}
@@ -98,19 +100,20 @@ function viewcontacts_content(App $a) {
$is_owner = ((local_user() && ($a->profile['profile_uid'] == local_user())) ? true : false);
- if($is_owner && ($rr['network'] === NETWORK_DFRN) && ($rr['rel']))
+ if ($is_owner && ($rr['network'] === NETWORK_DFRN) && ($rr['rel'])) {
$url = 'redir/' . $rr['id'];
- else
+ } else {
$url = Profile::zrl($url);
+ }
$contact_details = Contact::getDetailsByURL($rr['url'], $a->profile['uid'], $rr);
$contacts[] = [
'id' => $rr['id'],
- 'img_hover' => sprintf( t('Visit %s\'s profile [%s]'), $contact_details['name'], $rr['url']),
+ 'img_hover' => L10n::t('Visit %s\'s profile [%s]', $contact_details['name'], $rr['url']),
'photo_menu' => Contact::photoMenu($rr),
'thumb' => proxy_url($contact_details['thumb'], false, PROXY_SIZE_THUMB),
- 'name' => htmlentities(substr($contact_details['name'],0,20)),
+ 'name' => htmlentities(substr($contact_details['name'], 0, 20)),
'username' => htmlentities($contact_details['name']),
'details' => $contact_details['location'],
'tags' => $contact_details['keywords'],
@@ -126,7 +129,7 @@ function viewcontacts_content(App $a) {
$tpl = get_markup_template("viewcontact_template.tpl");
$o .= replace_macros($tpl, [
- '$title' => t('Contacts'),
+ '$title' => L10n::t('Contacts'),
'$contacts' => $contacts,
'$paginate' => paginate($a),
]);
diff --git a/mod/viewsrc.php b/mod/viewsrc.php
index a60749844..376e2ef68 100644
--- a/mod/viewsrc.php
+++ b/mod/viewsrc.php
@@ -1,12 +1,15 @@
error = 404;
- notice( t('Item not found.') . EOL);
+ notice(L10n::t('Item not found.') . EOL);
return;
}
diff --git a/mod/wall_attach.php b/mod/wall_attach.php
index 472a80732..57d7b2e95 100644
--- a/mod/wall_attach.php
+++ b/mod/wall_attach.php
@@ -4,6 +4,7 @@
*/
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Util\Mimetype;
@@ -20,7 +21,7 @@ function wall_attach_post(App $a) {
);
if (! DBM::is_result($r)) {
if ($r_json) {
- echo json_encode(['error'=>t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme();
}
return;
@@ -28,7 +29,7 @@ function wall_attach_post(App $a) {
} else {
if ($r_json) {
- echo json_encode(['error'=>t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme();
}
return;
@@ -70,16 +71,16 @@ function wall_attach_post(App $a) {
}
if(! $can_post) {
if ($r_json) {
- echo json_encode(['error'=>t('Permission denied.')]);
+ echo json_encode(['error'=>L10n::t('Permission denied.')]);
killme();
}
- notice( t('Permission denied.') . EOL );
+ notice(L10n::t('Permission denied.') . EOL );
killme();
}
if(! x($_FILES,'userfile')) {
if ($r_json) {
- echo json_encode(['error'=>t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
}
killme();
}
@@ -97,7 +98,7 @@ function wall_attach_post(App $a) {
*/
if($filesize <=0) {
- $msg = t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(t('Or - did you try to upload an empty file?'));
+ $msg = L10n::t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(L10n::t('Or - did you try to upload an empty file?'));
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
@@ -108,7 +109,7 @@ function wall_attach_post(App $a) {
}
if(($maxfilesize) && ($filesize > $maxfilesize)) {
- $msg = sprintf(t('File exceeds size limit of %s'), formatBytes($maxfilesize));
+ $msg = L10n::t('File exceeds size limit of %s', formatBytes($maxfilesize));
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
@@ -132,7 +133,7 @@ function wall_attach_post(App $a) {
@unlink($src);
if(! $r) {
- $msg = t('File upload failed.');
+ $msg = L10n::t('File upload failed.');
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
@@ -148,7 +149,7 @@ function wall_attach_post(App $a) {
);
if (! DBM::is_result($r)) {
- $msg = t('File upload failed.');
+ $msg = L10n::t('File upload failed.');
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
diff --git a/mod/wall_upload.php b/mod/wall_upload.php
index 8708390e9..821fdc2a9 100644
--- a/mod/wall_upload.php
+++ b/mod/wall_upload.php
@@ -1,5 +1,4 @@
t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme();
}
return;
@@ -51,7 +51,7 @@ function wall_upload_post(App $a, $desktopmode = true) {
}
} else {
if ($r_json) {
- echo json_encode(['error'=>t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme();
}
return;
@@ -100,16 +100,16 @@ function wall_upload_post(App $a, $desktopmode = true) {
if (! $can_post) {
if ($r_json) {
- echo json_encode(['error'=>t('Permission denied.')]);
+ echo json_encode(['error'=>L10n::t('Permission denied.')]);
killme();
}
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
killme();
}
if (! x($_FILES, 'userfile') && ! x($_FILES, 'media')) {
if ($r_json) {
- echo json_encode(['error'=>t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
}
killme();
}
@@ -149,10 +149,10 @@ function wall_upload_post(App $a, $desktopmode = true) {
if ($src=="") {
if ($r_json) {
- echo json_encode(['error'=>t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme();
}
- notice(t('Invalid request.').EOL);
+ notice(L10n::t('Invalid request.').EOL);
killme();
}
@@ -180,7 +180,7 @@ function wall_upload_post(App $a, $desktopmode = true) {
$maximagesize = Config::get('system', 'maximagesize');
if (($maximagesize) && ($filesize > $maximagesize)) {
- $msg = sprintf(t('Image exceeds size limit of %s'), formatBytes($maximagesize));
+ $msg = L10n::t('Image exceeds size limit of %s', formatBytes($maximagesize));
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
@@ -194,7 +194,7 @@ function wall_upload_post(App $a, $desktopmode = true) {
$Image = new Image($imagedata, $filetype);
if (! $Image->isValid()) {
- $msg = t('Unable to process image.');
+ $msg = L10n::t('Unable to process image.');
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
@@ -225,7 +225,7 @@ function wall_upload_post(App $a, $desktopmode = true) {
// If we don't have an album name use the Wall Photos album
if (! strlen($album)) {
- $album = t('Wall Photos');
+ $album = L10n::t('Wall Photos');
}
$defperm = '<' . $default_cid . '>';
@@ -233,7 +233,7 @@ function wall_upload_post(App $a, $desktopmode = true) {
$r = Photo::store($Image, $page_owner_uid, $visitor, $hash, $filename, $album, 0, 0, $defperm);
if (! $r) {
- $msg = t('Image upload failed.');
+ $msg = L10n::t('Image upload failed.');
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
diff --git a/mod/wallmessage.php b/mod/wallmessage.php
index 547290ca9..250b7d70d 100644
--- a/mod/wallmessage.php
+++ b/mod/wallmessage.php
@@ -3,6 +3,7 @@
* @file mod/wallmessage.php
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Mail;
@@ -11,8 +12,8 @@ use Friendica\Model\Profile;
function wallmessage_post(App $a) {
$replyto = Profile::getMyURL();
- if(! $replyto) {
- notice( t('Permission denied.') . EOL);
+ if (!$replyto) {
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
@@ -20,7 +21,7 @@ function wallmessage_post(App $a) {
$body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : '');
$recipient = (($a->argc > 1) ? notags($a->argv[1]) : '');
- if((! $recipient) || (! $body)) {
+ if ((! $recipient) || (! $body)) {
return;
}
@@ -35,8 +36,8 @@ function wallmessage_post(App $a) {
$user = $r[0];
- if(! intval($user['unkmail'])) {
- notice( t('Permission denied.') . EOL);
+ if (! intval($user['unkmail'])) {
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
@@ -44,46 +45,45 @@ function wallmessage_post(App $a) {
intval($user['uid'])
);
- if($r[0]['total'] > $user['cntunkmail']) {
- notice( sprintf( t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])));
+ if ($r[0]['total'] > $user['cntunkmail']) {
+ notice(L10n::t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
return;
}
$ret = Mail::sendWall($user, $body, $subject, $replyto);
- switch($ret){
+ switch ($ret) {
case -1:
- notice( t('No recipient selected.') . EOL );
+ notice(L10n::t('No recipient selected.') . EOL);
break;
case -2:
- notice( t('Unable to check your home location.') . EOL );
+ notice(L10n::t('Unable to check your home location.') . EOL);
break;
case -3:
- notice( t('Message could not be sent.') . EOL );
+ notice(L10n::t('Message could not be sent.') . EOL);
break;
case -4:
- notice( t('Message collection failure.') . EOL );
+ notice(L10n::t('Message collection failure.') . EOL);
break;
default:
- info( t('Message sent.') . EOL );
+ info(L10n::t('Message sent.') . EOL);
}
goaway('profile/'.$user['nickname']);
-
}
function wallmessage_content(App $a) {
if (!Profile::getMyURL()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
$recipient = (($a->argc > 1) ? $a->argv[1] : '');
- if(! $recipient) {
- notice( t('No recipient.') . EOL);
+ if (!$recipient) {
+ notice(L10n::t('No recipient.') . EOL);
return;
}
@@ -92,15 +92,15 @@ function wallmessage_content(App $a) {
);
if (! DBM::is_result($r)) {
- notice( t('No recipient.') . EOL);
+ notice(L10n::t('No recipient.') . EOL);
logger('wallmessage: no recipient');
return;
}
$user = $r[0];
- if(! intval($user['unkmail'])) {
- notice( t('Permission denied.') . EOL);
+ if (!intval($user['unkmail'])) {
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
@@ -108,8 +108,8 @@ function wallmessage_content(App $a) {
intval($user['uid'])
);
- if($r[0]['total'] > $user['cntunkmail']) {
- notice( sprintf( t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])));
+ if ($r[0]['total'] > $user['cntunkmail']) {
+ notice(L10n::t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
return;
}
@@ -117,33 +117,33 @@ function wallmessage_content(App $a) {
$a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $user['nickname'],
- '$linkurl' => t('Please enter a link URL:')
+ '$linkurl' => L10n::t('Please enter a link URL:')
]);
$tpl = get_markup_template('wallmsg-end.tpl');
$a->page['end'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $user['nickname'],
- '$linkurl' => t('Please enter a link URL:')
+ '$linkurl' => L10n::t('Please enter a link URL:')
]);
$tpl = get_markup_template('wallmessage.tpl');
- $o .= replace_macros($tpl,[
- '$header' => t('Send Private Message'),
- '$subheader' => sprintf( t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.'), $user['username']),
- '$to' => t('To:'),
- '$subject' => t('Subject:'),
+ $o .= replace_macros($tpl, [
+ '$header' => L10n::t('Send Private Message'),
+ '$subheader' => L10n::t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.', $user['username']),
+ '$to' => L10n::t('To:'),
+ '$subject' => L10n::t('Subject:'),
'$recipname' => $user['username'],
'$nickname' => $user['nickname'],
- '$subjtxt' => ((x($_REQUEST,'subject')) ? strip_tags($_REQUEST['subject']) : ''),
- '$text' => ((x($_REQUEST,'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''),
+ '$subjtxt' => ((x($_REQUEST, 'subject')) ? strip_tags($_REQUEST['subject']) : ''),
+ '$text' => ((x($_REQUEST, 'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''),
'$readonly' => '',
- '$yourmessage' => t('Your message:'),
+ '$yourmessage' => L10n::t('Your message:'),
'$select' => $select,
'$parent' => '',
- '$upload' => t('Upload photo'),
- '$insert' => t('Insert web link'),
- '$wait' => t('Please wait')
+ '$upload' => L10n::t('Upload photo'),
+ '$insert' => L10n::t('Insert web link'),
+ '$wait' => L10n::t('Please wait')
]);
return $o;
diff --git a/mod/webfinger.php b/mod/webfinger.php
index 85d3b3120..3e205ec03 100644
--- a/mod/webfinger.php
+++ b/mod/webfinger.php
@@ -1,14 +1,21 @@
t("Public access denied."),
- "description" => t("Only logged in users are permitted to perform a probing.")]);
+ http_status_exit(
+ 403,
+ [
+ "title" => L10n::t("Public access denied."),
+ "description" => L10n::t("Only logged in users are permitted to perform a probing.")
+ ]
+ );
killme();
}
@@ -20,11 +27,11 @@ function webfinger_content(App $a) {
$o .= '
';
- if(x($_GET,'addr')) {
+ if (x($_GET, 'addr')) {
$addr = trim($_GET['addr']);
$res = Probe::lrdd($addr);
$o .= '
';
- $o .= str_replace("\n",' ',print_r($res,true));
+ $o .= str_replace("\n", ' ', print_r($res, true));
$o .= ' ';
}
return $o;
diff --git a/src/App.php b/src/App.php
index 2a134a9c1..7c87130b3 100644
--- a/src/App.php
+++ b/src/App.php
@@ -1,9 +1,12 @@
$this->get_baseurl(),
'$local_user' => local_user(),
'$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
- '$delitem' => t('Delete this item?'),
- '$showmore' => t('show more'),
- '$showfewer' => t('show fewer'),
+ '$delitem' => L10n::t('Delete this item?'),
+ '$showmore' => L10n::t('show more'),
+ '$showfewer' => L10n::t('show fewer'),
'$update_interval' => $interval,
'$shortcut_icon' => $shortcut_icon,
'$touch_icon' => $touch_icon,
diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php
index fcaafb898..b5122da80 100644
--- a/src/Content/ContactSelector.php
+++ b/src/Content/ContactSelector.php
@@ -5,6 +5,7 @@
namespace Friendica\Content;
use Friendica\Core\Addon;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Protocol\Diaspora;
use dba;
@@ -51,12 +52,12 @@ class ContactSelector
$o .= "
" . "\r\n";
$rep = [
- 0 => t('Frequently'),
- 1 => t('Hourly'),
- 2 => t('Twice daily'),
- 3 => t('Daily'),
- 4 => t('Weekly'),
- 5 => t('Monthly')
+ 0 => L10n::t('Frequently'),
+ 1 => L10n::t('Hourly'),
+ 2 => L10n::t('Twice daily'),
+ 3 => L10n::t('Daily'),
+ 4 => L10n::t('Weekly'),
+ 5 => L10n::t('Monthly')
];
foreach ($rep as $k => $v) {
@@ -75,23 +76,23 @@ class ContactSelector
public static function networkToName($s, $profile = "")
{
$nets = [
- NETWORK_DFRN => t('Friendica'),
- NETWORK_OSTATUS => t('OStatus'),
- NETWORK_FEED => t('RSS/Atom'),
- NETWORK_MAIL => t('Email'),
- NETWORK_DIASPORA => t('Diaspora'),
- NETWORK_FACEBOOK => t('Facebook'),
- NETWORK_ZOT => t('Zot!'),
- NETWORK_LINKEDIN => t('LinkedIn'),
- NETWORK_XMPP => t('XMPP/IM'),
- NETWORK_MYSPACE => t('MySpace'),
- NETWORK_GPLUS => t('Google+'),
- NETWORK_PUMPIO => t('pump.io'),
- NETWORK_TWITTER => t('Twitter'),
- NETWORK_DIASPORA2 => t('Diaspora Connector'),
- NETWORK_STATUSNET => t('GNU Social Connector'),
- NETWORK_PNUT => t('pnut'),
- NETWORK_APPNET => t('App.net')
+ NETWORK_DFRN => L10n::t('Friendica'),
+ NETWORK_OSTATUS => L10n::t('OStatus'),
+ NETWORK_FEED => L10n::t('RSS/Atom'),
+ NETWORK_MAIL => L10n::t('Email'),
+ NETWORK_DIASPORA => L10n::t('Diaspora'),
+ NETWORK_FACEBOOK => L10n::t('Facebook'),
+ NETWORK_ZOT => L10n::t('Zot!'),
+ NETWORK_LINKEDIN => L10n::t('LinkedIn'),
+ NETWORK_XMPP => L10n::t('XMPP/IM'),
+ NETWORK_MYSPACE => L10n::t('MySpace'),
+ NETWORK_GPLUS => L10n::t('Google+'),
+ NETWORK_PUMPIO => L10n::t('pump.io'),
+ NETWORK_TWITTER => L10n::t('Twitter'),
+ NETWORK_DIASPORA2 => L10n::t('Diaspora Connector'),
+ NETWORK_STATUSNET => L10n::t('GNU Social Connector'),
+ NETWORK_PNUT => L10n::t('pnut'),
+ NETWORK_APPNET => L10n::t('App.net')
];
Addon::callHooks('network_to_name', $nets);
@@ -121,7 +122,7 @@ class ContactSelector
public static function gender($current = "", $suffix = "")
{
$o = '';
- $select = ['', t('Male'), t('Female'), t('Currently Male'), t('Currently Female'), t('Mostly Male'), t('Mostly Female'), t('Transgender'), t('Intersex'), t('Transsexual'), t('Hermaphrodite'), t('Neuter'), t('Non-specific'), t('Other'), t('Undecided')];
+ $select = ['', L10n::t('Male'), L10n::t('Female'), L10n::t('Currently Male'), L10n::t('Currently Female'), L10n::t('Mostly Male'), L10n::t('Mostly Female'), L10n::t('Transgender'), L10n::t('Intersex'), L10n::t('Transsexual'), L10n::t('Hermaphrodite'), L10n::t('Neuter'), L10n::t('Non-specific'), L10n::t('Other'), L10n::t('Undecided')];
Addon::callHooks('gender_selector', $select);
@@ -143,7 +144,7 @@ class ContactSelector
public static function sexualPreference($current = "", $suffix = "")
{
$o = '';
- $select = ['', t('Males'), t('Females'), t('Gay'), t('Lesbian'), t('No Preference'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Deviant'), t('Fetish'), t('Oodles'), t('Nonsexual')];
+ $select = ['', L10n::t('Males'), L10n::t('Females'), L10n::t('Gay'), L10n::t('Lesbian'), L10n::t('No Preference'), L10n::t('Bisexual'), L10n::t('Autosexual'), L10n::t('Abstinent'), L10n::t('Virgin'), L10n::t('Deviant'), L10n::t('Fetish'), L10n::t('Oodles'), L10n::t('Nonsexual')];
Addon::callHooks('sexpref_selector', $select);
@@ -165,7 +166,7 @@ class ContactSelector
public static function maritalStatus($current = "")
{
$o = '';
- $select = ['', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Has crush'), t('Infatuated'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Imaginarily married'), t('Partners'), t('Cohabiting'), t('Common law'), t('Happy'), t('Not looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Imaginarily divorced'), t('Widowed'), t('Uncertain'), t('It\'s complicated'), t('Don\'t care'), t('Ask me')];
+ $select = ['', L10n::t('Single'), L10n::t('Lonely'), L10n::t('Available'), L10n::t('Unavailable'), L10n::t('Has crush'), L10n::t('Infatuated'), L10n::t('Dating'), L10n::t('Unfaithful'), L10n::t('Sex Addict'), L10n::t('Friends'), L10n::t('Friends/Benefits'), L10n::t('Casual'), L10n::t('Engaged'), L10n::t('Married'), L10n::t('Imaginarily married'), L10n::t('Partners'), L10n::t('Cohabiting'), L10n::t('Common law'), L10n::t('Happy'), L10n::t('Not looking'), L10n::t('Swinger'), L10n::t('Betrayed'), L10n::t('Separated'), L10n::t('Unstable'), L10n::t('Divorced'), L10n::t('Imaginarily divorced'), L10n::t('Widowed'), L10n::t('Uncertain'), L10n::t('It\'s complicated'), L10n::t('Don\'t care'), L10n::t('Ask me')];
Addon::callHooks('marital_selector', $select);
diff --git a/src/Content/Feature.php b/src/Content/Feature.php
index 47b72dce3..71b186034 100644
--- a/src/Content/Feature.php
+++ b/src/Content/Feature.php
@@ -7,6 +7,7 @@ namespace Friendica\Content;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
class Feature
@@ -75,56 +76,56 @@ class Feature
// General
'general' => [
- t('General Features'),
- //array('expire', t('Content Expiration'), t('Remove old posts/comments after a period of time')),
- ['multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles'), false, Config::get('feature_lock', 'multi_profiles', false)],
- ['photo_location', t('Photo Location'), t('Photo metadata is normally stripped. This extracts the location (if present) prior to stripping metadata and links it to a map.'), false, Config::get('feature_lock', 'photo_location', false)],
- ['export_calendar', t('Export Public Calendar'), t('Ability for visitors to download the public calendar'), false, Config::get('feature_lock', 'export_calendar', false)],
+ L10n::t('General Features'),
+ //array('expire', L10n::t('Content Expiration'), L10n::t('Remove old posts/comments after a period of time')),
+ ['multi_profiles', L10n::t('Multiple Profiles'), L10n::t('Ability to create multiple profiles'), false, Config::get('feature_lock', 'multi_profiles', false)],
+ ['photo_location', L10n::t('Photo Location'), L10n::t('Photo metadata is normally stripped. This extracts the location (if present) prior to stripping metadata and links it to a map.'), false, Config::get('feature_lock', 'photo_location', false)],
+ ['export_calendar', L10n::t('Export Public Calendar'), L10n::t('Ability for visitors to download the public calendar'), false, Config::get('feature_lock', 'export_calendar', false)],
],
// Post composition
'composition' => [
- t('Post Composition Features'),
- ['preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them'), false, Config::get('feature_lock', 'preview', false)],
- ['aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, Config::get('feature_lock', 'aclautomention', false)],
+ L10n::t('Post Composition Features'),
+ ['preview', L10n::t('Post Preview'), L10n::t('Allow previewing posts and comments before publishing them'), false, Config::get('feature_lock', 'preview', false)],
+ ['aclautomention', L10n::t('Auto-mention Forums'), L10n::t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, Config::get('feature_lock', 'aclautomention', false)],
],
// Network sidebar widgets
'widgets' => [
- t('Network Sidebar Widgets'),
- ['archives', t('Search by Date'), t('Ability to select posts by date ranges'), false, Config::get('feature_lock', 'archives', false)],
- ['forumlist_widget', t('List Forums'), t('Enable widget to display the forums your are connected with'), true, Config::get('feature_lock', 'forumlist_widget', false)],
- ['groups', t('Group Filter'), t('Enable widget to display Network posts only from selected group'), false, Config::get('feature_lock', 'groups', false)],
- ['networks', t('Network Filter'), t('Enable widget to display Network posts only from selected network'), false, Config::get('feature_lock', 'networks', false)],
- ['savedsearch', t('Saved Searches'), t('Save search terms for re-use'), false, Config::get('feature_lock', 'savedsearch', false)],
+ L10n::t('Network Sidebar Widgets'),
+ ['archives', L10n::t('Search by Date'), L10n::t('Ability to select posts by date ranges'), false, Config::get('feature_lock', 'archives', false)],
+ ['forumlist_widget', L10n::t('List Forums'), L10n::t('Enable widget to display the forums your are connected with'), true, Config::get('feature_lock', 'forumlist_widget', false)],
+ ['groups', L10n::t('Group Filter'), L10n::t('Enable widget to display Network posts only from selected group'), false, Config::get('feature_lock', 'groups', false)],
+ ['networks', L10n::t('Network Filter'), L10n::t('Enable widget to display Network posts only from selected network'), false, Config::get('feature_lock', 'networks', false)],
+ ['savedsearch', L10n::t('Saved Searches'), L10n::t('Save search terms for re-use'), false, Config::get('feature_lock', 'savedsearch', false)],
],
// Network tabs
'net_tabs' => [
- t('Network Tabs'),
- ['personal_tab', t('Network Personal Tab'), t('Enable tab to display only Network posts that you\'ve interacted on'), false, Config::get('feature_lock', 'personal_tab', false)],
- ['new_tab', t('Network New Tab'), t('Enable tab to display only new Network posts (from the last 12 hours)'), false, Config::get('feature_lock', 'new_tab', false)],
- ['link_tab', t('Network Shared Links Tab'), t('Enable tab to display only Network posts with links in them'), false, Config::get('feature_lock', 'link_tab', false)],
+ L10n::t('Network Tabs'),
+ ['personal_tab', L10n::t('Network Personal Tab'), L10n::t('Enable tab to display only Network posts that you\'ve interacted on'), false, Config::get('feature_lock', 'personal_tab', false)],
+ ['new_tab', L10n::t('Network New Tab'), L10n::t('Enable tab to display only new Network posts (from the last 12 hours)'), false, Config::get('feature_lock', 'new_tab', false)],
+ ['link_tab', L10n::t('Network Shared Links Tab'), L10n::t('Enable tab to display only Network posts with links in them'), false, Config::get('feature_lock', 'link_tab', false)],
],
// Item tools
'tools' => [
- t('Post/Comment Tools'),
- ['multi_delete', t('Multiple Deletion'), t('Select and delete multiple posts/comments at once'), false, Config::get('feature_lock', 'multi_delete', false)],
- ['edit_posts', t('Edit Sent Posts'), t('Edit and correct posts and comments after sending'), false, Config::get('feature_lock', 'edit_posts', false)],
- ['commtag', t('Tagging'), t('Ability to tag existing posts'), false, Config::get('feature_lock', 'commtag', false)],
- ['categories', t('Post Categories'), t('Add categories to your posts'), false, Config::get('feature_lock', 'categories', false)],
- ['filing', t('Saved Folders'), t('Ability to file posts under folders'), false, Config::get('feature_lock', 'filing', false)],
- ['dislike', t('Dislike Posts'), t('Ability to dislike posts/comments'), false, Config::get('feature_lock', 'dislike', false)],
- ['star_posts', t('Star Posts'), t('Ability to mark special posts with a star indicator'), false, Config::get('feature_lock', 'star_posts', false)],
- ['ignore_posts', t('Mute Post Notifications'), t('Ability to mute notifications for a thread'), false, Config::get('feature_lock', 'ignore_posts', false)],
+ L10n::t('Post/Comment Tools'),
+ ['multi_delete', L10n::t('Multiple Deletion'), L10n::t('Select and delete multiple posts/comments at once'), false, Config::get('feature_lock', 'multi_delete', false)],
+ ['edit_posts', L10n::t('Edit Sent Posts'), L10n::t('Edit and correct posts and comments after sending'), false, Config::get('feature_lock', 'edit_posts', false)],
+ ['commtag', L10n::t('Tagging'), L10n::t('Ability to tag existing posts'), false, Config::get('feature_lock', 'commtag', false)],
+ ['categories', L10n::t('Post Categories'), L10n::t('Add categories to your posts'), false, Config::get('feature_lock', 'categories', false)],
+ ['filing', L10n::t('Saved Folders'), L10n::t('Ability to file posts under folders'), false, Config::get('feature_lock', 'filing', false)],
+ ['dislike', L10n::t('Dislike Posts'), L10n::t('Ability to dislike posts/comments'), false, Config::get('feature_lock', 'dislike', false)],
+ ['star_posts', L10n::t('Star Posts'), L10n::t('Ability to mark special posts with a star indicator'), false, Config::get('feature_lock', 'star_posts', false)],
+ ['ignore_posts', L10n::t('Mute Post Notifications'), L10n::t('Ability to mute notifications for a thread'), false, Config::get('feature_lock', 'ignore_posts', false)],
],
// Advanced Profile Settings
'advanced_profile' => [
- t('Advanced Profile Settings'),
- ['forumlist_profile', t('List Forums'), t('Show visitors public community forums at the Advanced Profile Page'), false, Config::get('feature_lock', 'forumlist_profile', false)],
- ['tagadelic', t('Tag Cloud'), t('Provide a personal tag cloud on your profile page'), false, Config::get('feature_lock', 'tagadelic', false)],
+ L10n::t('Advanced Profile Settings'),
+ ['forumlist_profile', L10n::t('List Forums'), L10n::t('Show visitors public community forums at the Advanced Profile Page'), false, Config::get('feature_lock', 'forumlist_profile', false)],
+ ['tagadelic', L10n::t('Tag Cloud'), L10n::t('Provide a personal tag cloud on your profile page'), false, Config::get('feature_lock', 'tagadelic', false)],
],
];
diff --git a/src/Content/ForumManager.php b/src/Content/ForumManager.php
index 3d84b95a3..4f09b8a11 100644
--- a/src/Content/ForumManager.php
+++ b/src/Content/ForumManager.php
@@ -7,6 +7,7 @@ namespace Friendica\Content;
use Friendica\App;
use Friendica\Content\Feature;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use dba;
@@ -121,12 +122,12 @@ class ForumManager
$o .= replace_macros(
$tpl,
[
- '$title' => t('Forums'),
+ '$title' => L10n::t('Forums'),
'$forums' => $entries,
- '$link_desc' => t('External link to forum'),
+ '$link_desc' => L10n::t('External link to forum'),
'$total' => $total,
'$visible_forums' => $visible_forums,
- '$showmore' => t('show more')]
+ '$showmore' => L10n::t('show more')]
);
}
diff --git a/src/Content/Nav.php b/src/Content/Nav.php
index a9a6eb3d1..c7dfd447c 100644
--- a/src/Content/Nav.php
+++ b/src/Content/Nav.php
@@ -8,6 +8,7 @@ use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
@@ -15,7 +16,6 @@ use dba;
require_once 'boot.php';
require_once 'dba.php';
-require_once 'include/pgettext.php';
require_once 'include/text.php';
class Nav
@@ -50,12 +50,12 @@ class Nav
'$sitelocation' => $nav_info['sitelocation'],
'$nav' => $nav_info['nav'],
'$banner' => $nav_info['banner'],
- '$emptynotifications' => t('Nothing new here'),
+ '$emptynotifications' => L10n::t('Nothing new here'),
'$userinfo' => $nav_info['userinfo'],
'$sel' => $a->nav_sel,
'$apps' => $a->apps,
- '$clear_notifs' => t('Clear notifications'),
- '$search_hint' => t('@name, !forum, #tags, content')
+ '$clear_notifs' => L10n::t('Clear notifications'),
+ '$search_hint' => L10n::t('@name, !forum, #tags, content')
]);
Addon::callHooks('page_header', $a->page['nav']);
@@ -94,15 +94,15 @@ class Nav
$userinfo = null;
if (local_user()) {
- $nav['logout'] = ['logout', t('Logout'), '', t('End this session')];
+ $nav['logout'] = ['logout', L10n::t('Logout'), '', L10n::t('End this session')];
// user menu
- $nav['usermenu'][] = ['profile/' . $a->user['nickname'], t('Status'), '', t('Your posts and conversations')];
- $nav['usermenu'][] = ['profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), '', t('Your profile page')];
- $nav['usermenu'][] = ['photos/' . $a->user['nickname'], t('Photos'), '', t('Your photos')];
- $nav['usermenu'][] = ['videos/' . $a->user['nickname'], t('Videos'), '', t('Your videos')];
- $nav['usermenu'][] = ['events/', t('Events'), '', t('Your events')];
- $nav['usermenu'][] = ['notes/', t('Personal notes'), '', t('Your personal notes')];
+ $nav['usermenu'][] = ['profile/' . $a->user['nickname'], L10n::t('Status'), '', L10n::t('Your posts and conversations')];
+ $nav['usermenu'][] = ['profile/' . $a->user['nickname'] . '?tab=profile', L10n::t('Profile'), '', L10n::t('Your profile page')];
+ $nav['usermenu'][] = ['photos/' . $a->user['nickname'], L10n::t('Photos'), '', L10n::t('Your photos')];
+ $nav['usermenu'][] = ['videos/' . $a->user['nickname'], L10n::t('Videos'), '', L10n::t('Your videos')];
+ $nav['usermenu'][] = ['events/', L10n::t('Events'), '', L10n::t('Your events')];
+ $nav['usermenu'][] = ['notes/', L10n::t('Personal notes'), '', L10n::t('Your personal notes')];
// user info
$contact = dba::selectFirst('contact', ['micro'], ['uid' => $a->user['uid'], 'self' => true]);
@@ -111,7 +111,7 @@ class Nav
'name' => $a->user['username'],
];
} else {
- $nav['login'] = ['login', t('Login'), ($a->module == 'login' ? 'selected' : ''), t('Sign in')];
+ $nav['login'] = ['login', L10n::t('Login'), ($a->module == 'login' ? 'selected' : ''), L10n::t('Sign in')];
}
// "Home" should also take you home from an authenticated remote profile connection
@@ -121,34 +121,34 @@ class Nav
}
if (($a->module != 'home') && (! (local_user()))) {
- $nav['home'] = [$homelink, t('Home'), '', t('Home Page')];
+ $nav['home'] = [$homelink, L10n::t('Home'), '', L10n::t('Home Page')];
}
if (($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user())) {
- $nav['register'] = ['register', t('Register'), '', t('Create an account')];
+ $nav['register'] = ['register', L10n::t('Register'), '', L10n::t('Create an account')];
}
$help_url = 'help';
if (!Config::get('system', 'hide_help')) {
- $nav['help'] = [$help_url, t('Help'), '', t('Help and documentation')];
+ $nav['help'] = [$help_url, L10n::t('Help'), '', L10n::t('Help and documentation')];
}
if (count($a->apps) > 0) {
- $nav['apps'] = ['apps', t('Apps'), '', t('Addon applications, utilities, games')];
+ $nav['apps'] = ['apps', L10n::t('Apps'), '', L10n::t('Addon applications, utilities, games')];
}
if (local_user() || !Config::get('system', 'local_search')) {
- $nav['search'] = ['search', t('Search'), '', t('Search site content')];
+ $nav['search'] = ['search', L10n::t('Search'), '', L10n::t('Search site content')];
$nav['searchoption'] = [
- t('Full Text'),
- t('Tags'),
- t('Contacts')
+ L10n::t('Full Text'),
+ L10n::t('Tags'),
+ L10n::t('Contacts')
];
if (Config::get('system', 'poco_local_search')) {
- $nav['searchoption'][] = t('Forums');
+ $nav['searchoption'][] = L10n::t('Forums');
}
}
@@ -162,62 +162,62 @@ class Nav
}
if (local_user() || Config::get('system', 'community_page_style') != CP_NO_COMMUNITY_PAGE) {
- $nav['community'] = ['community', t('Community'), '', t('Conversations on this and other servers')];
+ $nav['community'] = ['community', L10n::t('Community'), '', L10n::t('Conversations on this and other servers')];
}
if (local_user()) {
- $nav['events'] = ['events', t('Events'), '', t('Events and Calendar')];
+ $nav['events'] = ['events', L10n::t('Events'), '', L10n::t('Events and Calendar')];
}
- $nav['directory'] = [$gdirpath, t('Directory'), '', t('People directory')];
+ $nav['directory'] = [$gdirpath, L10n::t('Directory'), '', L10n::t('People directory')];
- $nav['about'] = ['friendica', t('Information'), '', t('Information about this friendica instance')];
+ $nav['about'] = ['friendica', L10n::t('Information'), '', L10n::t('Information about this friendica instance')];
// The following nav links are only show to logged in users
if (local_user()) {
- $nav['network'] = ['network', t('Network'), '', t('Conversations from your friends')];
- $nav['net_reset'] = ['network/0?f=&order=comment&nets=all', t('Network Reset'), '', t('Load Network page with no filters')];
+ $nav['network'] = ['network', L10n::t('Network'), '', L10n::t('Conversations from your friends')];
+ $nav['net_reset'] = ['network/0?f=&order=comment&nets=all', L10n::t('Network Reset'), '', L10n::t('Load Network page with no filters')];
- $nav['home'] = ['profile/' . $a->user['nickname'], t('Home'), '', t('Your posts and conversations')];
+ $nav['home'] = ['profile/' . $a->user['nickname'], L10n::t('Home'), '', L10n::t('Your posts and conversations')];
if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_PRVGROUP])) {
// only show friend requests for normal pages. Other page types have automatic friendship.
if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_PRVGROUP])) {
- $nav['introductions'] = ['notifications/intros', t('Introductions'), '', t('Friend Requests')];
+ $nav['introductions'] = ['notifications/intros', L10n::t('Introductions'), '', L10n::t('Friend Requests')];
}
if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE])) {
- $nav['notifications'] = ['notifications', t('Notifications'), '', t('Notifications')];
- $nav['notifications']['all'] = ['notifications/system', t('See all notifications'), '', ''];
- $nav['notifications']['mark'] = ['', t('Mark as seen'), '', t('Mark all system notifications seen')];
+ $nav['notifications'] = ['notifications', L10n::t('Notifications'), '', L10n::t('Notifications')];
+ $nav['notifications']['all'] = ['notifications/system', L10n::t('See all notifications'), '', ''];
+ $nav['notifications']['mark'] = ['', L10n::t('Mark as seen'), '', L10n::t('Mark all system notifications seen')];
}
}
- $nav['messages'] = ['message', t('Messages'), '', t('Private mail')];
- $nav['messages']['inbox'] = ['message', t('Inbox'), '', t('Inbox')];
- $nav['messages']['outbox'] = ['message/sent', t('Outbox'), '', t('Outbox')];
- $nav['messages']['new'] = ['message/new', t('New Message'), '', t('New Message')];
+ $nav['messages'] = ['message', L10n::t('Messages'), '', L10n::t('Private mail')];
+ $nav['messages']['inbox'] = ['message', L10n::t('Inbox'), '', L10n::t('Inbox')];
+ $nav['messages']['outbox'] = ['message/sent', L10n::t('Outbox'), '', L10n::t('Outbox')];
+ $nav['messages']['new'] = ['message/new', L10n::t('New Message'), '', L10n::t('New Message')];
if (is_array($a->identities) && count($a->identities) > 1) {
- $nav['manage'] = ['manage', t('Manage'), '', t('Manage other pages')];
+ $nav['manage'] = ['manage', L10n::t('Manage'), '', L10n::t('Manage other pages')];
}
- $nav['delegations'] = ['delegate', t('Delegations'), '', t('Delegate Page Management')];
+ $nav['delegations'] = ['delegate', L10n::t('Delegations'), '', L10n::t('Delegate Page Management')];
- $nav['settings'] = ['settings', t('Settings'), '', t('Account settings')];
+ $nav['settings'] = ['settings', L10n::t('Settings'), '', L10n::t('Account settings')];
if (Feature::isEnabled(local_user(), 'multi_profiles')) {
- $nav['profiles'] = ['profiles', t('Profiles'), '', t('Manage/Edit Profiles')];
+ $nav['profiles'] = ['profiles', L10n::t('Profiles'), '', L10n::t('Manage/Edit Profiles')];
}
- $nav['contacts'] = ['contacts', t('Contacts'), '', t('Manage/edit friends and contacts')];
+ $nav['contacts'] = ['contacts', L10n::t('Contacts'), '', L10n::t('Manage/edit friends and contacts')];
}
// Show the link to the admin configuration page if user is admin
if (is_site_admin()) {
- $nav['admin'] = ['admin/', t('Admin'), '', t('Site setup and configuration')];
+ $nav['admin'] = ['admin/', L10n::t('Admin'), '', L10n::t('Site setup and configuration')];
}
- $nav['navigation'] = ['navigation/', t('Navigation'), '', t('Site map')];
+ $nav['navigation'] = ['navigation/', L10n::t('Navigation'), '', L10n::t('Site map')];
// Provide a banner/logo/whatever
$banner = Config::get('system', 'banner');
diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php
index bcfb23467..9f1df5174 100644
--- a/src/Content/OEmbed.php
+++ b/src/Content/OEmbed.php
@@ -1,13 +1,12 @@
" . t('Embedding disabled') . " : $1 ", $text);
+ return preg_replace("/\[embed\](.+?)\[\/embed\]/is", "
" . L10n::t('Embedding disabled') . " : $1 ", $text);
}
return preg_replace_callback("/\[embed\](.+?)\[\/embed\]/is", ['self', 'replaceCallback'], $text);
}
@@ -367,7 +366,7 @@ class OEmbed
$width = '100%';
$src = System::baseUrl() . '/oembed/' . base64url_encode($src);
- return '
';
+ return '
';
}
/**
diff --git a/src/Content/Widget.php b/src/Content/Widget.php
index 156e9e359..e019de963 100644
--- a/src/Content/Widget.php
+++ b/src/Content/Widget.php
@@ -8,6 +8,7 @@ use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
@@ -28,11 +29,11 @@ class Widget
public static function follow($value = "")
{
return replace_macros(get_markup_template('follow.tpl'), array(
- '$connect' => t('Add New Contact'),
- '$desc' => t('Enter address or web location'),
- '$hint' => t('Example: bob@example.com, http://example.com/barbara'),
+ '$connect' => L10n::t('Add New Contact'),
+ '$desc' => L10n::t('Enter address or web location'),
+ '$hint' => L10n::t('Example: bob@example.com, http://example.com/barbara'),
'$value' => $value,
- '$follow' => t('Connect')
+ '$follow' => L10n::t('Connect')
));
}
@@ -48,22 +49,22 @@ class Widget
$x = PConfig::get(local_user(), 'system', 'invites_remaining');
if ($x || is_site_admin()) {
$a->page['aside'] .= '
'
- . tt('%d invitation available', '%d invitations available', $x)
+ . L10n::tt('%d invitation available', '%d invitations available', $x)
. '
' . $inv;
}
}
return replace_macros(get_markup_template('peoplefind.tpl'), array(
- '$findpeople' => t('Find People'),
- '$desc' => t('Enter name or interest'),
- '$label' => t('Connect/Follow'),
- '$hint' => t('Examples: Robert Morgenstein, Fishing'),
- '$findthem' => t('Find'),
- '$suggest' => t('Friend Suggestions'),
- '$similar' => t('Similar Interests'),
- '$random' => t('Random Profile'),
- '$inv' => t('Invite Friends'),
- '$directory' => t('View Global Directory'),
+ '$findpeople' => L10n::t('Find People'),
+ '$desc' => L10n::t('Enter name or interest'),
+ '$label' => L10n::t('Connect/Follow'),
+ '$hint' => L10n::t('Examples: Robert Morgenstein, Fishing'),
+ '$findthem' => L10n::t('Find'),
+ '$suggest' => L10n::t('Friend Suggestions'),
+ '$similar' => L10n::t('Similar Interests'),
+ '$random' => L10n::t('Random Profile'),
+ '$inv' => L10n::t('Invite Friends'),
+ '$directory' => L10n::t('View Global Directory'),
'$global_dir' => $global_dir
));
}
@@ -154,10 +155,10 @@ class Widget
}
return replace_macros(get_markup_template('nets.tpl'), array(
- '$title' => t('Networks'),
+ '$title' => L10n::t('Networks'),
'$desc' => '',
'$sel_all' => (($selected == '') ? 'selected' : ''),
- '$all' => t('All Networks'),
+ '$all' => L10n::t('All Networks'),
'$nets' => $nets,
'$base' => $baseurl,
));
@@ -195,10 +196,10 @@ class Widget
}
return replace_macros(get_markup_template('fileas_widget.tpl'), array(
- '$title' => t('Saved Folders'),
+ '$title' => L10n::t('Saved Folders'),
'$desc' => '',
'$sel_all' => (($selected == '') ? 'selected' : ''),
- '$all' => t('Everything'),
+ '$all' => L10n::t('Everything'),
'$terms' => $terms,
'$base' => $baseurl,
));
@@ -235,10 +236,10 @@ class Widget
}
return replace_macros(get_markup_template('categories_widget.tpl'), array(
- '$title' => t('Categories'),
+ '$title' => L10n::t('Categories'),
'$desc' => '',
'$sel_all' => (($selected == '') ? 'selected' : ''),
- '$all' => t('Everything'),
+ '$all' => L10n::t('Everything'),
'$terms' => $terms,
'$base' => $baseurl,
));
@@ -302,12 +303,12 @@ class Widget
}
return replace_macros(get_markup_template('remote_friends_common.tpl'), array(
- '$desc' => tt("%d contact in common", "%d contacts in common", $t),
+ '$desc' => L10n::tt("%d contact in common", "%d contacts in common", $t),
'$base' => System::baseUrl(),
'$uid' => $profile_uid,
'$cid' => (($cid) ? $cid : '0'),
'$linkmore' => (($t > 5) ? 'true' : ''),
- '$more' => t('show more'),
+ '$more' => L10n::t('show more'),
'$items' => $r)
);
}
diff --git a/src/Core/L10n.php b/src/Core/L10n.php
new file mode 100644
index 000000000..215c6f6fb
--- /dev/null
+++ b/src/Core/L10n.php
@@ -0,0 +1,244 @@
+3) {
+ $dashpos = strpos($lang_parse[1][$i], '-');
+ if (!in_array(substr($lang_parse[1][$i], 0, $dashpos), $lang_list)) {
+ $lang_list[] = strtolower(substr($lang_parse[1][$i], 0, $dashpos));
+ }
+ }
+ }
+ }
+ }
+
+ // check if we have translations for the preferred languages and pick the 1st that has
+ foreach ($lang_list as $lang) {
+ if ($lang === 'en' || (file_exists("view/lang/$lang") && is_dir("view/lang/$lang"))) {
+ $preferred = $lang;
+ break;
+ }
+ }
+ if (isset($preferred)) {
+ return $preferred;
+ }
+
+ // in case none matches, get the system wide configured language, or fall back to English
+ return Config::get('system', 'language', 'en');
+ }
+
+ /**
+ * @param string $language language
+ */
+ public static function pushLang($language)
+ {
+ global $lang, $a;
+
+ $a->langsave = $lang;
+
+ if ($language === $lang) {
+ return;
+ }
+
+ if (isset($a->strings) && count($a->strings)) {
+ $a->stringsave = $a->strings;
+ }
+ $a->strings = [];
+ self::loadTranslationTable($language);
+ $lang = $language;
+ }
+
+ /**
+ * Pop language off the top of the stack
+ */
+ public static function popLang()
+ {
+ global $lang, $a;
+
+ if ($lang === $a->langsave) {
+ return;
+ }
+
+ if (isset($a->stringsave)) {
+ $a->strings = $a->stringsave;
+ } else {
+ $a->strings = [];
+ }
+
+ $lang = $a->langsave;
+ }
+
+ /**
+ * load string translation table for alternate language
+ *
+ * first addon strings are loaded, then globals
+ *
+ * @param string $lang language code to load
+ */
+ public static function loadTranslationTable($lang)
+ {
+ $a = get_app();
+
+ $a->strings = [];
+ // load enabled addons strings
+ $addons = dba::select('addon', ['name'], ['installed' => true]);
+ while ($p = dba::fetch($addons)) {
+ $name = $p['name'];
+ if (file_exists("addon/$name/lang/$lang/strings.php")) {
+ include "addon/$name/lang/$lang/strings.php";
+ }
+ }
+
+ if (file_exists("view/lang/$lang/strings.php")) {
+ include "view/lang/$lang/strings.php";
+ }
+ }
+
+ /**
+ * @brief Return the localized version of the provided string with optional string interpolation
+ *
+ * This function takes a english string as parameter, and if a localized version
+ * exists for the current language, substitutes it before performing an eventual
+ * string interpolation (sprintf) with additional optional arguments.
+ *
+ * Usages:
+ * - L10n::t('This is an example')
+ * - L10n::t('URL %s returned no result', $url)
+ * - L10n::t('Current version: %s, new version: %s', $current_version, $new_version)
+ *
+ * @param string $s
+ * @return string
+ */
+ public static function t($s)
+ {
+ $a = get_app();
+
+ if (x($a->strings, $s)) {
+ $t = $a->strings[$s];
+ $s = is_array($t) ? $t[0] : $t;
+ }
+ if (func_num_args() > 1) {
+ $args = array_slice(func_get_args(), 1);
+ $s = @vsprintf($s, $args);
+ }
+
+ return $s;
+ }
+
+ /**
+ * @brief Return the localized version of a singular/plural string with optional string interpolation
+ *
+ * This function takes two english strings as parameters, singular and plural, as
+ * well as a count. If a localized version exists for the current language, they
+ * are used instead. Discrimination between singular and plural is done using the
+ * localized function if any or the default one. Finally, a string interpolation
+ * is performed using the count as parameter.
+ *
+ * Usages:
+ * - L10n::tt('Like', 'Likes', $count)
+ * - L10n::tt("%s user deleted", "%s users deleted", count($users))
+ *
+ * @global type $lang
+ * @param string $singular
+ * @param string $plural
+ * @param int $count
+ * @return string
+ */
+ public static function tt($singular, $plural, $count)
+ {
+ global $lang;
+ $a = get_app();
+
+ if (x($a->strings, $singular)) {
+ $t = $a->strings[$singular];
+ if (is_array($t)) {
+ $plural_function = 'string_plural_select_' . str_replace('-', '_', $lang);
+ if (function_exists($plural_function)) {
+ $i = $plural_function($count);
+ } else {
+ $i = self::stringPluralSelectDefault($count);
+ }
+ $s = $t[$i];
+ } else {
+ $s = $t;
+ }
+ } elseif (self::stringPluralSelectDefault($count)) {
+ $s = $plural;
+ } else {
+ $s = $singular;
+ }
+
+ $s = @sprintf($s, $count);
+
+ return $s;
+ }
+
+ /**
+ * Provide a fallback which will not collide with a function defined in any language file
+ */
+ private static function stringPluralSelectDefault($n)
+ {
+ return $n != 1;
+ }
+
+
+
+ /**
+ * @brief Return installed languages codes as associative array
+ *
+ * Scans the view/lang directory for the existence of "strings.php" files, and
+ * returns an alphabetical list of their folder names (@-char language codes).
+ * Adds the english language if it's missing from the list.
+ *
+ * Ex: array('de' => 'de', 'en' => 'en', 'fr' => 'fr', ...)
+ *
+ * @return array
+ */
+ public static function getAvailableLanguages()
+ {
+ $langs = [];
+ $strings_file_paths = glob('view/lang/*/strings.php');
+
+ if (is_array($strings_file_paths) && count($strings_file_paths)) {
+ if (!in_array('view/lang/en/strings.php', $strings_file_paths)) {
+ $strings_file_paths[] = 'view/lang/en/strings.php';
+ }
+ asort($strings_file_paths);
+ foreach ($strings_file_paths as $strings_file_path) {
+ $path_array = explode('/', $strings_file_path);
+ $langs[$path_array[2]] = $path_array[2];
+ }
+ }
+ return $langs;
+ }
+}
diff --git a/src/Core/NotificationsManager.php b/src/Core/NotificationsManager.php
index f78e99db5..e88b4218b 100644
--- a/src/Core/NotificationsManager.php
+++ b/src/Core/NotificationsManager.php
@@ -1,14 +1,13 @@
t('System'),
+ 'label' => L10n::t('System'),
'url' => 'notifications/system',
'sel' => ((self::getApp()->argv[1] == 'system') ? 'active' : ''),
'id' => 'system-tab',
'accesskey' => 'y',
],
[
- 'label' => t('Network'),
+ 'label' => L10n::t('Network'),
'url' => 'notifications/network',
'sel' => ((self::getApp()->argv[1] == 'network') ? 'active' : ''),
'id' => 'network-tab',
'accesskey' => 'w',
],
[
- 'label' => t('Personal'),
+ 'label' => L10n::t('Personal'),
'url' => 'notifications/personal',
'sel' => ((self::getApp()->argv[1] == 'personal') ? 'active' : ''),
'id' => 'personal-tab',
'accesskey' => 'r',
],
[
- 'label' => t('Home'),
+ 'label' => L10n::t('Home'),
'url' => 'notifications/home',
'sel' => ((self::getApp()->argv[1] == 'home') ? 'active' : ''),
'id' => 'home-tab',
'accesskey' => 'h',
],
[
- 'label' => t('Introductions'),
+ 'label' => L10n::t('Introductions'),
'url' => 'notifications/intros',
'sel' => ((self::getApp()->argv[1] == 'intros') ? 'active' : ''),
'id' => 'intro-tab',
@@ -252,7 +251,7 @@ class NotificationsManager extends BaseObject
$default_item_link = System::baseUrl(true) . '/display/' . $it['pguid'];
$default_item_image = proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO);
$default_item_url = $it['author-link'];
- $default_item_text = sprintf(t("%s commented on %s's post"), $it['author-name'], $it['pname']);
+ $default_item_text = L10n::t("%s commented on %s's post", $it['author-name'], $it['pname']);
$default_item_when = datetime_convert('UTC', date_default_timezone_get(), $it['created'], 'r');
$default_item_ago = relative_date($it['created']);
break;
@@ -263,8 +262,8 @@ class NotificationsManager extends BaseObject
$default_item_image = proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO);
$default_item_url = $it['author-link'];
$default_item_text = (($it['id'] == $it['parent'])
- ? sprintf(t("%s created a new post"), $it['author-name'])
- : sprintf(t("%s commented on %s's post"), $it['author-name'], $it['pname']));
+ ? L10n::t("%s created a new post", $it['author-name'])
+ : L10n::t("%s commented on %s's post", $it['author-name'], $it['pname']));
$default_item_when = datetime_convert('UTC', date_default_timezone_get(), $it['created'], 'r');
$default_item_ago = relative_date($it['created']);
}
@@ -277,7 +276,7 @@ class NotificationsManager extends BaseObject
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'],
- 'text' => sprintf(t("%s liked %s's post"), $it['author-name'], $it['pname']),
+ 'text' => L10n::t("%s liked %s's post", $it['author-name'], $it['pname']),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
@@ -290,7 +289,7 @@ class NotificationsManager extends BaseObject
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'],
- 'text' => sprintf(t("%s disliked %s's post"), $it['author-name'], $it['pname']),
+ 'text' => L10n::t("%s disliked %s's post", $it['author-name'], $it['pname']),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
@@ -303,7 +302,7 @@ class NotificationsManager extends BaseObject
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'],
- 'text' => sprintf(t("%s is attending %s's event"), $it['author-name'], $it['pname']),
+ 'text' => L10n::t("%s is attending %s's event", $it['author-name'], $it['pname']),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
@@ -316,7 +315,7 @@ class NotificationsManager extends BaseObject
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'],
- 'text' => sprintf(t("%s is not attending %s's event"), $it['author-name'], $it['pname']),
+ 'text' => L10n::t("%s is not attending %s's event", $it['author-name'], $it['pname']),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
@@ -329,7 +328,7 @@ class NotificationsManager extends BaseObject
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'],
- 'text' => sprintf(t("%s may attend %s's event"), $it['author-name'], $it['pname']),
+ 'text' => L10n::t("%s may attend %s's event", $it['author-name'], $it['pname']),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
@@ -346,7 +345,7 @@ class NotificationsManager extends BaseObject
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'],
- 'text' => sprintf(t("%s is now friends with %s"), $it['author-name'], $it['fname']),
+ 'text' => L10n::t("%s is now friends with %s", $it['author-name'], $it['fname']),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
@@ -809,7 +808,7 @@ class NotificationsManager extends BaseObject
$intro = [
'label' => 'friend_suggestion',
- 'notify_type' => t('Friend Suggestion'),
+ 'notify_type' => L10n::t('Friend Suggestion'),
'intro_id' => $it['intro_id'],
'madeby' => $it['name'],
'contact_id' => $it['contact-id'],
@@ -835,7 +834,7 @@ class NotificationsManager extends BaseObject
}
$intro = [
'label' => (($it['network'] !== NETWORK_OSTATUS) ? 'friend_request' : 'follower'),
- 'notify_type' => (($it['network'] !== NETWORK_OSTATUS) ? t('Friend/Connect Request') : t('New Follower')),
+ 'notify_type' => (($it['network'] !== NETWORK_OSTATUS) ? L10n::t('Friend/Connect Request') : L10n::t('New Follower')),
'dfrn_id' => $it['issued-id'],
'uid' => $_SESSION['uid'],
'intro_id' => $it['intro_id'],
diff --git a/src/Core/UserImport.php b/src/Core/UserImport.php
index f3170c715..582f4d0c3 100644
--- a/src/Core/UserImport.php
+++ b/src/Core/UserImport.php
@@ -5,6 +5,7 @@
namespace Friendica\Core;
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\PConfig;
use Friendica\Core\Worker;
@@ -100,13 +101,13 @@ class UserImport
$account = json_decode(file_get_contents($file['tmp_name']), true);
if ($account === null) {
- notice(t("Error decoding account file"));
+ notice(L10n::t("Error decoding account file"));
return;
}
if (!x($account, 'version')) {
- notice(t("Error! No version data in file! This is not a Friendica account file?"));
+ notice(L10n::t("Error! No version data in file! This is not a Friendica account file?"));
return;
}
@@ -114,12 +115,12 @@ class UserImport
$r = dba::selectFirst('user', ['uid'], ['nickname' => $account['user']['nickname']]);
if ($r === false) {
logger("uimport:check nickname : ERROR : " . dba::errorMessage(), LOGGER_NORMAL);
- notice(t('Error! Cannot check nickname'));
+ notice(L10n::t('Error! Cannot check nickname'));
return;
}
if (DBM::is_result($r) > 0) {
- notice(sprintf(t("User '%s' already exists on this server!"), $account['user']['nickname']));
+ notice(L10n::t("User '%s' already exists on this server!", $account['user']['nickname']));
return;
}
@@ -127,12 +128,12 @@ class UserImport
$r = dba::selectFirst('userd', ['id'], ['username' => $account['user']['nickname']]);
if ($r === false) {
logger("uimport:check nickname : ERROR : " . dba::errorMessage(), LOGGER_NORMAL);
- notice(t('Error! Cannot check nickname'));
+ notice(L10n::t('Error! Cannot check nickname'));
return;
}
if (DBM::is_result($r) > 0) {
- notice(sprintf(t("User '%s' already exists on this server!"), $account['user']['nickname']));
+ notice(L10n::t("User '%s' already exists on this server!", $account['user']['nickname']));
return;
}
@@ -165,7 +166,7 @@ class UserImport
$r = self::dbImportAssoc('user', $account['user']);
if ($r === false) {
logger("uimport:insert user : ERROR : " . dba::errorMessage(), LOGGER_NORMAL);
- notice(t("User creation error"));
+ notice(L10n::t("User creation error"));
return;
}
$newuid = self::lastInsertId();
@@ -186,7 +187,7 @@ class UserImport
$r = self::dbImportAssoc('profile', $profile);
if ($r === false) {
logger("uimport:insert profile " . $profile['profile-name'] . " : ERROR : " . dba::errorMessage(), LOGGER_NORMAL);
- info(t("User profile creation error"));
+ info(L10n::t("User profile creation error"));
dba::delete('user', ['uid' => $newuid]);
return;
}
@@ -230,7 +231,7 @@ class UserImport
}
}
if ($errorcount > 0) {
- notice(sprintf(tt("%d contact not imported", "%d contacts not imported", $errorcount), $errorcount));
+ notice(L10n::tt("%d contact not imported", "%d contacts not imported", $errorcount));
}
foreach ($account['group'] as &$group) {
@@ -295,7 +296,7 @@ class UserImport
// send relocate messages
Worker::add(PRIORITY_HIGH, 'Notifier', 'relocate', $newuid);
- info(t("Done. You can now login with your username and password"));
+ info(L10n::t("Done. You can now login with your username and password"));
goaway(System::baseUrl() . "/login");
}
}
diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php
index 95d911638..169d84e34 100644
--- a/src/Database/DBStructure.php
+++ b/src/Database/DBStructure.php
@@ -5,20 +5,22 @@
namespace Friendica\Database;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use dba;
-require_once "boot.php";
+require_once 'boot.php';
require_once 'include/dba.php';
require_once 'include/enotify.php';
-require_once "include/text.php";
+require_once 'include/text.php';
/**
* @brief This class contain functions for the database management
*
* This class contains functions that doesn't need to know if pdo, mysqli or whatever is used.
*/
-class DBStructure {
+class DBStructure
+{
/*
* Converts all tables from MyISAM to InnoDB
*/
@@ -27,7 +29,7 @@ class DBStructure {
dbesc(dba::database_name()));
if (!DBM::is_result($r)) {
- echo t('There are no tables on MyISAM.')."\n";
+ echo L10n::t('There are no tables on MyISAM.')."\n";
return;
}
@@ -68,14 +70,14 @@ class DBStructure {
// every admin could had different language
foreach ($adminlist as $admin) {
$lang = (($admin['language'])?$admin['language']:'en');
- push_lang($lang);
+ L10n::pushLang($lang);
- $preamble = deindent(t("
+ $preamble = deindent(L10n::t("
The friendica developers released update %s recently,
but when I tried to install it, something went terribly wrong.
This needs to be fixed soon and I can't do it alone. Please contact a
friendica developer if you can not help me on your own. My database might be invalid."));
- $body = t("The error message is\n[pre]%s[/pre]");
+ $body = L10n::t("The error message is\n[pre]%s[/pre]");
$preamble = sprintf($preamble, $update_id);
$body = sprintf($body, $error_message);
@@ -186,10 +188,10 @@ class DBStructure {
* @return string Error message
*/
private static function printUpdateError($message) {
- echo sprintf(t("\nError %d occurred during database update:\n%s\n"),
+ echo L10n::t("\nError %d occurred during database update:\n%s\n",
dba::errorNo(), dba::errorMessage());
- return t('Errors encountered performing database changes: ').$message.EOL;
+ return L10n::t('Errors encountered performing database changes: ').$message.EOL;
}
/**
@@ -204,7 +206,7 @@ class DBStructure {
public static function update($verbose, $action, array $tables = null, array $definition = null) {
if ($action) {
Config::set('system', 'maintenance', 1);
- Config::set('system', 'maintenance_reason', sprintf(t(': Database update'), DBM::date().' '.date('e')));
+ Config::set('system', 'maintenance_reason', L10n::t(': Database update', DBM::date().' '.date('e')));
}
$errors = '';
@@ -454,7 +456,7 @@ class DBStructure {
}
if ($action) {
- Config::set('system', 'maintenance_reason', sprintf(t('%s: updating %s table.'), DBM::date().' '.date('e'), $name));
+ Config::set('system', 'maintenance_reason', L10n::t('%s: updating %s table.', DBM::date().' '.date('e'), $name));
// Ensure index conversion to unique removes duplicates
if ($is_unique && ($temp_name != $name)) {
diff --git a/src/Model/Contact.php b/src/Model/Contact.php
index 2778e8a5d..acdb4815e 100644
--- a/src/Model/Contact.php
+++ b/src/Model/Contact.php
@@ -7,6 +7,7 @@ namespace Friendica\Model;
use Friendica\BaseObject;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Core\Worker;
@@ -491,7 +492,7 @@ class Contact extends BaseObject
if ($contact['uid'] != $uid) {
if ($uid == 0) {
$profile_link = Profile::zrl($contact['url']);
- $menu = ['profile' => [t('View Profile'), $profile_link, true]];
+ $menu = ['profile' => [L10n::t('View Profile'), $profile_link, true]];
return $menu;
}
@@ -504,8 +505,8 @@ class Contact extends BaseObject
$profile_link = Profile::zrl($contact['url']);
$connlnk = 'follow/?url=' . $contact['url'];
$menu = [
- 'profile' => [t('View Profile'), $profile_link, true],
- 'follow' => [t('Connect/Follow'), $connlnk, true]
+ 'profile' => [L10n::t('View Profile'), $profile_link, true],
+ 'follow' => [L10n::t('Connect/Follow'), $connlnk, true]
];
return $menu;
@@ -548,14 +549,14 @@ class Contact extends BaseObject
* "name" => [ "Label", "link", (bool)Should the link opened in a new tab? ]
*/
$menu = [
- 'status' => [t("View Status") , $status_link , true],
- 'profile' => [t("View Profile") , $profile_link , true],
- 'photos' => [t("View Photos") , $photos_link , true],
- 'network' => [t("Network Posts"), $posts_link , false],
- 'edit' => [t("View Contact") , $contact_url , false],
- 'drop' => [t("Drop Contact") , $contact_drop_link, false],
- 'pm' => [t("Send PM") , $pm_url , false],
- 'poke' => [t("Poke") , $poke_link , false],
+ 'status' => [L10n::t("View Status") , $status_link , true],
+ 'profile' => [L10n::t("View Profile") , $profile_link , true],
+ 'photos' => [L10n::t("View Photos") , $photos_link , true],
+ 'network' => [L10n::t("Network Posts"), $posts_link , false],
+ 'edit' => [L10n::t("View Contact") , $contact_url , false],
+ 'drop' => [L10n::t("Drop Contact") , $contact_drop_link, false],
+ 'pm' => [L10n::t("Send PM") , $pm_url , false],
+ 'poke' => [L10n::t("Poke") , $poke_link , false],
];
$args = ['contact' => $contact, 'menu' => &$menu];
@@ -956,13 +957,13 @@ class Contact extends BaseObject
switch ($type) {
case ACCOUNT_TYPE_ORGANISATION:
- $account_type = t("Organisation");
+ $account_type = L10n::t("Organisation");
break;
case ACCOUNT_TYPE_NEWS:
- $account_type = t('News');
+ $account_type = L10n::t('News');
break;
case ACCOUNT_TYPE_COMMUNITY:
- $account_type = t("Forum");
+ $account_type = L10n::t("Forum");
break;
default:
$account_type = "";
@@ -1131,17 +1132,17 @@ class Contact extends BaseObject
$url = str_replace('/#!/', '/', $url);
if (!allowed_url($url)) {
- $result['message'] = t('Disallowed profile URL.');
+ $result['message'] = L10n::t('Disallowed profile URL.');
return $result;
}
if (blocked_url($url)) {
- $result['message'] = t('Blocked domain');
+ $result['message'] = L10n::t('Blocked domain');
return $result;
}
if (!$url) {
- $result['message'] = t('Connect URL missing.');
+ $result['message'] = L10n::t('Connect URL missing.');
return $result;
}
@@ -1173,8 +1174,8 @@ class Contact extends BaseObject
// NOTREACHED
}
} elseif (Config::get('system', 'dfrn_only')) {
- $result['message'] = t('This site is not configured to allow communications with other networks.') . EOL;
- $result['message'] != t('No compatible communication protocols or feeds were discovered.') . EOL;
+ $result['message'] = L10n::t('This site is not configured to allow communications with other networks.') . EOL;
+ $result['message'] != L10n::t('No compatible communication protocols or feeds were discovered.') . EOL;
return $result;
}
@@ -1186,30 +1187,30 @@ class Contact extends BaseObject
// do we have enough information?
if (!((x($ret, 'name')) && (x($ret, 'poll')) && ((x($ret, 'url')) || (x($ret, 'addr'))))) {
- $result['message'] .= t('The profile address specified does not provide adequate information.') . EOL;
+ $result['message'] .= L10n::t('The profile address specified does not provide adequate information.') . EOL;
if (!x($ret, 'poll')) {
- $result['message'] .= t('No compatible communication protocols or feeds were discovered.') . EOL;
+ $result['message'] .= L10n::t('No compatible communication protocols or feeds were discovered.') . EOL;
}
if (!x($ret, 'name')) {
- $result['message'] .= t('An author or name was not found.') . EOL;
+ $result['message'] .= L10n::t('An author or name was not found.') . EOL;
}
if (!x($ret, 'url')) {
- $result['message'] .= t('No browser URL could be matched to this address.') . EOL;
+ $result['message'] .= L10n::t('No browser URL could be matched to this address.') . EOL;
}
if (strpos($url, '@') !== false) {
- $result['message'] .= t('Unable to match @-style Identity Address with a known protocol or email contact.') . EOL;
- $result['message'] .= t('Use mailto: in front of address to force email check.') . EOL;
+ $result['message'] .= L10n::t('Unable to match @-style Identity Address with a known protocol or email contact.') . EOL;
+ $result['message'] .= L10n::t('Use mailto: in front of address to force email check.') . EOL;
}
return $result;
}
if ($ret['network'] === NETWORK_OSTATUS && Config::get('system', 'ostatus_disabled')) {
- $result['message'] .= t('The profile address specified belongs to a network which has been disabled on this site.') . EOL;
+ $result['message'] .= L10n::t('The profile address specified belongs to a network which has been disabled on this site.') . EOL;
$ret['notify'] = '';
}
if (!$ret['notify']) {
- $result['message'] .= t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL;
+ $result['message'] .= L10n::t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL;
}
$writeable = ((($ret['network'] === NETWORK_OSTATUS) && ($ret['notify'])) ? 1 : 0);
@@ -1279,7 +1280,7 @@ class Contact extends BaseObject
$contact = dba::selectFirst('contact', [], ['url' => $ret['url'], 'network' => $ret['network'], 'uid' => $uid]);
if (!DBM::is_result($contact)) {
- $result['message'] .= t('Unable to retrieve contact information.') . EOL;
+ $result['message'] .= L10n::t('Unable to retrieve contact information.') . EOL;
return $result;
}
diff --git a/src/Model/Group.php b/src/Model/Group.php
index a5cd57d47..9e472a7ad 100644
--- a/src/Model/Group.php
+++ b/src/Model/Group.php
@@ -1,11 +1,10 @@
$gid]);
if (DBM::is_result($group) && $group['deleted']) {
dba::update('group', ['deleted' => 0], ['gid' => $gid]);
- notice(t('A deleted group with this name was revived. Existing item permissions
may apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL);
+ notice(L10n::t('A deleted group with this name was revived. Existing item permissions
may apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL);
}
return true;
}
@@ -327,7 +326,7 @@ class Group extends BaseObject
logger('groups: ' . print_r($display_groups, true));
if ($label == '') {
- $label = t('Default privacy group for new contacts');
+ $label = L10n::t('Default privacy group for new contacts');
}
$o = replace_macros(get_markup_template('group_selection.tpl'), [
@@ -360,7 +359,7 @@ class Group extends BaseObject
$display_groups = [
[
- 'text' => t('Everybody'),
+ 'text' => L10n::t('Everybody'),
'id' => 0,
'selected' => (($group_id == 0) ? 'group-selected' : ''),
'href' => $every,
@@ -380,7 +379,7 @@ class Group extends BaseObject
if ($editmode == 'full') {
$groupedit = [
'href' => 'group/' . $group['id'],
- 'title' => t('edit'),
+ 'title' => L10n::t('edit'),
];
} else {
$groupedit = null;
@@ -399,16 +398,16 @@ class Group extends BaseObject
$tpl = get_markup_template('group_side.tpl');
$o = replace_macros($tpl, [
- '$add' => t('add'),
- '$title' => t('Groups'),
+ '$add' => L10n::t('add'),
+ '$title' => L10n::t('Groups'),
'$groups' => $display_groups,
'newgroup' => $editmode == 'extended' || $editmode == 'full' ? 1 : '',
'grouppage' => 'group/',
- '$edittext' => t('Edit group'),
- '$ungrouped' => $every === 'contacts' ? t('Contacts not in any group') : '',
- '$createtext' => t('Create a new group'),
- '$creategroup' => t('Group Name: '),
- '$editgroupstext' => t('Edit groups'),
+ '$edittext' => L10n::t('Edit group'),
+ '$ungrouped' => $every === 'contacts' ? L10n::t('Contacts not in any group') : '',
+ '$createtext' => L10n::t('Create a new group'),
+ '$creategroup' => L10n::t('Group Name: '),
+ '$editgroupstext' => L10n::t('Edit groups'),
'$form_security_token' => get_form_security_token('group_edit'),
]);
diff --git a/src/Model/Mail.php b/src/Model/Mail.php
index a0474f755..be68f515f 100644
--- a/src/Model/Mail.php
+++ b/src/Model/Mail.php
@@ -5,6 +5,7 @@
namespace Friendica\Model;
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@@ -35,7 +36,7 @@ class Mail
}
if (!strlen($subject)) {
- $subject = t('[no subject]');
+ $subject = L10n::t('[no subject]');
}
$me = dba::selectFirst('contact', [], ['uid' => local_user(), 'self' => true]);
@@ -168,7 +169,7 @@ class Mail
}
if (!strlen($subject)) {
- $subject = t('[no subject]');
+ $subject = L10n::t('[no subject]');
}
$guid = get_guid(32);
diff --git a/src/Model/Photo.php b/src/Model/Photo.php
index ef59eee7e..94d5581bf 100644
--- a/src/Model/Photo.php
+++ b/src/Model/Photo.php
@@ -7,6 +7,7 @@ namespace Friendica\Model;
use Friendica\Core\Cache;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
@@ -235,7 +236,7 @@ class Photo
GROUP BY `album` ORDER BY `created` DESC",
intval($uid),
dbesc('Contact Photos'),
- dbesc(t('Contact Photos'))
+ dbesc(L10n::t('Contact Photos'))
);
} else {
// This query doesn't do the count and is much faster
@@ -244,7 +245,7 @@ class Photo
WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' $sql_extra",
intval($uid),
dbesc('Contact Photos'),
- dbesc(t('Contact Photos'))
+ dbesc(L10n::t('Contact Photos'))
);
}
Cache::set($key, $albums, CACHE_DAY);
diff --git a/src/Model/Profile.php b/src/Model/Profile.php
index cd925780b..8e32f60ae 100644
--- a/src/Model/Profile.php
+++ b/src/Model/Profile.php
@@ -2,7 +2,6 @@
/**
* @file src/Model/Profile.php
*/
-
namespace Friendica\Model;
use Friendica\App;
@@ -11,6 +10,7 @@ use Friendica\Content\ForumManager;
use Friendica\Core\Addon;
use Friendica\Core\Cache;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Core\Worker;
@@ -91,7 +91,7 @@ class Profile
if (!$user && !count($user) && !count($profiledata)) {
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
- notice(t('Requested account is not available.') . EOL);
+ notice(L10n::t('Requested account is not available.') . EOL);
$a->error = 404;
return;
}
@@ -112,7 +112,7 @@ class Profile
if (empty($pdata) && empty($profiledata)) {
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
- notice(t('Requested profile is not available.') . EOL);
+ notice(L10n::t('Requested profile is not available.') . EOL);
$a->error = 404;
return;
}
@@ -162,7 +162,7 @@ class Profile
$a->page['aside'] .= replace_macros(
get_markup_template('profile_edlink.tpl'),
[
- '$editprofile' => t('Edit profile'),
+ '$editprofile' => L10n::t('Edit profile'),
'$profid' => $a->profile['id']
]
);
@@ -291,7 +291,7 @@ class Profile
// don't show connect link to yourself
- $connect = $profile['uid'] != local_user() ? t('Connect') : false;
+ $connect = $profile['uid'] != local_user() ? L10n::t('Connect') : false;
// don't show connect link to authenticated visitors either
if (remote_user() && count($_SESSION['remote'])) {
@@ -330,13 +330,13 @@ class Profile
}
if ($connect && ($profile['network'] == NETWORK_DFRN) && !isset($remoteconnect)) {
- $subscribe_feed = t('Atom feed');
+ $subscribe_feed = L10n::t('Atom feed');
} else {
$subscribe_feed = false;
}
if (remote_user() || (self::getMyURL() && x($profile, 'unkmail') && ($profile['uid'] != local_user()))) {
- $wallmessage = t('Message');
+ $wallmessage = L10n::t('Message');
$wallmessage_link = 'wallmessage/' . $profile['nickname'];
if (remote_user()) {
@@ -366,15 +366,15 @@ class Profile
// show edit profile to yourself
if (!$is_contact && $profile['uid'] == local_user() && Feature::isEnabled(local_user(), 'multi_profiles')) {
- $profile['edit'] = [System::baseUrl() . '/profiles', t('Profiles'), '', t('Manage/edit profiles')];
+ $profile['edit'] = [System::baseUrl() . '/profiles', L10n::t('Profiles'), '', L10n::t('Manage/edit profiles')];
$r = q(
"SELECT * FROM `profile` WHERE `uid` = %d",
local_user()
);
$profile['menu'] = [
- 'chg_photo' => t('Change profile photo'),
- 'cr_new' => t('Create New Profile'),
+ 'chg_photo' => L10n::t('Change profile photo'),
+ 'cr_new' => L10n::t('Create New Profile'),
'entries' => [],
];
@@ -383,19 +383,19 @@ class Profile
$profile['menu']['entries'][] = [
'photo' => $rr['thumb'],
'id' => $rr['id'],
- 'alt' => t('Profile Image'),
+ 'alt' => L10n::t('Profile Image'),
'profile_name' => $rr['profile-name'],
'isdefault' => $rr['is-default'],
- 'visibile_to_everybody' => t('visible to everybody'),
- 'edit_visibility' => t('Edit visibility'),
+ 'visibile_to_everybody' => L10n::t('visible to everybody'),
+ 'edit_visibility' => L10n::t('Edit visibility'),
];
}
}
}
if (!$is_contact && $profile['uid'] == local_user() && !Feature::isEnabled(local_user(), 'multi_profiles')) {
- $profile['edit'] = [System::baseUrl() . '/profiles/' . $profile['id'], t('Edit profile'), '', t('Edit profile')];
+ $profile['edit'] = [System::baseUrl() . '/profiles/' . $profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
$profile['menu'] = [
- 'chg_photo' => t('Change profile photo'),
+ 'chg_photo' => L10n::t('Change profile photo'),
'cr_new' => null,
'entries' => [],
];
@@ -411,14 +411,14 @@ class Profile
|| x($profile, 'postal-code')
|| x($profile, 'country-name')
) {
- $location = t('Location:');
+ $location = L10n::t('Location:');
}
- $gender = x($profile, 'gender') ? t('Gender:') : false;
- $marital = x($profile, 'marital') ? t('Status:') : false;
- $homepage = x($profile, 'homepage') ? t('Homepage:') : false;
- $about = x($profile, 'about') ? t('About:') : false;
- $xmpp = x($profile, 'xmpp') ? t('XMPP:') : false;
+ $gender = x($profile, 'gender') ? L10n::t('Gender:') : false;
+ $marital = x($profile, 'marital') ? L10n::t('Status:') : false;
+ $homepage = x($profile, 'homepage') ? L10n::t('Homepage:') : false;
+ $about = x($profile, 'about') ? L10n::t('About:') : false;
+ $xmpp = x($profile, 'xmpp') ? L10n::t('XMPP:') : false;
if ((x($profile, 'hidewall') || $block) && !local_user() && !remote_user()) {
$location = $gender = $marital = $homepage = $about = false;
@@ -512,7 +512,7 @@ class Profile
'$marital' => $marital,
'$homepage' => $homepage,
'$about' => $about,
- '$network' => t('Network:'),
+ '$network' => L10n::t('Network:'),
'$contacts' => $contacts,
'$updated' => $updated,
'$diaspora' => $diaspora,
@@ -542,8 +542,8 @@ class Profile
* return $o;
*/
- $bd_format = t('g A l F d'); // 8 AM Friday January 18
- $bd_short = t('F d');
+ $bd_format = L10n::t('g A l F d'); // 8 AM Friday January 18
+ $bd_short = L10n::t('F d');
$cachekey = 'get_birthdays:' . local_user();
$r = Cache::get($cachekey);
@@ -598,7 +598,7 @@ class Profile
$rr['link'] = $url;
$rr['title'] = $rr['name'];
- $rr['date'] = day_translate(datetime_convert('UTC', $a->timezone, $rr['start'], $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . t('[today]') : '');
+ $rr['date'] = day_translate(datetime_convert('UTC', $a->timezone, $rr['start'], $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . L10n::t('[today]') : '');
$rr['startime'] = null;
$rr['today'] = $today;
}
@@ -609,8 +609,8 @@ class Profile
'$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday,
'$count' => $total,
- '$event_reminders' => t('Birthday Reminders'),
- '$event_title' => t('Birthdays this week:'),
+ '$event_reminders' => L10n::t('Birthday Reminders'),
+ '$event_title' => L10n::t('Birthdays this week:'),
'$events' => $r,
'$lbr' => '{', // raw brackets mess up if/endif macro processing
'$rbr' => '}'
@@ -634,7 +634,7 @@ class Profile
* return $o;
*/
- $bd_format = t('g A l F d'); // 8 AM Friday January 18
+ $bd_format = L10n::t('g A l F d'); // 8 AM Friday January 18
$classtoday = '';
$s = dba::p(
@@ -669,7 +669,7 @@ class Profile
$description = substr(strip_tags(bbcode($rr['desc'])), 0, 32) . '... ';
if (!$description) {
- $description = t('[No description]');
+ $description = L10n::t('[No description]');
}
$strt = datetime_convert('UTC', $rr['convert'] ? $a->timezone : 'UTC', $rr['start']);
@@ -682,7 +682,7 @@ class Profile
$rr['title'] = $title;
$rr['description'] = $description;
- $rr['date'] = day_translate(datetime_convert('UTC', $rr['adjust'] ? $a->timezone : 'UTC', $rr['start'], $bd_format)) . (($today) ? ' ' . t('[today]') : '');
+ $rr['date'] = day_translate(datetime_convert('UTC', $rr['adjust'] ? $a->timezone : 'UTC', $rr['start'], $bd_format)) . (($today) ? ' ' . L10n::t('[today]') : '');
$rr['startime'] = $strt;
$rr['today'] = $today;
@@ -696,8 +696,8 @@ class Profile
'$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday,
'$count' => count($r),
- '$event_reminders' => t('Event Reminders'),
- '$event_title' => t('Events this week:'),
+ '$event_reminders' => L10n::t('Event Reminders'),
+ '$event_title' => L10n::t('Events this week:'),
'$events' => $r,
]);
}
@@ -709,7 +709,7 @@ class Profile
$o .= replace_macros(
get_markup_template('section_title.tpl'),
- ['$title' => t('Profile')]
+ ['$title' => L10n::t('Profile')]
);
if ($a->profile['name']) {
@@ -717,32 +717,32 @@ class Profile
$profile = [];
- $profile['fullname'] = [t('Full Name:'), $a->profile['name']];
+ $profile['fullname'] = [L10n::t('Full Name:'), $a->profile['name']];
if ($a->profile['gender']) {
- $profile['gender'] = [t('Gender:'), $a->profile['gender']];
+ $profile['gender'] = [L10n::t('Gender:'), $a->profile['gender']];
}
if (($a->profile['dob']) && ($a->profile['dob'] > '0001-01-01')) {
- $year_bd_format = t('j F, Y');
- $short_bd_format = t('j F');
+ $year_bd_format = L10n::t('j F, Y');
+ $short_bd_format = L10n::t('j F');
$val = intval($a->profile['dob']) ?
day_translate(datetime_convert('UTC', 'UTC', $a->profile['dob'] . ' 00:00 +00:00', $year_bd_format))
: day_translate(datetime_convert('UTC', 'UTC', '2001-' . substr($a->profile['dob'], 5) . ' 00:00 +00:00', $short_bd_format));
- $profile['birthday'] = [t('Birthday:'), $val];
+ $profile['birthday'] = [L10n::t('Birthday:'), $val];
}
if (!empty($a->profile['dob'])
&& $a->profile['dob'] > '0001-01-01'
&& $age = age($a->profile['dob'], $a->profile['timezone'], '')
) {
- $profile['age'] = [t('Age:'), $age];
+ $profile['age'] = [L10n::t('Age:'), $age];
}
if ($a->profile['marital']) {
- $profile['marital'] = [t('Status:'), $a->profile['marital']];
+ $profile['marital'] = [L10n::t('Status:'), $a->profile['marital']];
}
/// @TODO Maybe use x() here, plus below?
@@ -751,94 +751,94 @@ class Profile
}
if (strlen($a->profile['howlong']) && $a->profile['howlong'] >= NULL_DATE) {
- $profile['howlong'] = relative_date($a->profile['howlong'], t('for %1$d %2$s'));
+ $profile['howlong'] = relative_date($a->profile['howlong'], L10n::t('for %1$d %2$s'));
}
if ($a->profile['sexual']) {
- $profile['sexual'] = [t('Sexual Preference:'), $a->profile['sexual']];
+ $profile['sexual'] = [L10n::t('Sexual Preference:'), $a->profile['sexual']];
}
if ($a->profile['homepage']) {
- $profile['homepage'] = [t('Homepage:'), linkify($a->profile['homepage'])];
+ $profile['homepage'] = [L10n::t('Homepage:'), linkify($a->profile['homepage'])];
}
if ($a->profile['hometown']) {
- $profile['hometown'] = [t('Hometown:'), linkify($a->profile['hometown'])];
+ $profile['hometown'] = [L10n::t('Hometown:'), linkify($a->profile['hometown'])];
}
if ($a->profile['pub_keywords']) {
- $profile['pub_keywords'] = [t('Tags:'), $a->profile['pub_keywords']];
+ $profile['pub_keywords'] = [L10n::t('Tags:'), $a->profile['pub_keywords']];
}
if ($a->profile['politic']) {
- $profile['politic'] = [t('Political Views:'), $a->profile['politic']];
+ $profile['politic'] = [L10n::t('Political Views:'), $a->profile['politic']];
}
if ($a->profile['religion']) {
- $profile['religion'] = [t('Religion:'), $a->profile['religion']];
+ $profile['religion'] = [L10n::t('Religion:'), $a->profile['religion']];
}
if ($txt = prepare_text($a->profile['about'])) {
- $profile['about'] = [t('About:'), $txt];
+ $profile['about'] = [L10n::t('About:'), $txt];
}
if ($txt = prepare_text($a->profile['interest'])) {
- $profile['interest'] = [t('Hobbies/Interests:'), $txt];
+ $profile['interest'] = [L10n::t('Hobbies/Interests:'), $txt];
}
if ($txt = prepare_text($a->profile['likes'])) {
- $profile['likes'] = [t('Likes:'), $txt];
+ $profile['likes'] = [L10n::t('Likes:'), $txt];
}
if ($txt = prepare_text($a->profile['dislikes'])) {
- $profile['dislikes'] = [t('Dislikes:'), $txt];
+ $profile['dislikes'] = [L10n::t('Dislikes:'), $txt];
}
if ($txt = prepare_text($a->profile['contact'])) {
- $profile['contact'] = [t('Contact information and Social Networks:'), $txt];
+ $profile['contact'] = [L10n::t('Contact information and Social Networks:'), $txt];
}
if ($txt = prepare_text($a->profile['music'])) {
- $profile['music'] = [t('Musical interests:'), $txt];
+ $profile['music'] = [L10n::t('Musical interests:'), $txt];
}
if ($txt = prepare_text($a->profile['book'])) {
- $profile['book'] = [t('Books, literature:'), $txt];
+ $profile['book'] = [L10n::t('Books, literature:'), $txt];
}
if ($txt = prepare_text($a->profile['tv'])) {
- $profile['tv'] = [t('Television:'), $txt];
+ $profile['tv'] = [L10n::t('Television:'), $txt];
}
if ($txt = prepare_text($a->profile['film'])) {
- $profile['film'] = [t('Film/dance/culture/entertainment:'), $txt];
+ $profile['film'] = [L10n::t('Film/dance/culture/entertainment:'), $txt];
}
if ($txt = prepare_text($a->profile['romance'])) {
- $profile['romance'] = [t('Love/Romance:'), $txt];
+ $profile['romance'] = [L10n::t('Love/Romance:'), $txt];
}
if ($txt = prepare_text($a->profile['work'])) {
- $profile['work'] = [t('Work/employment:'), $txt];
+ $profile['work'] = [L10n::t('Work/employment:'), $txt];
}
if ($txt = prepare_text($a->profile['education'])) {
- $profile['education'] = [t('School/education:'), $txt];
+ $profile['education'] = [L10n::t('School/education:'), $txt];
}
//show subcribed forum if it is enabled in the usersettings
if (Feature::isEnabled($uid, 'forumlist_profile')) {
- $profile['forumlist'] = [t('Forums:'), ForumManager::profileAdvanced($uid)];
+ $profile['forumlist'] = [L10n::t('Forums:'), ForumManager::profileAdvanced($uid)];
}
if ($a->profile['uid'] == local_user()) {
- $profile['edit'] = [System::baseUrl() . '/profiles/' . $a->profile['id'], t('Edit profile'), '', t('Edit profile')];
+ $profile['edit'] = [System::baseUrl() . '/profiles/' . $a->profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
}
return replace_macros($tpl, [
- '$title' => t('Profile'),
- '$basic' => t('Basic'),
- '$advanced' => t('Advanced'),
+ '$title' => L10n::t('Profile'),
+ '$basic' => L10n::t('Basic'),
+ '$advanced' => L10n::t('Advanced'),
'$profile' => $profile
]);
}
@@ -861,34 +861,34 @@ class Profile
$tabs = [
[
- 'label' => t('Status'),
+ 'label' => L10n::t('Status'),
'url' => $url,
'sel' => !$tab && $a->argv[0] == 'profile' ? 'active' : '',
- 'title' => t('Status Messages and Posts'),
+ 'title' => L10n::t('Status Messages and Posts'),
'id' => 'status-tab',
'accesskey' => 'm',
],
[
- 'label' => t('Profile'),
+ 'label' => L10n::t('Profile'),
'url' => $url . '/?tab=profile',
'sel' => $tab == 'profile' ? 'active' : '',
- 'title' => t('Profile Details'),
+ 'title' => L10n::t('Profile Details'),
'id' => 'profile-tab',
'accesskey' => 'r',
],
[
- 'label' => t('Photos'),
+ 'label' => L10n::t('Photos'),
'url' => System::baseUrl() . '/photos/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'photos' ? 'active' : '',
- 'title' => t('Photo Albums'),
+ 'title' => L10n::t('Photo Albums'),
'id' => 'photo-tab',
'accesskey' => 'h',
],
[
- 'label' => t('Videos'),
+ 'label' => L10n::t('Videos'),
'url' => System::baseUrl() . '/videos/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'videos' ? 'active' : '',
- 'title' => t('Videos'),
+ 'title' => L10n::t('Videos'),
'id' => 'video-tab',
'accesskey' => 'v',
],
@@ -897,10 +897,10 @@ class Profile
// the calendar link for the full featured events calendar
if ($is_owner && $a->theme_events_in_profile) {
$tabs[] = [
- 'label' => t('Events'),
+ 'label' => L10n::t('Events'),
'url' => System::baseUrl() . '/events',
'sel' => !$tab && $a->argv[0] == 'events' ? 'active' : '',
- 'title' => t('Events and Calendar'),
+ 'title' => L10n::t('Events and Calendar'),
'id' => 'events-tab',
'accesskey' => 'e',
];
@@ -908,10 +908,10 @@ class Profile
// with the public events of the calendar owner
} elseif (!$is_owner) {
$tabs[] = [
- 'label' => t('Events'),
+ 'label' => L10n::t('Events'),
'url' => System::baseUrl() . '/cal/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'cal' ? 'active' : '',
- 'title' => t('Events and Calendar'),
+ 'title' => L10n::t('Events and Calendar'),
'id' => 'events-tab',
'accesskey' => 'e',
];
@@ -919,10 +919,10 @@ class Profile
if ($is_owner) {
$tabs[] = [
- 'label' => t('Personal Notes'),
+ 'label' => L10n::t('Personal Notes'),
'url' => System::baseUrl() . '/notes',
'sel' => !$tab && $a->argv[0] == 'notes' ? 'active' : '',
- 'title' => t('Only You Can See This'),
+ 'title' => L10n::t('Only You Can See This'),
'id' => 'notes-tab',
'accesskey' => 't',
];
@@ -930,10 +930,10 @@ class Profile
if ((!$is_owner) && ((count($a->profile)) || (!$a->profile['hide-friends']))) {
$tabs[] = [
- 'label' => t('Contacts'),
+ 'label' => L10n::t('Contacts'),
'url' => System::baseUrl() . '/viewcontacts/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'viewcontacts' ? 'active' : '',
- 'title' => t('Contacts'),
+ 'title' => L10n::t('Contacts'),
'id' => 'viewcontacts-tab',
'accesskey' => 'k',
];
diff --git a/src/Model/User.php b/src/Model/User.php
index bbe424ecb..b4171de95 100644
--- a/src/Model/User.php
+++ b/src/Model/User.php
@@ -1,15 +1,14 @@
$invite_id])) {
- throw new Exception(t('Invitation could not be verified.'));
+ throw new Exception(L10n::t('Invitation could not be verified.'));
}
}
if (!x($username) || !x($email) || !x($nickname)) {
if ($openid_url) {
if (!validate_url($openid_url)) {
- throw new Exception(t('Invalid OpenID url'));
+ throw new Exception(L10n::t('Invalid OpenID url'));
}
$_SESSION['register'] = 1;
$_SESSION['openid'] = $openid_url;
@@ -297,13 +295,13 @@ class User
try {
$authurl = $openid->authUrl();
} catch (Exception $e) {
- throw new Exception(t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . EOL . EOL . t('The error message was:') . $e->getMessage(), 0, $e);
+ throw new Exception(L10n::t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . EOL . EOL . L10n::t('The error message was:') . $e->getMessage(), 0, $e);
}
goaway($authurl);
// NOTREACHED
}
- throw new Exception(t('Please enter the required information.'));
+ throw new Exception(L10n::t('Please enter the required information.'));
}
if (!validate_url($openid_url)) {
@@ -316,10 +314,10 @@ class User
$username = preg_replace('/ +/', ' ', $username);
if (mb_strlen($username) > 48) {
- throw new Exception(t('Please use a shorter name.'));
+ throw new Exception(L10n::t('Please use a shorter name.'));
}
if (mb_strlen($username) < 3) {
- throw new Exception(t('Name too short.'));
+ throw new Exception(L10n::t('Name too short.'));
}
// So now we are just looking for a space in the full name.
@@ -327,20 +325,20 @@ class User
if (!$loose_reg) {
$username = mb_convert_case($username, MB_CASE_TITLE, 'UTF-8');
if (!strpos($username, ' ')) {
- throw new Exception(t("That doesn't appear to be your full \x28First Last\x29 name."));
+ throw new Exception(L10n::t("That doesn't appear to be your full \x28First Last\x29 name."));
}
}
if (!allowed_email($email)) {
- throw new Exception(t('Your email domain is not among those allowed on this site.'));
+ throw new Exception(L10n::t('Your email domain is not among those allowed on this site.'));
}
if (!valid_email($email) || !validate_email($email)) {
- throw new Exception(t('Not a valid email address.'));
+ throw new Exception(L10n::t('Not a valid email address.'));
}
if (dba::exists('user', ['email' => $email])) {
- throw new Exception(t('Cannot use that email.'));
+ throw new Exception(L10n::t('Cannot use that email.'));
}
// Disallow somebody creating an account using openid that uses the admin email address,
@@ -348,21 +346,21 @@ class User
if (x($a->config, 'admin_email') && strlen($openid_url)) {
$adminlist = explode(',', str_replace(' ', '', strtolower($a->config['admin_email'])));
if (in_array(strtolower($email), $adminlist)) {
- throw new Exception(t('Cannot use that email.'));
+ throw new Exception(L10n::t('Cannot use that email.'));
}
}
$nickname = $data['nickname'] = strtolower($nickname);
if (!preg_match('/^[a-z0-9][a-z0-9\_]*$/', $nickname)) {
- throw new Exception(t('Your "nickname" can only contain "a-z", "0-9" and "_".'));
+ throw new Exception(L10n::t('Your "nickname" can only contain "a-z", "0-9" and "_".'));
}
// Check existing and deleted accounts for this nickname.
if (dba::exists('user', ['nickname' => $nickname])
|| dba::exists('userd', ['username' => $nickname])
) {
- throw new Exception(t('Nickname is already registered. Please choose another.'));
+ throw new Exception(L10n::t('Nickname is already registered. Please choose another.'));
}
$new_password = strlen($password) ? $password : User::generateNewPassword();
@@ -372,7 +370,7 @@ class User
$keys = Crypto::newKeypair(4096);
if ($keys === false) {
- throw new Exception(t('SERIOUS ERROR: Generation of security keys failed.'));
+ throw new Exception(L10n::t('SERIOUS ERROR: Generation of security keys failed.'));
}
$prvkey = $keys['prvkey'];
@@ -405,11 +403,11 @@ class User
$uid = dba::lastInsertId();
$user = dba::selectFirst('user', [], ['uid' => $uid]);
} else {
- throw new Exception(t('An error occurred during registration. Please try again.'));
+ throw new Exception(L10n::t('An error occurred during registration. Please try again.'));
}
if (!$uid) {
- throw new Exception(t('An error occurred during registration. Please try again.'));
+ throw new Exception(L10n::t('An error occurred during registration. Please try again.'));
}
// if somebody clicked submit twice very quickly, they could end up with two accounts
@@ -418,7 +416,7 @@ class User
if ($user_count > 1) {
dba::delete('user', ['uid' => $uid]);
- throw new Exception(t('Nickname is already registered. Please choose another.'));
+ throw new Exception(L10n::t('Nickname is already registered. Please choose another.'));
}
$insert_result = dba::insert('profile', [
@@ -429,28 +427,28 @@ class User
'publish' => $publish,
'is-default' => 1,
'net-publish' => $netpublish,
- 'profile-name' => t('default')
+ 'profile-name' => L10n::t('default')
]);
if (!$insert_result) {
dba::delete('user', ['uid' => $uid]);
- throw new Exception(t('An error occurred creating your default profile. Please try again.'));
+ throw new Exception(L10n::t('An error occurred creating your default profile. Please try again.'));
}
// Create the self contact
if (!Contact::createSelfFromUserId($uid)) {
dba::delete('user', ['uid' => $uid]);
- throw new Exception(t('An error occurred creating your self contact. Please try again.'));
+ throw new Exception(L10n::t('An error occurred creating your self contact. Please try again.'));
}
// Create a group with no members. This allows somebody to use it
// right away as a default group for new contacts.
- $def_gid = Group::create($uid, t('Friends'));
+ $def_gid = Group::create($uid, L10n::t('Friends'));
if (!$def_gid) {
dba::delete('user', ['uid' => $uid]);
- throw new Exception(t('An error occurred creating your default contact group. Please try again.'));
+ throw new Exception(L10n::t('An error occurred creating your default contact group. Please try again.'));
}
$fields = ['def_gid' => $def_gid];
@@ -480,7 +478,7 @@ class User
$hash = photo_new_resource();
- $r = Photo::store($Image, $uid, 0, $hash, $filename, t('Profile Photos'), 4);
+ $r = Photo::store($Image, $uid, 0, $hash, $filename, L10n::t('Profile Photos'), 4);
if ($r === false) {
$photo_failure = true;
@@ -488,7 +486,7 @@ class User
$Image->scaleDown(80);
- $r = Photo::store($Image, $uid, 0, $hash, $filename, t('Profile Photos'), 5);
+ $r = Photo::store($Image, $uid, 0, $hash, $filename, L10n::t('Profile Photos'), 5);
if ($r === false) {
$photo_failure = true;
@@ -496,7 +494,7 @@ class User
$Image->scaleDown(48);
- $r = Photo::store($Image, $uid, 0, $hash, $filename, t('Profile Photos'), 6);
+ $r = Photo::store($Image, $uid, 0, $hash, $filename, L10n::t('Profile Photos'), 6);
if ($r === false) {
$photo_failure = true;
@@ -524,7 +522,7 @@ class User
*/
public static function sendRegisterPendingEmail($email, $sitename, $username)
{
- $body = deindent(t('
+ $body = deindent(L10n::t('
Dear %1$s,
Thank you for registering at %2$s. Your account is pending for approval by the administrator.
'));
@@ -534,7 +532,7 @@ class User
return notification([
'type' => SYSTEM_EMAIL,
'to_email' => $email,
- 'subject'=> sprintf( t('Registration at %s'), $sitename),
+ 'subject'=> L10n::t('Registration at %s', $sitename),
'body' => $body]);
}
@@ -552,11 +550,11 @@ class User
*/
public static function sendRegisterOpenEmail($email, $sitename, $siteurl, $username, $password)
{
- $preamble = deindent(t('
+ $preamble = deindent(L10n::t('
Dear %1$s,
Thank you for registering at %2$s. Your account has been created.
'));
- $body = deindent(t('
+ $body = deindent(L10n::t('
The login details are as follows:
Site Location: %3$s
Login Name: %1$s
@@ -588,7 +586,7 @@ class User
return notification([
'type' => SYSTEM_EMAIL,
'to_email' => $email,
- 'subject'=> sprintf( t('Registration details for %s'), $sitename),
+ 'subject'=> L10n::t('Registration details for %s', $sitename),
'preamble'=> $preamble,
'body' => $body]);
}
diff --git a/src/Module/Login.php b/src/Module/Login.php
index d23888326..fdfa6623f 100644
--- a/src/Module/Login.php
+++ b/src/Module/Login.php
@@ -1,17 +1,19 @@
get_baseurl());
// NOTREACHED
}
@@ -73,7 +75,7 @@ class Login extends BaseModule
$openid->returnUrl = self::getApp()->get_baseurl(true) . '/openid';
goaway($openid->authUrl());
} catch (Exception $e) {
- notice(t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . '
' . t('The error message was:') . ' ' . $e->getMessage());
+ notice(L10n::t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . '
' . L10n::t('The error message was:') . ' ' . $e->getMessage());
}
// NOTREACHED
}
@@ -106,7 +108,7 @@ class Login extends BaseModule
if (!$record || !count($record)) {
logger('authenticate: failed login attempt: ' . notags(trim($_POST['username'])) . ' from IP ' . $_SERVER['REMOTE_ADDR']);
- notice(t('Login failed.') . EOL);
+ notice(L10n::t('Login failed.') . EOL);
goaway(self::getApp()->get_baseurl());
}
@@ -246,8 +248,8 @@ class Login extends BaseModule
$reg = false;
if ($register) {
$reg = [
- 'title' => t('Create a New Account'),
- 'desc' => t('Register')
+ 'title' => L10n::t('Create a New Account'),
+ 'desc' => L10n::t('Register')
];
}
@@ -275,28 +277,28 @@ class Login extends BaseModule
$tpl,
[
'$dest_url' => self::getApp()->get_baseurl(true) . '/login',
- '$logout' => t('Logout'),
- '$login' => t('Login'),
+ '$logout' => L10n::t('Logout'),
+ '$login' => L10n::t('Login'),
- '$lname' => ['username', t('Nickname or Email: ') , '', ''],
- '$lpassword' => ['password', t('Password: '), '', ''],
- '$lremember' => ['remember', t('Remember me'), 0, ''],
+ '$lname' => ['username', L10n::t('Nickname or Email: ') , '', ''],
+ '$lpassword' => ['password', L10n::t('Password: '), '', ''],
+ '$lremember' => ['remember', L10n::t('Remember me'), 0, ''],
'$openid' => !$noid,
- '$lopenid' => ['openid_url', t('Or login using OpenID: '),'',''],
+ '$lopenid' => ['openid_url', L10n::t('Or login using OpenID: '),'',''],
'$hiddens' => $hiddens,
'$register' => $reg,
- '$lostpass' => t('Forgot your password?'),
- '$lostlink' => t('Password Reset'),
+ '$lostpass' => L10n::t('Forgot your password?'),
+ '$lostlink' => L10n::t('Password Reset'),
- '$tostitle' => t('Website Terms of Service'),
- '$toslink' => t('terms of service'),
+ '$tostitle' => L10n::t('Website Terms of Service'),
+ '$toslink' => L10n::t('terms of service'),
- '$privacytitle' => t('Website Privacy Policy'),
- '$privacylink' => t('privacy policy'),
+ '$privacytitle' => L10n::t('Website Privacy Policy'),
+ '$privacylink' => L10n::t('privacy policy'),
]
);
diff --git a/src/Module/Logout.php b/src/Module/Logout.php
index 366f000a8..a03ef05c2 100644
--- a/src/Module/Logout.php
+++ b/src/Module/Logout.php
@@ -1,12 +1,14 @@
get_baseurl());
}
}
diff --git a/src/Object/Image.php b/src/Object/Image.php
index 3501d8270..2feb3b924 100644
--- a/src/Object/Image.php
+++ b/src/Object/Image.php
@@ -8,6 +8,7 @@ namespace Friendica\Object;
use Friendica\App;
use Friendica\Core\Cache;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Photo;
@@ -944,7 +945,7 @@ class Image
$defperm = "";
$visitor = 0;
- $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, t('Wall Photos'), 0, 0, $defperm);
+ $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, L10n::t('Wall Photos'), 0, 0, $defperm);
if (!$r) {
logger("Picture couldn't be stored", LOGGER_DEBUG);
@@ -960,7 +961,7 @@ class Image
if ($width > 640 || $height > 640) {
$Image->scaleDown(640);
- $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, t('Wall Photos'), 1, 0, $defperm);
+ $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, L10n::t('Wall Photos'), 1, 0, $defperm);
if ($r) {
$image["medium"] = System::baseUrl()."/photo/{$hash}-1.".$Image->getExt();
}
@@ -968,7 +969,7 @@ class Image
if ($width > 320 || $height > 320) {
$Image->scaleDown(320);
- $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, t('Wall Photos'), 2, 0, $defperm);
+ $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, L10n::t('Wall Photos'), 2, 0, $defperm);
if ($r) {
$image["small"] = System::baseUrl()."/photo/{$hash}-2.".$Image->getExt();
}
@@ -993,7 +994,7 @@ class Image
$min = 160;
$Image->crop(160, $x, $y, $min, $min);
- $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, t('Wall Photos'), 3, 0, $defperm);
+ $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, L10n::t('Wall Photos'), 3, 0, $defperm);
if ($r) {
$image["thumb"] = System::baseUrl()."/photo/{$hash}-3.".$Image->getExt();
}
diff --git a/src/Object/Post.php b/src/Object/Post.php
index f933da9d0..67ce3b7cc 100644
--- a/src/Object/Post.php
+++ b/src/Object/Post.php
@@ -8,6 +8,7 @@ use Friendica\BaseObject;
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
@@ -121,7 +122,7 @@ class Post extends BaseObject
// only if the difference is more than 1 second.
if (strtotime($item['edited']) - strtotime($item['created']) > 1) {
$edited = [
- 'label' => t('This entry was edited'),
+ 'label' => L10n::t('This entry was edited'),
'date' => datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r'),
'relative' => relative_date($item['edited'])
];
@@ -142,15 +143,15 @@ class Post extends BaseObject
$lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
- ? t('Private Message')
+ ? L10n::t('Private Message')
: false);
$shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != 1;
if (local_user() && link_compare($a->contact['url'], $item['author-link'])) {
if ($item["event-id"] != 0) {
- $edpost = ["events/event/" . $item['event-id'], t("Edit")];
+ $edpost = ["events/event/" . $item['event-id'], L10n::t("Edit")];
} else {
- $edpost = ["editpost/" . $item['id'], t("Edit")];
+ $edpost = ["editpost/" . $item['id'], L10n::t("Edit")];
}
$dropping = in_array($item['uid'], [0, local_user()]);
} else {
@@ -171,11 +172,11 @@ class Post extends BaseObject
$drop = [
'dropping' => $dropping,
'pagedrop' => ((Feature::isEnabled($conv->getProfileOwner(), 'multi_delete')) ? $item['pagedrop'] : ''),
- 'select' => t('Select'),
- 'delete' => t('Delete'),
+ 'select' => L10n::t('Select'),
+ 'delete' => L10n::t('Delete'),
];
- $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? t("save to folder") : false);
+ $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? L10n::t("save to folder") : false);
$diff_author = !link_compare($item['url'], $item['author-link']);
$profile_name = htmlentities(((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
@@ -228,7 +229,7 @@ class Post extends BaseObject
$response_verbs[] = 'attendmaybe';
if ($conv->isWritable()) {
$isevent = true;
- $attend = [t('I will attend'), t('I will not attend'), t('I might attend')];
+ $attend = [L10n::t('I will attend'), L10n::t('I will not attend'), L10n::t('I might attend')];
}
}
@@ -256,29 +257,29 @@ class Post extends BaseObject
$isstarred = (($item['starred']) ? "starred" : "unstarred");
$star = [
- 'do' => t("add star"),
- 'undo' => t("remove star"),
- 'toggle' => t("toggle star status"),
+ 'do' => L10n::t("add star"),
+ 'undo' => L10n::t("remove star"),
+ 'toggle' => L10n::t("toggle star status"),
'classdo' => $item['starred'] ? "hidden" : "",
'classundo' => $item['starred'] ? "" : "hidden",
- 'starred' => t('starred'),
+ 'starred' => L10n::t('starred'),
];
$thread = dba::selectFirst('thread', ['ignored'], ['uid' => $item['uid'], 'iid' => $item['id']]);
if (DBM::is_result($thread)) {
$ignore = [
- 'do' => t("ignore thread"),
- 'undo' => t("unignore thread"),
- 'toggle' => t("toggle ignore status"),
+ 'do' => L10n::t("ignore thread"),
+ 'undo' => L10n::t("unignore thread"),
+ 'toggle' => L10n::t("toggle ignore status"),
'classdo' => $thread['ignored'] ? "hidden" : "",
'classundo' => $thread['ignored'] ? "" : "hidden",
- 'ignored' => t('ignored'),
+ 'ignored' => L10n::t('ignored'),
];
}
if (Feature::isEnabled($conv->getProfileOwner(), 'commtag')) {
$tagger = [
- 'add' => t("add tag"),
+ 'add' => L10n::t("add tag"),
'class' => "",
];
}
@@ -289,11 +290,11 @@ class Post extends BaseObject
if ($conv->isWritable()) {
$buttons = [
- 'like' => [t("I like this \x28toggle\x29"), t("like")],
- 'dislike' => Feature::isEnabled($conv->getProfileOwner(), 'dislike') ? [t("I don't like this \x28toggle\x29"), t("dislike")] : '',
+ 'like' => [L10n::t("I like this \x28toggle\x29"), L10n::t("like")],
+ 'dislike' => Feature::isEnabled($conv->getProfileOwner(), 'dislike') ? [L10n::t("I don't like this \x28toggle\x29"), L10n::t("dislike")] : '',
];
if ($shareable) {
- $buttons['share'] = [t('Share this'), t('share')];
+ $buttons['share'] = [L10n::t('Share this'), L10n::t('share')];
}
}
@@ -337,8 +338,8 @@ class Post extends BaseObject
'tags' => $item['tags'],
'hashtags' => $item['hashtags'],
'mentions' => $item['mentions'],
- 'txt_cats' => t('Categories:'),
- 'txt_folders' => t('Filed under:'),
+ 'txt_cats' => L10n::t('Categories:'),
+ 'txt_folders' => L10n::t('Filed under:'),
'has_cats' => ((count($categories)) ? 'true' : ''),
'has_folders' => ((count($folders)) ? 'true' : ''),
'categories' => $categories,
@@ -349,12 +350,12 @@ class Post extends BaseObject
'guid' => urlencode($item['guid']),
'isevent' => $isevent,
'attend' => $attend,
- 'linktitle' => t('View %s\'s profile @ %s', $profile_name, defaults($item, 'author-link', $item['url'])),
- 'olinktitle' => t('View %s\'s profile @ %s', htmlentities($this->getOwnerName()), defaults($item, 'owner-link', $item['url'])),
- 'to' => t('to'),
- 'via' => t('via'),
- 'wall' => t('Wall-to-Wall'),
- 'vwall' => t('via Wall-To-Wall:'),
+ 'linktitle' => L10n::t('View %s\'s profile @ %s', $profile_name, defaults($item, 'author-link', $item['url'])),
+ 'olinktitle' => L10n::t('View %s\'s profile @ %s', htmlentities($this->getOwnerName()), defaults($item, 'owner-link', $item['url'])),
+ 'to' => L10n::t('to'),
+ 'via' => L10n::t('via'),
+ 'wall' => L10n::t('Wall-to-Wall'),
+ 'vwall' => L10n::t('via Wall-To-Wall:'),
'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
'name' => $name_e,
@@ -363,7 +364,7 @@ class Post extends BaseObject
'sparkle' => $sparkle,
'title' => $title_e,
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
- 'ago' => $item['app'] ? t('%s from %s', relative_date($item['created']), $item['app']) : relative_date($item['created']),
+ 'ago' => $item['app'] ? L10n::t('%s from %s', relative_date($item['created']), $item['app']) : relative_date($item['created']),
'app' => $item['app'],
'created' => relative_date($item['created']),
'lock' => $lock,
@@ -385,10 +386,10 @@ class Post extends BaseObject
'like' => $responses['like']['output'],
'dislike' => $responses['dislike']['output'],
'responses' => $responses,
- 'switchcomment' => t('Comment'),
+ 'switchcomment' => L10n::t('Comment'),
'comment' => $comment,
'previewing' => $conv->isPreview() ? ' preview ' : '',
- 'wait' => t('Please wait'),
+ 'wait' => L10n::t('Please wait'),
'thread_level' => $thread_level,
'edited' => $edited,
'network' => $item["item_network"],
@@ -413,10 +414,10 @@ class Post extends BaseObject
// Collapse
if (($nb_children > 2) || ($thread_level > 1)) {
$result['children'][0]['comment_firstcollapsed'] = true;
- $result['children'][0]['num_comments'] = tt('%d comment', '%d comments', $total_children);
+ $result['children'][0]['num_comments'] = L10n::tt('%d comment', '%d comments', $total_children);
$result['children'][0]['hidden_comments_num'] = $total_children;
- $result['children'][0]['hidden_comments_text'] = tt('comment', 'comments', $total_children);
- $result['children'][0]['hide_text'] = t('show more');
+ $result['children'][0]['hidden_comments_text'] = L10n::tt('comment', 'comments', $total_children);
+ $result['children'][0]['hide_text'] = L10n::t('show more');
if ($thread_level > 1) {
$result['children'][$nb_children - 1]['comment_lastcollapsed'] = true;
} else {
@@ -427,7 +428,7 @@ class Post extends BaseObject
if ($this->isToplevel()) {
$result['total_comments_num'] = "$total_children";
- $result['total_comments_text'] = tt('comment', 'comments', $total_children);
+ $result['total_comments_text'] = L10n::tt('comment', 'comments', $total_children);
}
$result['private'] = $item['private'];
@@ -779,21 +780,21 @@ class Post extends BaseObject
'$qcomment' => $qcomment,
'$profile_uid' => $uid,
'$mylink' => $a->remove_baseurl($a->contact['url']),
- '$mytitle' => t('This is you'),
+ '$mytitle' => L10n::t('This is you'),
'$myphoto' => $a->remove_baseurl($a->contact['thumb']),
- '$comment' => t('Comment'),
- '$submit' => t('Submit'),
- '$edbold' => t('Bold'),
- '$editalic' => t('Italic'),
- '$eduline' => t('Underline'),
- '$edquote' => t('Quote'),
- '$edcode' => t('Code'),
- '$edimg' => t('Image'),
- '$edurl' => t('Link'),
- '$edvideo' => t('Video'),
- '$preview' => ((Feature::isEnabled($conv->getProfileOwner(), 'preview')) ? t('Preview') : ''),
+ '$comment' => L10n::t('Comment'),
+ '$submit' => L10n::t('Submit'),
+ '$edbold' => L10n::t('Bold'),
+ '$editalic' => L10n::t('Italic'),
+ '$eduline' => L10n::t('Underline'),
+ '$edquote' => L10n::t('Quote'),
+ '$edcode' => L10n::t('Code'),
+ '$edimg' => L10n::t('Image'),
+ '$edurl' => L10n::t('Link'),
+ '$edvideo' => L10n::t('Video'),
+ '$preview' => ((Feature::isEnabled($conv->getProfileOwner(), 'preview')) ? L10n::t('Preview') : ''),
'$indent' => $indent,
- '$sourceapp' => t($a->sourcename),
+ '$sourceapp' => L10n::t($a->sourcename),
'$ww' => $conv->getMode() === 'network' ? $ww : '',
'$rand_num' => random_digits(12)
]);
diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php
index 83084bce5..7b76ddc71 100644
--- a/src/Protocol/DFRN.php
+++ b/src/Protocol/DFRN.php
@@ -12,6 +12,7 @@ use Friendica\App;
use Friendica\Content\OEmbed;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@@ -1393,8 +1394,8 @@ class DFRN
logger("updating birthday: ".$birthday." for contact ".$contact["id"]);
- $bdtext = sprintf(t("%s\'s birthday"), $contact["name"]);
- $bdtext2 = sprintf(t("Happy Birthday %s"), " [url=".$contact["url"]."]".$contact["name"]."[/url]");
+ $bdtext = L10n::t("%s\'s birthday", $contact["name"]);
+ $bdtext2 = L10n::t("Happy Birthday %s", " [url=".$contact["url"]."]".$contact["name"]."[/url]");
$r = q(
"INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`)
diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php
index cd81e3e8a..540f82cc6 100644
--- a/src/Protocol/Diaspora.php
+++ b/src/Protocol/Diaspora.php
@@ -13,6 +13,7 @@ use Friendica\App;
use Friendica\Core\System;
use Friendica\Core\Cache;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@@ -1933,11 +1934,11 @@ class Diaspora
*/
private static function constructLikeBody($contact, $parent_item, $guid)
{
- $bodyverb = t('%1$s likes %2$s\'s %3$s');
+ $bodyverb = L10n::t('%1$s likes %2$s\'s %3$s');
$ulink = "[url=".$contact["url"]."]".$contact["name"]."[/url]";
$alink = "[url=".$parent_item["author-link"]."]".$parent_item["author-name"]."[/url]";
- $plink = "[url=".System::baseUrl()."/display/".urlencode($guid)."]".t("status")."[/url]";
+ $plink = "[url=".System::baseUrl()."/display/".urlencode($guid)."]".L10n::t("status")."[/url]";
return sprintf($bodyverb, $ulink, $alink, $plink);
}
@@ -2405,7 +2406,7 @@ class Diaspora
$A = "[url=".$self[0]["url"]."]".$self[0]["name"]."[/url]";
$B = "[url=".$contact["url"]."]".$contact["name"]."[/url]";
$BPhoto = "[url=".$contact["url"]."][img]".$contact["thumb"]."[/img][/url]";
- $arr["body"] = sprintf(t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$BPhoto;
+ $arr["body"] = L10n::t('%1$s is now friends with %2$s', $A, $B)."\n\n\n".$BPhoto;
$arr["object"] = self::constructNewFriendObject($contact);
@@ -2575,7 +2576,7 @@ class Diaspora
intval($contact_record["id"]),
0,
0,
- dbesc(t("Sharing notification from Diaspora network")),
+ dbesc(L10n::t("Sharing notification from Diaspora network")),
dbesc($hash),
dbesc(datetime_convert())
);
@@ -3677,7 +3678,7 @@ class Diaspora
if ($item["attach"]) {
$cnt = preg_match_all('/href=\"(.*?)\"(.*?)title=\"(.*?)\"/ism', $item["attach"], $matches, PREG_SET_ORDER);
if (cnt) {
- $body .= "\n".t("Attachments:")."\n";
+ $body .= "\n".L10n::t("Attachments:")."\n";
foreach ($matches as $mtch) {
$body .= "[".$mtch[3]."](".$mtch[1].")\n";
}
diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php
index 214767648..0e695416f 100644
--- a/src/Protocol/OStatus.php
+++ b/src/Protocol/OStatus.php
@@ -7,6 +7,7 @@ namespace Friendica\Protocol;
use Friendica\App;
use Friendica\Core\Cache;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
@@ -1258,9 +1259,9 @@ class OStatus
$root->setAttribute("xmlns:mastodon", NAMESPACE_MASTODON);
switch ($filter) {
- case 'activity': $title = t('%s\'s timeline', $owner['name']); break;
- case 'posts' : $title = t('%s\'s posts' , $owner['name']); break;
- case 'comments': $title = t('%s\'s comments', $owner['name']); break;
+ case 'activity': $title = L10n::t('%s\'s timeline', $owner['name']); break;
+ case 'posts' : $title = L10n::t('%s\'s posts' , $owner['name']); break;
+ case 'comments': $title = L10n::t('%s\'s comments', $owner['name']); break;
}
$attributes = ["uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION . "-" . DB_UPDATE_VERSION];
@@ -1787,12 +1788,12 @@ class OStatus
}
if ($item['verb'] == ACTIVITY_FOLLOW) {
- $message = t('%s is now following %s.');
- $title = t('following');
+ $message = L10n::t('%s is now following %s.');
+ $title = L10n::t('following');
$action = "subscription";
} else {
- $message = t('%s stopped following %s.');
- $title = t('stopped following');
+ $message = L10n::t('%s stopped following %s.');
+ $title = L10n::t('stopped following');
$action = "unfollow";
}
diff --git a/src/Worker/Delivery.php b/src/Worker/Delivery.php
index bd7c5b817..b394b0ed3 100644
--- a/src/Worker/Delivery.php
+++ b/src/Worker/Delivery.php
@@ -7,6 +7,7 @@ namespace Friendica\Worker;
use Friendica\App;
use Friendica\Core\System;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Queue;
@@ -388,7 +389,7 @@ class Delivery {
$reply_to = $r1[0]['reply_to'];
}
- $subject = (($it['title']) ? Email::encodeHeader($it['title'],'UTF-8') : t("\x28no subject\x29")) ;
+ $subject = (($it['title']) ? Email::encodeHeader($it['title'],'UTF-8') : L10n::t("\x28no subject\x29")) ;
// only expose our real email address to true friends
@@ -400,7 +401,7 @@ class Delivery {
$headers = 'From: '.Email::encodeHeader($local_user[0]['username'],'UTF-8').' <'.$local_user[0]['email'].'>'."\n";
}
} else {
- $headers = 'From: '. Email::encodeHeader($local_user[0]['username'],'UTF-8') .' <'. t('noreply') .'@'.$a->get_hostname() .'>'. "\n";
+ $headers = 'From: '. Email::encodeHeader($local_user[0]['username'],'UTF-8') .' <'. L10n::t('noreply') .'@'.$a->get_hostname() .'>'. "\n";
}
//if ($reply_to)
diff --git a/util/README b/util/README
index eecf85b84..83a49cd22 100644
--- a/util/README
+++ b/util/README
@@ -12,7 +12,7 @@ extract.php - extracts translatable strings from our project files. It
currently doesn't pick up strings in other libraries we might be using such as
the HTML parsers.
-In order for extract to do its job, every use of the t() translation function
+In order for extract to do its job, every use of the L10n::t() translation function
must be preceded by one space. The string also can not contain parentheses. If
parens are required in a string which requires translation, please use hex escapes.
@@ -61,7 +61,7 @@ e.g.
Plural
-The tt() function supports plural form. Script extract.php write this in
+The L10n::tt() function supports plural form. Script extract.php write this in
strings.php as an array, one string for every plural form language supports:
$a->string["%d message sent"] = Array(
@@ -79,7 +79,7 @@ More info at http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html
Xgettext and .po workflow
1. Run util/run_xgettext.sh script (on *unix sistems, with GNU xgettext installed)
- This script runs xgettext on source tree, extracting strings from t() and tt()
+ This script runs xgettext on source tree, extracting strings from L10n::t() and L10n::tt()
functions, and creates a util/messages.po file.
$ cd util; ./run_xgettext.sh
diff --git a/util/extract.php b/util/extract.php
index b3aa12ebf..13151bc96 100644
--- a/util/extract.php
+++ b/util/extract.php
@@ -9,8 +9,8 @@
foreach($files as $file) {
$str = file_get_contents($file);
- $pat = '| t\(([^\)]*)\)|';
- $patt = '| tt\(([^\)]*)\)|';
+ $pat = '| L10n::t\(([^\)]*)\)|';
+ $patt = '| L10n::tt\(([^\)]*)\)|';
preg_match_all($pat,$str,$matches);
preg_match_all($patt, $str, $matchestt);
diff --git a/util/global_community_block.php b/util/global_community_block.php
index 87044bb4e..df50c827b 100755
--- a/util/global_community_block.php
+++ b/util/global_community_block.php
@@ -29,13 +29,14 @@ if ($argc != 2 || $argv[1] == "-h" || $argv[1] == "--help" || $argv[1] == "-?")
}
use Friendica\BaseObject;
+use Friendica\Core\L10n;
use Friendica\Model\Contact;
require_once 'boot.php';
require_once 'include/dba.php';
require_once 'include/text.php';
-$a = get_app();;
+$a = get_app();
BaseObject::setApp($a);
require_once '.htconfig.php';
@@ -44,11 +45,11 @@ unset($db_host, $db_user, $db_pass, $db_data);
$contact_id = Contact::getIdForURL($argv[1], 0);
if (!$contact_id) {
- echo t('Could not find any contact entry for this URL (%s)', $nurl);
+ echo L10n::t('Could not find any contact entry for this URL (%s)', $nurl);
echo "\r\n";
exit(1);
}
Contact::block($contact_id);
-echo t('The contact has been blocked from the node');
+echo L10n::t('The contact has been blocked from the node');
echo "\r\n";
exit(0);
diff --git a/util/maintenance.php b/util/maintenance.php
index 39c2acb0e..a697e66d5 100644
--- a/util/maintenance.php
+++ b/util/maintenance.php
@@ -1,9 +1,13 @@
-
{{"Upload"|t}}
+
{{$upload}}
diff --git a/view/theme/duepuntozero/config.php b/view/theme/duepuntozero/config.php
index 1b299329b..30eb25623 100644
--- a/view/theme/duepuntozero/config.php
+++ b/view/theme/duepuntozero/config.php
@@ -1,73 +1,78 @@
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'),
];
if ($user) {
$color = PConfig::get(local_user(), 'duepuntozero', 'colorset');
} else {
- $color = Config::get( 'duepuntozero', 'colorset');
+ $color = Config::get('duepuntozero', 'colorset');
}
- $t = get_markup_template("theme_settings.tpl" );
+ $t = get_markup_template("theme_settings.tpl");
/// @TODO No need for adding string here, $o is not defined
$o .= replace_macros($t, [
- '$submit' => t('Submit'),
+ '$submit' => L10n::t('Submit'),
'$baseurl' => System::baseUrl(),
- '$title' => t("Theme settings"),
- '$colorset' => ['duepuntozero_colorset', t('Variations'), $color, '', $colorset],
+ '$title' => L10n::t("Theme settings"),
+ '$colorset' => ['duepuntozero_colorset', L10n::t('Variations'), $color, '', $colorset],
]);
return $o;
diff --git a/view/theme/frio/config.php b/view/theme/frio/config.php
index 4e474de5d..cff58fd5f 100644
--- a/view/theme/frio/config.php
+++ b/view/theme/frio/config.php
@@ -2,10 +2,11 @@
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
-require_once('view/theme/frio/php/Image.php');
+require_once 'view/theme/frio/php/Image.php';
function theme_post(App $a) {
if (!local_user()) {
@@ -93,7 +94,7 @@ function frio_form($arr) {
}
$scheme_choices = [];
- $scheme_choices["---"] = t("Default");
+ $scheme_choices["---"] = L10n::t("Default");
$files = glob('view/theme/frio/schema/*.php');
if ($files) {
foreach ($files as $file) {
@@ -105,28 +106,28 @@ function frio_form($arr) {
}
}
- $background_image_help = "
".t("Check image permissions if all users are allowed to visit the image");
+ $background_image_help = "
".L10n::t("Check image permissions if all users are allowed to visit the image");
$t = get_markup_template('theme_settings.tpl');
$ctx = [
- '$submit' => t('Submit'),
+ '$submit' => L10n::t('Submit'),
'$baseurl' => System::baseUrl(),
- '$title' => t("Theme settings"),
- '$schema' => ['frio_schema', t("Select scheme"), $arr["schema"], '', $scheme_choices],
- '$nav_bg' => array_key_exists("nav_bg", $disable) ? "" : ['frio_nav_bg', t('Navigation bar background color'), $arr['nav_bg']],
- '$nav_icon_color' => array_key_exists("nav_icon_color", $disable) ? "" : ['frio_nav_icon_color', t('Navigation bar icon color '), $arr['nav_icon_color']],
- '$link_color' => array_key_exists("link_color", $disable) ? "" : ['frio_link_color', t('Link color'), $arr['link_color'], '', $link_colors],
- '$bgcolor' => array_key_exists("bgcolor", $disable) ? "" : ['frio_background_color', t('Set the background color'), $arr['bgcolor']],
- '$contentbg_transp' => array_key_exists("contentbg_transp", $disable) ? "" : ['frio_contentbg_transp', t("Content background transparency"), ((isset($arr["contentbg_transp"]) && $arr["contentbg_transp"] != "") ? $arr["contentbg_transp"] : 100)],
- '$background_image' => array_key_exists("background_image", $disable ) ? "" : ['frio_background_image', t('Set the background image'), $arr['background_image'], $background_image_help],
+ '$title' => L10n::t("Theme settings"),
+ '$schema' => ['frio_schema', L10n::t("Select scheme"), $arr["schema"], '', $scheme_choices],
+ '$nav_bg' => array_key_exists("nav_bg", $disable) ? "" : ['frio_nav_bg', L10n::t('Navigation bar background color'), $arr['nav_bg']],
+ '$nav_icon_color' => array_key_exists("nav_icon_color", $disable) ? "" : ['frio_nav_icon_color', L10n::t('Navigation bar icon color '), $arr['nav_icon_color']],
+ '$link_color' => array_key_exists("link_color", $disable) ? "" : ['frio_link_color', L10n::t('Link color'), $arr['link_color'], '', $link_colors],
+ '$bgcolor' => array_key_exists("bgcolor", $disable) ? "" : ['frio_background_color', L10n::t('Set the background color'), $arr['bgcolor']],
+ '$contentbg_transp' => array_key_exists("contentbg_transp", $disable) ? "" : ['frio_contentbg_transp', L10n::t("Content background transparency"), ((isset($arr["contentbg_transp"]) && $arr["contentbg_transp"] != "") ? $arr["contentbg_transp"] : 100)],
+ '$background_image' => array_key_exists("background_image", $disable) ? "" : ['frio_background_image', L10n::t('Set the background image'), $arr['background_image'], $background_image_help],
'$bg_image_options' => Image::get_options($arr),
];
- if ( array_key_exists("login_bg_image", $arr ) && !array_key_exists("login_bg_image", $disable ) ) {
- $ctx['$login_bg_image'] = ['frio_login_bg_image', t('Login page background image'), $arr['login_bg_image'], $background_image_help];
+ if (array_key_exists("login_bg_image", $arr) && !array_key_exists("login_bg_image", $disable)) {
+ $ctx['$login_bg_image'] = ['frio_login_bg_image', L10n::t('Login page background image'), $arr['login_bg_image'], $background_image_help];
}
- if ( array_key_exists("login_bg_color", $arr ) && !array_key_exists("login_bg_color", $disable ) ) {
- $ctx['$login_bg_color'] = ['frio_login_bg_color', t('Login page background color'), $arr['login_bg_color'], t('Leave background image and color empty for theme defaults')];
+ if (array_key_exists("login_bg_color", $arr) && !array_key_exists("login_bg_color", $disable)) {
+ $ctx['$login_bg_color'] = ['frio_login_bg_color', L10n::t('Login page background color'), $arr['login_bg_color'], L10n::t('Leave background image and color empty for theme defaults')];
}
diff --git a/view/theme/frio/php/Image.php b/view/theme/frio/php/Image.php
index 159f258e7..2dc0345c7 100644
--- a/view/theme/frio/php/Image.php
+++ b/view/theme/frio/php/Image.php
@@ -1,5 +1,4 @@
[
- 'frio_bg_image_option', t("Repeat the image"), "repeat", t("Will repeat your image to fill the background."), ($arr["bg_image_option"] == "repeat")],
+ 'frio_bg_image_option', L10n::t("Repeat the image"), "repeat", L10n::t("Will repeat your image to fill the background."), ($arr["bg_image_option"] == "repeat")],
'stretch' => [
- 'frio_bg_image_option', t("Stretch"), "stretch", t("Will stretch to width/height of the image."), ($arr["bg_image_option"] == "stretch")],
+ 'frio_bg_image_option', L10n::t("Stretch"), "stretch", L10n::t("Will stretch to width/height of the image."), ($arr["bg_image_option"] == "stretch")],
'cover' => [
- 'frio_bg_image_option', t("Resize fill and-clip"), "cover", t("Resize to fill and retain aspect ratio."), ($arr["bg_image_option"] == "cover")],
+ 'frio_bg_image_option', L10n::t("Resize fill and-clip"), "cover", L10n::t("Resize to fill and retain aspect ratio."), ($arr["bg_image_option"] == "cover")],
'contain' => [
- 'frio_bg_image_option', t("Resize best fit"), "contain", t("Resize to best fit and retain aspect ratio."), ($arr["bg_image_option"] == "contain")],
+ 'frio_bg_image_option', L10n::t("Resize best fit"), "contain", L10n::t("Resize to best fit and retain aspect ratio."), ($arr["bg_image_option"] == "contain")],
];
return $bg_image_options;
}
-}
\ No newline at end of file
+}
diff --git a/view/theme/frio/templates/filebrowser.tpl b/view/theme/frio/templates/filebrowser.tpl
index 48ed01a01..3fde6a520 100644
--- a/view/theme/frio/templates/filebrowser.tpl
+++ b/view/theme/frio/templates/filebrowser.tpl
@@ -58,7 +58,7 @@