';
- $o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
- $o .= t('running at web location') . ' ' . System::baseUrl();
+ $o .= L10n::t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
+ $o .= L10n::t('running at web location') . ' ' . System::baseUrl();
$o .= '
' . PHP_EOL;
$o .= '
';
- $o .= t('Please visit Friendi.ca to learn more about the Friendica project.') . PHP_EOL;
+ $o .= L10n::t('Please visit Friendi.ca to learn more about the Friendica project.') . PHP_EOL;
$o .= '
' . t('On this server the following remote servers are blocked.') . '
' . PHP_EOL;
- $o .= '
' . t('Blocked domain') . '
' . t('Reason for the block') . '
' . PHP_EOL;
+ $o .= '
' . L10n::t('On this server the following remote servers are blocked.') . '
' . PHP_EOL;
+ $o .= '
' . L10n::t('Blocked domain') . '
' . L10n::t('Reason for the block') . '
' . PHP_EOL;
foreach ($blocklist as $b) {
$o .= '
' . $b['domain'] .'
' . $b['reason'] . '
' . PHP_EOL;
}
diff --git a/mod/fsuggest.php b/mod/fsuggest.php
index b122709ab..c86609721 100644
--- a/mod/fsuggest.php
+++ b/mod/fsuggest.php
@@ -7,8 +7,8 @@ use Friendica\Core\L10n;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
-function fsuggest_post(App $a) {
-
+function fsuggest_post(App $a)
+{
if (! local_user()) {
return;
}
@@ -35,13 +35,12 @@ function fsuggest_post(App $a) {
$note = escape_tags(trim($_POST['note']));
- if($new_contact) {
+ if ($new_contact) {
$r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($new_contact),
intval(local_user())
);
if (DBM::is_result($r)) {
-
$x = q("INSERT INTO `fsuggest` ( `uid`,`cid`,`name`,`url`,`request`,`photo`,`note`,`created`)
VALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')",
intval(local_user()),
@@ -69,14 +68,9 @@ function fsuggest_post(App $a) {
info(L10n::t('Friend suggestion sent.') . EOL);
}
-
}
-
-
}
-
-
function fsuggest_content(App $a)
{
require_once 'include/acl_selectors.php';
@@ -103,7 +97,7 @@ function fsuggest_content(App $a)
}
$contact = $r[0];
- $o = '
' . t('Suggest Friends') . '
';
+ $o = '
' . L10n::t('Suggest Friends') . '
';
$o .= '
' . sprintf(t('Suggest a friend for %s'), $contact['name']) . '
';
@@ -117,7 +111,7 @@ function fsuggest_content(App $a)
);
- $o .= '';
+ $o .= '';
$o .= '';
return $o;
diff --git a/mod/group.php b/mod/group.php
index 7d7ac0dce..dc74ebc32 100644
--- a/mod/group.php
+++ b/mod/group.php
@@ -94,13 +94,13 @@ function group_content(App $a) {
$tpl = get_markup_template('group_edit.tpl');
$context = [
- '$submit' => t('Save Group'),
+ '$submit' => L10n::t('Save Group'),
];
if (($a->argc == 2) && ($a->argv[1] === 'new')) {
return replace_macros($tpl, $context + [
- '$title' => t('Create a group of contacts/friends.'),
- '$gname' => ['groupname', t('Group Name: '), '', ''],
+ '$title' => L10n::t('Create a group of contacts/friends.'),
+ '$gname' => ['groupname', L10n::t('Group Name: '), '', ''],
'$gid' => 'new',
'$form_security_token' => get_form_security_token("group_edit"),
]);
@@ -190,18 +190,18 @@ function group_content(App $a) {
$drop_tpl = get_markup_template('group_drop.tpl');
$drop_txt = replace_macros($drop_tpl, [
'$id' => $group['id'],
- '$delete' => t('Delete Group'),
+ '$delete' => L10n::t('Delete Group'),
'$form_security_token' => get_form_security_token("group_drop"),
]);
$context = $context + [
- '$title' => t('Group Editor'),
- '$gname' => ['groupname', t('Group Name: '), $group['name'], ''],
+ '$title' => L10n::t('Group Editor'),
+ '$gname' => ['groupname', L10n::t('Group Name: '), $group['name'], ''],
'$gid' => $group['id'],
'$drop' => $drop_txt,
'$form_security_token' => get_form_security_token('group_edit'),
- '$edit_name' => t('Edit Group Name')
+ '$edit_name' => L10n::t('Edit Group Name')
];
}
@@ -211,10 +211,10 @@ function group_content(App $a) {
}
$groupeditor = [
- 'label_members' => t('Members'),
+ 'label_members' => L10n::t('Members'),
'members' => [],
- 'label_contacts' => t('All Contacts'),
- 'group_is_empty' => t('Group is empty'),
+ 'label_contacts' => L10n::t('All Contacts'),
+ 'group_is_empty' => L10n::t('Group is empty'),
'contacts' => [],
];
@@ -227,7 +227,7 @@ function group_content(App $a) {
$entry['label'] = 'members';
$entry['photo_menu'] = '';
$entry['change_member'] = [
- 'title' => t("Remove Contact"),
+ 'title' => L10n::t("Remove Contact"),
'gid' => $group['id'],
'cid' => $member['id'],
'sec_token' => $sec_token
@@ -251,7 +251,7 @@ function group_content(App $a) {
$entry['label'] = 'contacts';
$entry['photo_menu'] = '';
$entry['change_member'] = [
- 'title' => t("Add Contact"),
+ 'title' => L10n::t("Add Contact"),
'gid' => $group['id'],
'cid' => $member['id'],
'sec_token' => $sec_token
@@ -263,7 +263,7 @@ function group_content(App $a) {
}
$context['$groupeditor'] = $groupeditor;
- $context['$desc'] = t('Click on a contact to add or remove.');
+ $context['$desc'] = L10n::t('Click on a contact to add or remove.');
// If there are to many contacts we could provide an alternative view mode
$total = count($groupeditor['members']) + count($groupeditor['contacts']);
diff --git a/mod/help.php b/mod/help.php
index b9c2bae3a..e4442f7ca 100644
--- a/mod/help.php
+++ b/mod/help.php
@@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Content\Text\Markdown;
+use Friendica\Core\L10n;
use Friendica\Core\System;
if (!function_exists('load_doc_file')) {
@@ -44,22 +45,22 @@ function help_content(App $a) {
$title = basename($path);
$filename = $path;
$text = load_doc_file('doc/' . $path . '.md');
- $a->page['title'] = t('Help:') . ' ' . str_replace('-', ' ', notags($title));
+ $a->page['title'] = L10n::t('Help:') . ' ' . str_replace('-', ' ', notags($title));
}
$home = load_doc_file('doc/Home.md');
if (!$text) {
$text = $home;
$filename = "Home";
- $a->page['title'] = t('Help');
+ $a->page['title'] = L10n::t('Help');
} else {
$a->page['aside'] = Markdown::convert($home, false);
}
if (!strlen($text)) {
- header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found'));
+ header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . L10n::t('Not Found'));
$tpl = get_markup_template("404.tpl");
return replace_macros($tpl, [
- '$message' => t('Page not found.')
+ '$message' => L10n::t('Page not found.')
]);
}
diff --git a/mod/install.php b/mod/install.php
index b0955fded..075c91e12 100644
--- a/mod/install.php
+++ b/mod/install.php
@@ -108,29 +108,29 @@ function install_content(App $a) {
global $install_wizard_pass;
$o = '';
$wizard_status = "";
- $install_title = t('Friendica Communications Server - Setup');
+ $install_title = L10n::t('Friendica Communications Server - Setup');
if (x($a->data, 'db_conn_failed')) {
$install_wizard_pass = 2;
- $wizard_status = t('Could not connect to database.');
+ $wizard_status = L10n::t('Could not connect to database.');
}
if (x($a->data, 'db_create_failed')) {
$install_wizard_pass = 2;
- $wizard_status = t('Could not create table.');
+ $wizard_status = L10n::t('Could not create table.');
}
$db_return_text = "";
if (x($a->data, 'db_installed')) {
$txt = '
';
- $txt .= t('Your Friendica site database has been installed.') . EOL;
+ $txt .= L10n::t('Your Friendica site database has been installed.') . EOL;
$db_return_text .= $txt;
}
if (x($a->data, 'db_failed')) {
- $txt = t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . EOL;
- $txt .= t('Please see the file "INSTALL.txt".') . EOL ."
";
+ $txt = L10n::t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . EOL;
+ $txt .= L10n::t('Please see the file "INSTALL.txt".') . EOL ."";
$txt .= "
".$a->data['db_failed'] . "
". EOL;
$db_return_text .= $txt;
}
@@ -142,7 +142,7 @@ function install_content(App $a) {
return replace_macros($tpl, [
'$title' => $install_title,
'$pass' => '',
- '$status' => t('Database already in use.'),
+ '$status' => L10n::t('Database already in use.'),
'$text' => '',
]);
}
@@ -199,12 +199,12 @@ function install_content(App $a) {
$tpl = get_markup_template('install_checks.tpl');
$o .= replace_macros($tpl, [
'$title' => $install_title,
- '$pass' => t('System check'),
+ '$pass' => L10n::t('System check'),
'$checks' => $checks,
'$passed' => $checkspassed,
- '$see_install' => t('Please see the file "INSTALL.txt".'),
- '$next' => t('Next'),
- '$reload' => t('Check again'),
+ '$see_install' => L10n::t('Please see the file "INSTALL.txt".'),
+ '$next' => L10n::t('Next'),
+ '$reload' => L10n::t('Check again'),
'$phpath' => $phpath,
'$baseurl' => System::baseUrl(),
]);
@@ -223,28 +223,28 @@ function install_content(App $a) {
$tpl = get_markup_template('install_db.tpl');
$o .= replace_macros($tpl, [
'$title' => $install_title,
- '$pass' => t('Database connection'),
- '$info_01' => t('In order to install Friendica we need to know how to connect to your database.'),
- '$info_02' => t('Please contact your hosting provider or site administrator if you have questions about these settings.'),
- '$info_03' => t('The database you specify below should already exist. If it does not, please create it before continuing.'),
+ '$pass' => L10n::t('Database connection'),
+ '$info_01' => L10n::t('In order to install Friendica we need to know how to connect to your database.'),
+ '$info_02' => L10n::t('Please contact your hosting provider or site administrator if you have questions about these settings.'),
+ '$info_03' => L10n::t('The database you specify below should already exist. If it does not, please create it before continuing.'),
'$status' => $wizard_status,
- '$dbhost' => ['dbhost', t('Database Server Name'), $dbhost, '', 'required'],
- '$dbuser' => ['dbuser', t('Database Login Name'), $dbuser, '', 'required', 'autofocus'],
- '$dbpass' => ['dbpass', t('Database Login Password'), $dbpass, t("For security reasons the password must not be empty"), 'required'],
- '$dbdata' => ['dbdata', t('Database Name'), $dbdata, '', 'required'],
- '$adminmail' => ['adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'],
+ '$dbhost' => ['dbhost', L10n::t('Database Server Name'), $dbhost, '', 'required'],
+ '$dbuser' => ['dbuser', L10n::t('Database Login Name'), $dbuser, '', 'required', 'autofocus'],
+ '$dbpass' => ['dbpass', L10n::t('Database Login Password'), $dbpass, L10n::t("For security reasons the password must not be empty"), 'required'],
+ '$dbdata' => ['dbdata', L10n::t('Database Name'), $dbdata, '', 'required'],
+ '$adminmail' => ['adminmail', L10n::t('Site administrator email address'), $adminmail, L10n::t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'],
- '$lbl_10' => t('Please select a default timezone for your website'),
+ '$lbl_10' => L10n::t('Please select a default timezone for your website'),
'$baseurl' => System::baseUrl(),
'$phpath' => $phpath,
- '$submit' => t('Submit'),
+ '$submit' => L10n::t('Submit'),
]);
return $o;
@@ -265,7 +265,7 @@ function install_content(App $a) {
$tpl = get_markup_template('install_settings.tpl');
$o .= replace_macros($tpl, [
'$title' => $install_title,
- '$pass' => t('Site settings'),
+ '$pass' => L10n::t('Site settings'),
'$status' => $wizard_status,
@@ -275,16 +275,16 @@ function install_content(App $a) {
'$dbdata' => $dbdata,
'$phpath' => $phpath,
- '$adminmail' => ['adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'],
+ '$adminmail' => ['adminmail', L10n::t('Site administrator email address'), $adminmail, L10n::t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'],
- '$timezone' => field_timezone('timezone', t('Please select a default timezone for your website'), $timezone, ''),
- '$language' => ['language', t('System Language:'), 'en', t('Set the default language for your Friendica installation interface and to send emails.'), $lang_choices],
+ '$timezone' => field_timezone('timezone', L10n::t('Please select a default timezone for your website'), $timezone, ''),
+ '$language' => ['language', L10n::t('System Language:'), 'en', L10n::t('Set the default language for your Friendica installation interface and to send emails.'), $lang_choices],
'$baseurl' => System::baseUrl(),
- '$submit' => t('Submit'),
+ '$submit' => L10n::t('Submit'),
]);
return $o;
@@ -319,17 +319,17 @@ function check_php(&$phpath, &$checks) {
}
$help = "";
if (!$passed) {
- $help .= t('Could not find a command line version of PHP in the web server PATH.'). EOL;
- $help .= t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See 'Setup the worker'") . EOL;
+ $help .= L10n::t('Could not find a command line version of PHP in the web server PATH.'). EOL;
+ $help .= L10n::t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See 'Setup the worker'") . EOL;
$help .= EOL . EOL;
$tpl = get_markup_template('field_input.tpl');
$help .= replace_macros($tpl, [
- '$field' => ['phpath', t('PHP executable path'), $phpath, t('Enter full path to php executable. You can leave this blank to continue the installation.')],
+ '$field' => ['phpath', L10n::t('PHP executable path'), $phpath, L10n::t('Enter full path to php executable. You can leave this blank to continue the installation.')],
]);
$phpath = "";
}
- check_add($checks, t('Command line PHP').($passed?" ($phpath)":""), $passed, false, $help);
+ check_add($checks, L10n::t('Command line PHP').($passed?" ($phpath)":""), $passed, false, $help);
if ($passed) {
$cmd = "$phpath -v";
@@ -338,10 +338,10 @@ function check_php(&$phpath, &$checks) {
list($result) = explode("\n", $result);
$help = "";
if (!$passed2) {
- $help .= t('PHP executable is not the php cli binary (could be cgi-fgci version)'). EOL;
- $help .= t('Found PHP version: ')."$result";
+ $help .= L10n::t('PHP executable is not the php cli binary (could be cgi-fgci version)'). EOL;
+ $help .= L10n::t('Found PHP version: ')."$result";
}
- check_add($checks, t('PHP cli binary'), $passed2, true, $help);
+ check_add($checks, L10n::t('PHP cli binary'), $passed2, true, $help);
}
@@ -352,10 +352,10 @@ function check_php(&$phpath, &$checks) {
$passed3 = $result == $str;
$help = "";
if (!$passed3) {
- $help .= t('The command line version of PHP on your system does not have "register_argc_argv" enabled.'). EOL;
- $help .= t('This is required for message delivery to work.');
+ $help .= L10n::t('The command line version of PHP on your system does not have "register_argc_argv" enabled.'). EOL;
+ $help .= L10n::t('This is required for message delivery to work.');
}
- check_add($checks, t('PHP register_argc_argv'), $passed3, true, $help);
+ check_add($checks, L10n::t('PHP register_argc_argv'), $passed3, true, $help);
}
@@ -378,59 +378,59 @@ function check_keys(&$checks) {
// Get private key
if (! $res) {
- $help .= t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys'). EOL;
- $help .= t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".');
+ $help .= L10n::t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys'). EOL;
+ $help .= L10n::t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".');
}
- check_add($checks, t('Generate encryption keys'), $res, true, $help);
+ check_add($checks, L10n::t('Generate encryption keys'), $res, true, $help);
}
function check_funcs(&$checks) {
$ck_funcs = [];
- check_add($ck_funcs, t('libCurl PHP module'), true, true, "");
- check_add($ck_funcs, t('GD graphics PHP module'), true, true, "");
- check_add($ck_funcs, t('OpenSSL PHP module'), true, true, "");
- check_add($ck_funcs, t('PDO or MySQLi PHP module'), true, true, "");
- check_add($ck_funcs, t('mb_string PHP module'), true, true, "");
- check_add($ck_funcs, t('XML PHP module'), true, true, "");
- check_add($ck_funcs, t('iconv module'), true, true, "");
+ check_add($ck_funcs, L10n::t('libCurl PHP module'), true, true, "");
+ check_add($ck_funcs, L10n::t('GD graphics PHP module'), true, true, "");
+ check_add($ck_funcs, L10n::t('OpenSSL PHP module'), true, true, "");
+ check_add($ck_funcs, L10n::t('PDO or MySQLi PHP module'), true, true, "");
+ check_add($ck_funcs, L10n::t('mb_string PHP module'), true, true, "");
+ check_add($ck_funcs, L10n::t('XML PHP module'), true, true, "");
+ check_add($ck_funcs, L10n::t('iconv module'), true, true, "");
if (function_exists('apache_get_modules')) {
if (! in_array('mod_rewrite',apache_get_modules())) {
- check_add($ck_funcs, t('Apache mod_rewrite module'), false, true, t('Error: Apache webserver mod-rewrite module is required but not installed.'));
+ check_add($ck_funcs, L10n::t('Apache mod_rewrite module'), false, true, L10n::t('Error: Apache webserver mod-rewrite module is required but not installed.'));
} else {
- check_add($ck_funcs, t('Apache mod_rewrite module'), true, true, "");
+ check_add($ck_funcs, L10n::t('Apache mod_rewrite module'), true, true, "");
}
}
if (! function_exists('curl_init')) {
$ck_funcs[0]['status'] = false;
- $ck_funcs[0]['help'] = t('Error: libCURL PHP module required but not installed.');
+ $ck_funcs[0]['help'] = L10n::t('Error: libCURL PHP module required but not installed.');
}
if (! function_exists('imagecreatefromjpeg')) {
$ck_funcs[1]['status'] = false;
- $ck_funcs[1]['help'] = t('Error: GD graphics PHP module with JPEG support required but not installed.');
+ $ck_funcs[1]['help'] = L10n::t('Error: GD graphics PHP module with JPEG support required but not installed.');
}
if (! function_exists('openssl_public_encrypt')) {
$ck_funcs[2]['status'] = false;
- $ck_funcs[2]['help'] = t('Error: openssl PHP module required but not installed.');
+ $ck_funcs[2]['help'] = L10n::t('Error: openssl PHP module required but not installed.');
}
if (! function_exists('mysqli_connect') && !class_exists('pdo')) {
$ck_funcs[3]['status'] = false;
- $ck_funcs[3]['help'] = t('Error: PDO or MySQLi PHP module required but not installed.');
+ $ck_funcs[3]['help'] = L10n::t('Error: PDO or MySQLi PHP module required but not installed.');
}
if (!function_exists('mysqli_connect') && class_exists('pdo') && !in_array('mysql', PDO::getAvailableDrivers())) {
$ck_funcs[3]['status'] = false;
- $ck_funcs[3]['help'] = t('Error: The MySQL driver for PDO is not installed.');
+ $ck_funcs[3]['help'] = L10n::t('Error: The MySQL driver for PDO is not installed.');
}
if (! function_exists('mb_strlen')) {
$ck_funcs[4]['status'] = false;
- $ck_funcs[4]['help'] = t('Error: mb_string PHP module required but not installed.');
+ $ck_funcs[4]['help'] = L10n::t('Error: mb_string PHP module required but not installed.');
}
if (! function_exists('iconv_strlen')) {
$ck_funcs[7]['status'] = false;
- $ck_funcs[7]['help'] = t('Error: iconv PHP module required but not installed.');
+ $ck_funcs[7]['help'] = L10n::t('Error: iconv PHP module required but not installed.');
}
$checks = array_merge($checks, $ck_funcs);
@@ -440,7 +440,7 @@ function check_funcs(&$checks) {
$xml = new DOMDocument();
} catch (Exception $e) {
$ck_funcs[6]['status'] = false;
- $ck_funcs[6]['help'] = t('Error, XML PHP module required but not installed.');
+ $ck_funcs[6]['help'] = L10n::t('Error, XML PHP module required but not installed.');
}
}
@@ -452,13 +452,13 @@ function check_htconfig(&$checks) {
(!file_exists('.htconfig.php') && !is_writable('.'))) {
$status = false;
- $help = t('The web installer needs to be able to create a file called ".htconfig.php" in the top folder of your web server and it is unable to do so.') .EOL;
- $help .= t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.').EOL;
- $help .= t('At the end of this procedure, we will give you a text to save in a file named .htconfig.php in your Friendica top folder.').EOL;
- $help .= t('You can alternatively skip this procedure and perform a manual installation. Please see the file "INSTALL.txt" for instructions.').EOL;
+ $help = L10n::t('The web installer needs to be able to create a file called ".htconfig.php" in the top folder of your web server and it is unable to do so.') .EOL;
+ $help .= L10n::t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.').EOL;
+ $help .= L10n::t('At the end of this procedure, we will give you a text to save in a file named .htconfig.php in your Friendica top folder.').EOL;
+ $help .= L10n::t('You can alternatively skip this procedure and perform a manual installation. Please see the file "INSTALL.txt" for instructions.').EOL;
}
- check_add($checks, t('.htconfig.php is writable'), $status, false, $help);
+ check_add($checks, L10n::t('.htconfig.php is writable'), $status, false, $help);
}
@@ -468,13 +468,13 @@ function check_smarty3(&$checks) {
if (!is_writable('view/smarty3')) {
$status = false;
- $help = t('Friendica uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') .EOL;
- $help .= t('In order to store these compiled templates, the web server needs to have write access to the directory view/smarty3/ under the Friendica top level folder.').EOL;
- $help .= t('Please ensure that the user that your web server runs as (e.g. www-data) has write access to this folder.').EOL;
- $help .= t('Note: as a security measure, you should give the web server write access to view/smarty3/ only--not the template files (.tpl) that it contains.').EOL;
+ $help = L10n::t('Friendica uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') .EOL;
+ $help .= L10n::t('In order to store these compiled templates, the web server needs to have write access to the directory view/smarty3/ under the Friendica top level folder.').EOL;
+ $help .= L10n::t('Please ensure that the user that your web server runs as (e.g. www-data) has write access to this folder.').EOL;
+ $help .= L10n::t('Note: as a security measure, you should give the web server write access to view/smarty3/ only--not the template files (.tpl) that it contains.').EOL;
}
- check_add($checks, t('view/smarty3 is writable'), $status, true, $help);
+ check_add($checks, L10n::t('view/smarty3 is writable'), $status, true, $help);
}
@@ -490,9 +490,9 @@ function check_htaccess(&$checks) {
if ($test != "ok") {
$status = false;
- $help = t('Url rewrite in .htaccess is not working. Check your server configuration.');
+ $help = L10n::t('Url rewrite in .htaccess is not working. Check your server configuration.');
}
- check_add($checks, t('Url rewrite is working'), $status, true, $help);
+ check_add($checks, L10n::t('Url rewrite is working'), $status, true, $help);
} else {
// cannot check modrewrite if libcurl is not installed
/// @TODO Maybe issue warning here?
@@ -511,18 +511,18 @@ function check_imagik(&$checks) {
}
}
if ($imagick == false) {
- check_add($checks, t('ImageMagick PHP extension is not installed'), $imagick, false, "");
+ check_add($checks, L10n::t('ImageMagick PHP extension is not installed'), $imagick, false, "");
} else {
- check_add($checks, t('ImageMagick PHP extension is installed'), $imagick, false, "");
+ check_add($checks, L10n::t('ImageMagick PHP extension is installed'), $imagick, false, "");
if ($imagick) {
- check_add($checks, t('ImageMagick supports GIF'), $gif, false, "");
+ check_add($checks, L10n::t('ImageMagick supports GIF'), $gif, false, "");
}
}
}
function manual_config(App $a) {
$data = htmlentities($a->data['txt'],ENT_COMPAT, 'UTF-8');
- $o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
+ $o = L10n::t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
$o .= "";
return $o;
}
diff --git a/mod/item.php b/mod/item.php
index 97a8006ef..226f31056 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -469,7 +469,7 @@ function item_post(App $a) {
$fields = ['allow_cid' => $str_contact_allow, 'allow_gid' => $str_group_allow,
'deny_cid' => $str_contact_deny, 'deny_gid' => $str_group_deny];
- $condition = ['resource-id' => $image_uri, 'uid' => $profile_uid, 'album' => t('Wall Photos')];
+ $condition = ['resource-id' => $image_uri, 'uid' => $profile_uid, 'album' => L10n::t('Wall Photos')];
dba::update('photo', $fields, $condition);
}
}
@@ -803,7 +803,7 @@ function item_post(App $a) {
$disclaimer = '' . sprintf(t('This message was sent to you by %s, a member of the Friendica social network.'), $a->user['username'])
. ' ';
$disclaimer .= sprintf(t('You may visit them online at %s'), System::baseUrl() . '/profile/' . $a->user['nickname']) . EOL;
- $disclaimer .= t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL;
+ $disclaimer .= L10n::t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL;
if (!$datarray['title']=='') {
$subject = Email::encodeHeader($datarray['title'], 'UTF-8');
} else {
diff --git a/mod/maintenance.php b/mod/maintenance.php
index adc9fab16..8727e4afb 100644
--- a/mod/maintenance.php
+++ b/mod/maintenance.php
@@ -1,10 +1,13 @@
t('System down for maintenance'),
+ '$sysdown' => L10n::t('System down for maintenance'),
'$reason' => $reason
]);
}
diff --git a/mod/openid.php b/mod/openid.php
index 78e362e2d..5af209c13 100644
--- a/mod/openid.php
+++ b/mod/openid.php
@@ -27,7 +27,7 @@ function openid_content(App $a) {
$authid = $_REQUEST['openid_identity'];
if(! strlen($authid)) {
- logger( t('OpenID protocol error. No ID returned.') . EOL);
+ logger(L10n::t('OpenID protocol error. No ID returned.') . EOL);
goaway(System::baseUrl());
}
diff --git a/mod/ostatus_subscribe.php b/mod/ostatus_subscribe.php
index 400e6a7cc..bef50c2db 100644
--- a/mod/ostatus_subscribe.php
+++ b/mod/ostatus_subscribe.php
@@ -57,7 +57,7 @@ function ostatus_subscribe_content(App $a) {
$a->page['htmlhead'] = '';
PConfig::delete($uid, "ostatus", "legacy_friends");
PConfig::delete($uid, "ostatus", "legacy_contact");
- $o .= t("Done");
+ $o .= L10n::t("Done");
return $o;
}
diff --git a/mod/repair_ostatus.php b/mod/repair_ostatus.php
index 370d772e1..8315a2514 100644
--- a/mod/repair_ostatus.php
+++ b/mod/repair_ostatus.php
@@ -45,7 +45,7 @@ function repair_ostatus_content(App $a) {
intval(CONTACT_IS_SHARING), $counter++);
if (!$r) {
- $o .= t("Done");
+ $o .= L10n::t("Done");
return $o;
}
@@ -53,7 +53,7 @@ function repair_ostatus_content(App $a) {
$o .= "
".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/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/util/README b/util/README
index a6efd938b..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.
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/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..444e048f0 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("Note"). ": ".t("Check image permissions if all users are allowed to visit the image");
+ $background_image_help = "" . L10n::t("Note"). ": ".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/theme.php b/view/theme/frio/theme.php
index 132ed0d3b..3c4d5120c 100644
--- a/view/theme/frio/theme.php
+++ b/view/theme/frio/theme.php
@@ -10,6 +10,7 @@ use Friendica\App;
use Friendica\Content\Widget;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
@@ -234,12 +235,12 @@ function frio_remote_nav($a, &$nav)
$r[0]['name'] = $a->user['username'];
} elseif (!local_user() && remote_user()) {
$r = q("SELECT `name`, `nick`, `micro` AS `photo` FROM `contact` WHERE `id` = %d", intval(remote_user()));
- $nav['remote'] = t("Guest");
+ $nav['remote'] = L10n::t("Guest");
} elseif (Profile::getMyURL()) {
$r = q("SELECT `name`, `nick`, `photo` FROM `gcontact`
WHERE `addr` = '%s' AND `network` = 'dfrn'",
dbesc($webbie));
- $nav['remote'] = t("Visitor");
+ $nav['remote'] = L10n::t("Visitor");
} else {
$r = false;
}
@@ -252,21 +253,21 @@ function frio_remote_nav($a, &$nav)
}
if (!local_user() && !empty($server_url)) {
- $nav['logout'] = [$server_url . '/logout', t('Logout'), "", t('End this session')];
+ $nav['logout'] = [$server_url . '/logout', L10n::t('Logout'), "", L10n::t('End this session')];
// user menu
- $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'], t('Status'), "", t('Your posts and conversations')];
- $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), "", t('Your profile page')];
- $nav['usermenu'][] = [$server_url . '/photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos')];
- $nav['usermenu'][] = [$server_url . '/videos/' . $a->user['nickname'], t('Videos'), "", t('Your videos')];
- $nav['usermenu'][] = [$server_url . '/events/', t('Events'), "", t('Your events')];
+ $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'], L10n::t('Status'), "", L10n::t('Your posts and conversations')];
+ $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'] . '?tab=profile', L10n::t('Profile'), "", L10n::t('Your profile page')];
+ $nav['usermenu'][] = [$server_url . '/photos/' . $a->user['nickname'], L10n::t('Photos'), "", L10n::t('Your photos')];
+ $nav['usermenu'][] = [$server_url . '/videos/' . $a->user['nickname'], L10n::t('Videos'), "", L10n::t('Your videos')];
+ $nav['usermenu'][] = [$server_url . '/events/', L10n::t('Events'), "", L10n::t('Your events')];
// navbar links
- $nav['network'] = [$server_url . '/network', t('Network'), "", t('Conversations from your friends')];
- $nav['events'] = [$server_url . '/events', t('Events'), "", t('Events and Calendar')];
- $nav['messages'] = [$server_url . '/message', t('Messages'), "", t('Private mail')];
- $nav['settings'] = [$server_url . '/settings', t('Settings'), "", t('Account settings')];
- $nav['contacts'] = [$server_url . '/contacts', t('Contacts'), "", t('Manage/edit friends and contacts')];
+ $nav['network'] = [$server_url . '/network', L10n::t('Network'), "", L10n::t('Conversations from your friends')];
+ $nav['events'] = [$server_url . '/events', L10n::t('Events'), "", L10n::t('Events and Calendar')];
+ $nav['messages'] = [$server_url . '/message', L10n::t('Messages'), "", L10n::t('Private mail')];
+ $nav['settings'] = [$server_url . '/settings', L10n::t('Settings'), "", L10n::t('Account settings')];
+ $nav['contacts'] = [$server_url . '/contacts', L10n::t('Contacts'), "", L10n::t('Manage/edit friends and contacts')];
$nav['sitename'] = $a->config['sitename'];
}
}
@@ -352,7 +353,7 @@ function frio_display_item(App $a, &$arr)
if (local_user() == $arr['item']['uid'] && $arr['item']['parent'] == $arr['item']['id'] && !$arr['item']['self']) {
$subthread = [
'menu' => 'follow_thread',
- 'title' => t('Follow Thread'),
+ 'title' => L10n::t('Follow Thread'),
'action' => 'dosubthread(' . $arr['item']['id'] . '); return false;',
'href' => '#'
];
diff --git a/view/theme/quattro/config.php b/view/theme/quattro/config.php
index 6bd04ae7d..b4c24a365 100644
--- a/view/theme/quattro/config.php
+++ b/view/theme/quattro/config.php
@@ -1,11 +1,11 @@
t('Submit'),
+ '$submit' => L10n::t('Submit'),
'$baseurl' => System::baseUrl(),
- '$title' => t("Theme settings"),
- '$align' => ['quattro_align', t('Alignment'), $align, '', ['left'=>t('Left'), 'center'=>t('Center')]],
- '$color' => ['quattro_color', t('Color scheme'), $color, '', $colors],
- '$pfs' => ['quattro_pfs', t('Posts font size'), $pfs],
- '$tfs' => ['quattro_tfs', t('Textareas font size'), $tfs],
+ '$title' => L10n::t("Theme settings"),
+ '$align' => ['quattro_align', L10n::t('Alignment'), $align, '', ['left' => L10n::t('Left'), 'center' => L10n::t('Center')]],
+ '$color' => ['quattro_color', L10n::t('Color scheme'), $color, '', $colors],
+ '$pfs' => ['quattro_pfs', L10n::t('Posts font size'), $pfs],
+ '$tfs' => ['quattro_tfs', L10n::t('Textareas font size'), $tfs],
]);
return $o;
}
diff --git a/view/theme/vier/config.php b/view/theme/vier/config.php
index 785b03b50..044c6445f 100644
--- a/view/theme/vier/config.php
+++ b/view/theme/vier/config.php
@@ -1,15 +1,16 @@
['vier_helperlist', t('Comma separated list of helper forums'), $helperlist, '', ''],
+ '$helperlist' => ['vier_helperlist', L10n::t('Comma separated list of helper forums'), $helperlist, '', ''],
]);
$show_pages = get_vier_config('show_pages', true, true);
@@ -110,20 +112,20 @@ function vier_form(App $a, $style, $show_pages, $show_profiles, $show_helpers, $
"shadow"=>"Shadow"
];
- $show_or_not = ['0'=>t("don't show"), '1'=>t("show"),];
+ $show_or_not = ['0' => L10n::t("don't show"), '1' => L10n::t("show"),];
$t = get_markup_template("theme_settings.tpl");
$o .= replace_macros($t, [
- '$submit' => t('Submit'),
+ '$submit' => L10n::t('Submit'),
'$baseurl' => System::baseUrl(),
- '$title' => t("Theme settings"),
- '$style' => ['vier_style',t ('Set style'),$style,'',$styles],
- '$show_pages' => ['vier_show_pages', t('Community Pages'), $show_pages, '', $show_or_not],
- '$show_profiles' => ['vier_show_profiles', t('Community Profiles'), $show_profiles, '', $show_or_not],
- '$show_helpers' => ['vier_show_helpers', t('Help or @NewHere ?'), $show_helpers, '', $show_or_not],
- '$show_services' => ['vier_show_services', t('Connect Services'), $show_services, '', $show_or_not],
- '$show_friends' => ['vier_show_friends', t('Find Friends'), $show_friends, '', $show_or_not],
- '$show_lastusers' => ['vier_show_lastusers', t('Last users'), $show_lastusers, '', $show_or_not]
+ '$title' => L10n::t("Theme settings"),
+ '$style' => ['vier_style', L10n::t('Set style'), $style, '', $styles],
+ '$show_pages' => ['vier_show_pages', L10n::t('Community Pages'), $show_pages, '', $show_or_not],
+ '$show_profiles' => ['vier_show_profiles', L10n::t('Community Profiles'), $show_profiles, '', $show_or_not],
+ '$show_helpers' => ['vier_show_helpers', L10n::t('Help or @NewHere ?'), $show_helpers, '', $show_or_not],
+ '$show_services' => ['vier_show_services', L10n::t('Connect Services'), $show_services, '', $show_or_not],
+ '$show_friends' => ['vier_show_friends', L10n::t('Find Friends'), $show_friends, '', $show_or_not],
+ '$show_lastusers' => ['vier_show_lastusers', L10n::t('Last users'), $show_lastusers, '', $show_or_not]
]);
return $o;
}
diff --git a/view/theme/vier/theme.php b/view/theme/vier/theme.php
index 57df31aee..482c584be 100644
--- a/view/theme/vier/theme.php
+++ b/view/theme/vier/theme.php
@@ -12,6 +12,7 @@
use Friendica\App;
use Friendica\Content\ForumManager;
use Friendica\Core\Addon;
+use Friendica\Core\L10n;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
@@ -21,8 +22,8 @@ use Friendica\Model\Profile;
require_once "mod/proxy.php";
-function vier_init(App $a) {
-
+function vier_init(App $a)
+{
$a->theme_events_in_profile = false;
$a->set_template_engine('smarty3');
@@ -84,7 +85,7 @@ function cmtBbClose(id) {
EOT;
- if ($a->is_mobile || $a->is_tablet){
+ if ($a->is_mobile || $a->is_tablet) {
$a->page['htmlhead'] .= <<< EOT