From ead9d8623683f8ecdbe9b75bb7fd031d89d54ebe Mon Sep 17 00:00:00 2001 From: Adam Magness Date: Mon, 22 Jan 2018 07:29:50 -0500 Subject: [PATCH] More t() Update more t() calls --- mod/editpost.php | 67 +++++++------ mod/events.php | 66 ++++++------- mod/fbrowser.php | 13 +-- mod/filer.php | 29 +++--- mod/follow.php | 24 ++--- mod/friendica.php | 39 ++++---- mod/fsuggest.php | 16 +--- mod/group.php | 26 ++--- mod/help.php | 9 +- mod/install.php | 146 ++++++++++++++--------------- mod/item.php | 4 +- mod/maintenance.php | 11 ++- mod/openid.php | 2 +- mod/ostatus_subscribe.php | 2 +- mod/repair_ostatus.php | 4 +- mod/update_display.php | 9 +- mod/update_network.php | 9 +- util/README | 2 +- util/global_community_block.php | 7 +- view/theme/duepuntozero/config.php | 49 +++++----- view/theme/frio/config.php | 33 +++---- view/theme/frio/theme.php | 29 +++--- view/theme/quattro/config.php | 14 +-- view/theme/vier/config.php | 32 ++++--- view/theme/vier/theme.php | 71 +++++++------- 25 files changed, 367 insertions(+), 346 deletions(-) diff --git a/mod/editpost.php b/mod/editpost.php index d0f808e61..90a153453 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -39,13 +39,13 @@ function editpost_content(App $a) { } $o .= replace_macros(get_markup_template("section_title.tpl"),[ - '$title' => t('Edit post') + '$title' => L10n::t('Edit post') ]); $tpl = get_markup_template('jot-header.tpl'); $a->page['htmlhead'] .= replace_macros($tpl, [ '$baseurl' => System::baseUrl(), - '$ispublic' => ' ', // t('Visible to everybody'), + '$ispublic' => ' ', // L10n::t('Visible to everybody'), '$geotag' => $geotag, '$nickname' => $a->user['nickname'] ]); @@ -53,7 +53,7 @@ function editpost_content(App $a) { $tpl = get_markup_template('jot-end.tpl'); $a->page['end'] .= replace_macros($tpl, [ '$baseurl' => System::baseUrl(), - '$ispublic' => ' ', // t('Visible to everybody'), + '$ispublic' => ' ', // L10n::t('Visible to everybody'), '$geotag' => $geotag, '$nickname' => $a->user['nickname'] ]); @@ -91,7 +91,7 @@ function editpost_content(App $a) { /* if($mail_enabled) { $selected = (($pubmail_enabled) ? ' checked="checked" ' : ''); $jotnets .= '
' - . t("Post to Email") . '
'; + . L10n::t("Post to Email") . ''; }*/ @@ -106,23 +106,23 @@ function editpost_content(App $a) { '$is_edit' => true, '$return_path' => $_SESSION['return_url'], '$action' => 'item', - '$share' => t('Save'), - '$upload' => t('Upload photo'), - '$shortupload' => t('upload photo'), - '$attach' => t('Attach file'), - '$shortattach' => t('attach file'), - '$weblink' => t('Insert web link'), - '$shortweblink' => t('web link'), - '$video' => t('Insert video link'), - '$shortvideo' => t('video link'), - '$audio' => t('Insert audio link'), - '$shortaudio' => t('audio link'), - '$setloc' => t('Set your location'), - '$shortsetloc' => t('set location'), - '$noloc' => t('Clear browser location'), - '$shortnoloc' => t('clear location'), - '$wait' => t('Please wait'), - '$permset' => t('Permission settings'), + '$share' => L10n::t('Save'), + '$upload' => L10n::t('Upload photo'), + '$shortupload' => L10n::t('upload photo'), + '$attach' => L10n::t('Attach file'), + '$shortattach' => L10n::t('attach file'), + '$weblink' => L10n::t('Insert web link'), + '$shortweblink' => L10n::t('web link'), + '$video' => L10n::t('Insert video link'), + '$shortvideo' => L10n::t('video link'), + '$audio' => L10n::t('Insert audio link'), + '$shortaudio' => L10n::t('audio link'), + '$setloc' => L10n::t('Set your location'), + '$shortsetloc' => L10n::t('set location'), + '$noloc' => L10n::t('Clear browser location'), + '$shortnoloc' => L10n::t('clear location'), + '$wait' => L10n::t('Please wait'), + '$permset' => L10n::t('Permission settings'), '$ptyp' => $itm[0]['type'], '$content' => undo_post_tagging($itm[0]['body']), '$post_id' => $post_id, @@ -130,32 +130,29 @@ function editpost_content(App $a) { '$defloc' => $a->user['default-location'], '$visitor' => 'none', '$pvisit' => 'none', - '$emailcc' => t('CC: email addresses'), - '$public' => t('Public post'), + '$emailcc' => L10n::t('CC: email addresses'), + '$public' => L10n::t('Public post'), '$jotnets' => $jotnets, '$title' => htmlspecialchars($itm[0]['title']), - '$placeholdertitle' => t('Set title'), + '$placeholdertitle' => L10n::t('Set title'), '$category' => file_tag_file_to_list($itm[0]['file'], 'category'), - '$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? t('Categories (comma-separated list)') : ''), - '$emtitle' => t('Example: bob@example.com, mary@example.com'), + '$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? L10n::t('Categories (comma-separated list)') : ''), + '$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'), '$lockstate' => $lockstate, '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)), '$bang' => (($group) ? '!' : ''), '$profile_uid' => $_SESSION['uid'], - '$preview' => t('Preview'), + '$preview' => L10n::t('Preview'), '$jotplugins' => $jotplugins, - '$sourceapp' => t($a->sourcename), - '$cancel' => t('Cancel'), + '$sourceapp' => L10n::t($a->sourcename), + '$cancel' => L10n::t('Cancel'), '$rand_num' => random_digits(12), //jot nav tab (used in some themes) - '$message' => t('Message'), - '$browser' => t('Browser'), - '$shortpermset' => t('permissions'), + '$message' => L10n::t('Message'), + '$browser' => L10n::t('Browser'), + '$shortpermset' => L10n::t('permissions'), ]); return $o; - } - - diff --git a/mod/events.php b/mod/events.php index 0c72742dd..ac5ae6a38 100644 --- a/mod/events.php +++ b/mod/events.php @@ -102,7 +102,7 @@ function events_post(App $a) { if (strcmp($finish, $start) < 0 && !$nofinish) { notice(L10n::t('Event can not end before it has started.') . EOL); if (intval($_REQUEST['preview'])) { - echo t('Event can not end before it has started.'); + echo L10n::t('Event can not end before it has started.'); killme(); } goaway($onerror_url); @@ -111,7 +111,7 @@ function events_post(App $a) { if ((! $summary) || ($start === NULL_DATE)) { notice(L10n::t('Event title and start time are required.') . EOL); if (intval($_REQUEST['preview'])) { - echo t('Event title and start time are required.'); + echo L10n::t('Event title and start time are required.'); killme(); } goaway($onerror_url); @@ -389,20 +389,20 @@ function events_content(App $a) { $o = replace_macros($tpl, [ '$baseurl' => System::baseUrl(), '$tabs' => $tabs, - '$title' => t('Events'), - '$view' => t('View'), - '$new_event' => [System::baseUrl() . '/events/new', t('Create New Event'), '', ''], - '$previous' => [System::baseUrl() . '/events/$prevyear/$prevmonth', t('Previous'), '', ''], - '$next' => [System::baseUrl() . '/events/$nextyear/$nextmonth', t('Next'), '', ''], + '$title' => L10n::t('Events'), + '$view' => L10n::t('View'), + '$new_event' => [System::baseUrl() . '/events/new', L10n::t('Create New Event'), '', ''], + '$previous' => [System::baseUrl() . '/events/$prevyear/$prevmonth', L10n::t('Previous'), '', ''], + '$next' => [System::baseUrl() . '/events/$nextyear/$nextmonth', L10n::t('Next'), '', ''], '$calendar' => cal($y, $m, $links, ' eventcal'), '$events' => $events, - '$today' => t('today'), - '$month' => t('month'), - '$week' => t('week'), - '$day' => t('day'), - '$list' => t('list'), + '$today' => L10n::t('today'), + '$month' => L10n::t('month'), + '$week' => L10n::t('week'), + '$day' => L10n::t('day'), + '$list' => L10n::t('list'), ]); if (x($_GET, 'id')) { @@ -506,34 +506,34 @@ function events_content(App $a) { '$deny_cid' => json_encode($perms['deny_cid']), '$deny_gid' => json_encode($perms['deny_gid']), - '$title' => t('Event details'), - '$desc' => t('Starting date and Title are required.'), - '$s_text' => t('Event Starts:') . ' *', - '$s_dsel' => datetimesel(new DateTime(), DateTime::createFromFormat('Y', $syear+5), DateTime::createFromFormat('Y-m-d H:i', "$syear-$smonth-$sday $shour:$sminute"), t('Event Starts:'), 'start_text', true, true, '', '', true), - '$n_text' => t('Finish date/time is not known or not relevant'), + '$title' => L10n::t('Event details'), + '$desc' => L10n::t('Starting date and Title are required.'), + '$s_text' => L10n::t('Event Starts:') . ' *', + '$s_dsel' => datetimesel(new DateTime(), DateTime::createFromFormat('Y', $syear+5), DateTime::createFromFormat('Y-m-d H:i', "$syear-$smonth-$sday $shour:$sminute"), L10n::t('Event Starts:'), 'start_text', true, true, '', '', true), + '$n_text' => L10n::t('Finish date/time is not known or not relevant'), '$n_checked' => $n_checked, - '$f_text' => t('Event Finishes:'), - '$f_dsel' => datetimesel(new DateTime(), DateTime::createFromFormat('Y', $fyear+5), DateTime::createFromFormat('Y-m-d H:i', "$fyear-$fmonth-$fday $fhour:$fminute"), t('Event Finishes:'), 'finish_text', true, true, 'start_text'), - '$a_text' => t('Adjust for viewer timezone'), + '$f_text' => L10n::t('Event Finishes:'), + '$f_dsel' => datetimesel(new DateTime(), DateTime::createFromFormat('Y', $fyear+5), DateTime::createFromFormat('Y-m-d H:i', "$fyear-$fmonth-$fday $fhour:$fminute"), L10n::t('Event Finishes:'), 'finish_text', true, true, 'start_text'), + '$a_text' => L10n::t('Adjust for viewer timezone'), '$a_checked' => $a_checked, - '$d_text' => t('Description:'), + '$d_text' => L10n::t('Description:'), '$d_orig' => $d_orig, - '$l_text' => t('Location:'), + '$l_text' => L10n::t('Location:'), '$l_orig' => $l_orig, - '$t_text' => t('Title:') . ' *', + '$t_text' => L10n::t('Title:') . ' *', '$t_orig' => $t_orig, - '$summary' => ['summary', t('Title:'), $t_orig, '', '*'], - '$sh_text' => t('Share this event'), - '$share' => ['share', t('Share this event'), $sh_checked, '', $sh_disabled], + '$summary' => ['summary', L10n::t('Title:'), $t_orig, '', '*'], + '$sh_text' => L10n::t('Share this event'), + '$share' => ['share', L10n::t('Share this event'), $sh_checked, '', $sh_disabled], '$sh_checked' => $sh_checked, - '$nofinish' => ['nofinish', t('Finish date/time is not known or not relevant'), $n_checked], - '$adjust' => ['adjust', t('Adjust for viewer timezone'), $a_checked], - '$preview' => t('Preview'), + '$nofinish' => ['nofinish', L10n::t('Finish date/time is not known or not relevant'), $n_checked], + '$adjust' => ['adjust', L10n::t('Adjust for viewer timezone'), $a_checked], + '$preview' => L10n::t('Preview'), '$acl' => $acl, - '$submit' => t('Submit'), - '$basic' => t('Basic'), - '$advanced' => t('Advanced'), - '$permissions' => t('Permissions'), + '$submit' => L10n::t('Submit'), + '$basic' => L10n::t('Basic'), + '$advanced' => L10n::t('Advanced'), + '$permissions' => L10n::t('Permissions'), ]); diff --git a/mod/fbrowser.php b/mod/fbrowser.php index 992f2633f..05a938cb2 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -6,6 +6,7 @@ */ use Friendica\App; +use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Object\Image; @@ -30,7 +31,7 @@ function fbrowser_content(App $a) { switch ($a->argv[1]) { case "image": - $path = [["", t("Photos")]]; + $path = [["", L10n::t("Photos")]]; $albums = false; $sql_extra = ""; $sql_extra2 = " ORDER BY created DESC LIMIT 0, 10"; @@ -39,7 +40,7 @@ function fbrowser_content(App $a) { $albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' ", intval(local_user()), dbesc('Contact Photos'), - dbesc( t('Contact Photos')) + dbesc(L10n::t('Contact Photos')) ); function _map_folder1($el){return [bin2hex($el['album']),$el['album']];}; @@ -61,7 +62,7 @@ function fbrowser_content(App $a) { GROUP BY `resource-id` $sql_extra2", intval(local_user()), dbesc('Contact Photos'), - dbesc( t('Contact Photos')) + dbesc(L10n::t('Contact Photos')) ); function _map_files1($rr){ @@ -94,7 +95,7 @@ function fbrowser_content(App $a) { '$path' => $path, '$folders' => $albums, '$files' => $files, - '$cancel' => t('Cancel'), + '$cancel' => L10n::t('Cancel'), '$nickname' => $a->user['nickname'], ]); @@ -121,10 +122,10 @@ function fbrowser_content(App $a) { $o = replace_macros($tpl, [ '$type' => 'file', '$baseurl' => System::baseUrl(), - '$path' => [ [ "", t("Files")] ], + '$path' => [ [ "", L10n::t("Files")] ], '$folders' => false, '$files' =>$files, - '$cancel' => t('Cancel'), + '$cancel' => L10n::t('Cancel'), '$nickname' => $a->user['nickname'], ]); diff --git a/mod/filer.php b/mod/filer.php index f729a78e6..177b80acb 100644 --- a/mod/filer.php +++ b/mod/filer.php @@ -1,14 +1,17 @@ ['term', t("Save to Folder:"), '', '', $filetags, t('- select -')], - '$submit' => t('Save'), + '$field' => ['term', L10n::t("Save to Folder:"), '', '', $filetags, L10n::t('- select -')], + '$submit' => L10n::t('Save'), ]); echo $o; diff --git a/mod/follow.php b/mod/follow.php index b568d5736..f0644c919 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -62,7 +62,7 @@ function follow_content(App $a) { $uid = local_user(); $url = notags(trim($_REQUEST['url'])); - $submit = t('Submit Request'); + $submit = L10n::t('Submit Request'); // There is a current issue. It seems as if you can't start following a Friendica that is following you // With Diaspora this works - but Friendica is special, it seems ... @@ -142,38 +142,38 @@ function follow_content(App $a) { $r[0]["about"] = ""; } - $header = t("Connect/Follow"); + $header = L10n::t("Connect/Follow"); $o = replace_macros($tpl,[ '$header' => htmlentities($header), //'$photo' => proxy_url($ret["photo"], false, PROXY_SIZE_SMALL), '$desc' => "", - '$pls_answer' => t('Please answer the following:'), - '$does_know_you' => ['knowyou', sprintf(t('Does %s know you?'),$ret["name"]), false, '', [t('No'), t('Yes')]], - '$add_note' => t('Add a personal note:'), + '$pls_answer' => L10n::t('Please answer the following:'), + '$does_know_you' => ['knowyou', sprintf(t('Does %s know you?'),$ret["name"]), false, '', [L10n::t('No'), L10n::t('Yes')]], + '$add_note' => L10n::t('Add a personal note:'), '$page_desc' => "", '$friendica' => "", '$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' => $ret["name"], '$url' => $ret["url"], '$zrl' => Profile::zrl($ret["url"]), - '$url_label' => t("Profile URL"), + '$url_label' => L10n::t("Profile URL"), '$myaddr' => $myaddr, '$request' => $request, /*'$location' => bbcode($r[0]["location"]), - '$location_label' => t("Location:"), + '$location_label' => L10n::t("Location:"), '$about' => bbcode($r[0]["about"], false, false), - '$about_label' => t("About:"), */ + '$about_label' => L10n::t("About:"), */ '$keywords' => $r[0]["keywords"], - '$keywords_label' => t("Tags:") + '$keywords_label' => L10n::t("Tags:") ]); $a->page['aside'] = ""; @@ -182,7 +182,7 @@ function follow_content(App $a) { if ($gcontact_id <> 0) { $o .= replace_macros(get_markup_template('section_title.tpl'), - ['$title' => t('Status Messages and Posts') + ['$title' => L10n::t('Status Messages and Posts') ]); // Show last public posts diff --git a/mod/friendica.php b/mod/friendica.php index 318d309e3..c6cfdbdcc 100644 --- a/mod/friendica.php +++ b/mod/friendica.php @@ -1,17 +1,21 @@ argv[1] == "json"){ +function friendica_init(App $a) +{ + if ($a->argv[1] == "json") { $register_policy = ['REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN']; $sql_extra = ''; - if (x($a->config,'admin_nickname')) { + if (x($a->config, 'admin_nickname')) { $sql_extra = sprintf(" AND `nickname` = '%s' ", dbesc($a->config['admin_nickname'])); } if (isset($a->config['admin_email']) && $a->config['admin_email']!='') { @@ -30,7 +34,7 @@ function friendica_init(App $a) { if (is_array($a->addons) && count($a->addons)) { $r = q("SELECT * FROM `addon` WHERE `hidden` = 0"); if (DBM::is_result($r)) { - foreach($r as $rr) { + foreach ($r as $rr) { $visible_addons[] = $rr['name']; } } @@ -57,7 +61,7 @@ function friendica_init(App $a) { 'admin' => $admin, 'site_name' => $a->config['sitename'], 'platform' => FRIENDICA_PLATFORM, - 'info' => ((x($a->config,'info')) ? $a->config['info'] : ''), + 'info' => ((x($a->config, 'info')) ? $a->config['info'] : ''), 'no_scrape_url' => System::baseUrl().'/noscrape' ]; @@ -66,36 +70,37 @@ function friendica_init(App $a) { } } -function friendica_content(App $a) { +function friendica_content(App $a) +{ $o = '

Friendica

' . PHP_EOL; $o .= '

'; - $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 .= '

' . PHP_EOL; $o .= '

'; - $o .= t('Bug reports and issues: please visit') . ' ' . ''.t('the bugtracker at github').''; + $o .= L10n::t('Bug reports and issues: please visit') . ' ' . ''.t('the bugtracker at github').''; $o .= '

' . PHP_EOL; $o .= '

'; - $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com'); + $o .= L10n::t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com'); $o .= '

' . PHP_EOL; $visible_addons = []; if (is_array($a->addons) && count($a->addons)) { $r = q("SELECT * FROM `addon` WHERE `hidden` = 0"); if (DBM::is_result($r)) { - foreach($r as $rr) { + foreach ($r as $rr) { $visible_addons[] = $rr['name']; } } } if (count($visible_addons)) { - $o .= '

' . t('Installed addons/addons/apps:') . '

' . PHP_EOL; + $o .= '

' . L10n::t('Installed addons/addons/apps:') . '

' . PHP_EOL; $sorted = $visible_addons; $s = ''; sort($sorted); @@ -109,13 +114,13 @@ function friendica_content(App $a) { } $o .= '
' . $s . '
' . PHP_EOL; } else { - $o .= '

' . t('No installed addons/addons/apps') . '

' . PHP_EOL; + $o .= '

' . L10n::t('No installed addons/addons/apps') . '

' . PHP_EOL; } $blocklist = Config::get('system', 'blocklist'); if (count($blocklist)) { - $o .= '

' . t('On this server the following remote servers are blocked.') . '

' . PHP_EOL; - $o .= '' . PHP_EOL; + $o .= '

' . L10n::t('On this server the following remote servers are blocked.') . '

' . PHP_EOL; + $o .= '
' . t('Blocked domain') . '' . t('Reason for the block') . '
' . PHP_EOL; foreach ($blocklist as $b) { $o .= '' . 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
' . L10n::t('Blocked domain') . '' . L10n::t('Reason for the block') . '
' . $b['domain'] .'' . $b['reason'] . '