diff --git a/blackout/blackout.php b/blackout/blackout.php index 1c34862b2..28e5567f7 100644 --- a/blackout/blackout.php +++ b/blackout/blackout.php @@ -51,6 +51,7 @@ use Friendica\Core\Config; use Friendica\Core\Addon; +use Friendica\Core\L10n; function blackout_install() { Addon::registerHook('page_header', 'addon/blackout/blackout.php', 'blackout_redirect'); @@ -98,7 +99,7 @@ function blackout_addon_admin(&$a, &$o) { $t = get_markup_template( "admin.tpl", "addon/blackout/" ); $o = replace_macros($t, [ - '$submit' => t('Save Settings'), + '$submit' => L10n::t('Save Settings'), '$rurl' => ["rurl", "Redirect URL", $myurl, "all your visitors from the web will be redirected to this URL"], '$startdate' => ["startdate", "Begin of the Blackout
(YYYY-MM-DD hh:mm)", $mystart, "format is YYYY year, MM month, DD day, hh hour and mm minute"], '$enddate' => ["enddate", "End of the Blackout
(YYYY-MM-DD hh:mm)", $myend, ""], diff --git a/blockem/blockem.php b/blockem/blockem.php index d943f26c6..5dd7f4ec9 100644 --- a/blockem/blockem.php +++ b/blockem/blockem.php @@ -7,9 +7,11 @@ * */ use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; -function blockem_install() { +function blockem_install() +{ Addon::registerHook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body'); Addon::registerHook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item'); Addon::registerHook('addon_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings'); @@ -19,7 +21,8 @@ function blockem_install() { Addon::registerHook('enotify_store', 'addon/blockem/blockem.php', 'blockem_enotify_store'); } -function blockem_uninstall() { +function blockem_uninstall() +{ Addon::unregisterHook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body'); Addon::unregisterHook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item'); Addon::unregisterHook('addon_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings'); @@ -45,19 +48,19 @@ function blockem_addon_settings(&$a, &$s) $words = ''; $s .= ''; - $s .= '

' . t('"Blockem"') . '

'; + $s .= '

' . L10n::t('"Blockem"') . '

'; $s .= '
'; $s .= ''; + $s .= '
'; return; @@ -70,7 +73,7 @@ function blockem_addon_settings_post(&$a,&$b) { if($_POST['blockem-submit']) { PConfig::set(local_user(),'blockem','words',trim($_POST['blockem-words'])); - info( t('BLOCKEM Settings saved.') . EOL); + info(L10n::t('BLOCKEM Settings saved.') . EOL); } } @@ -133,7 +136,7 @@ function blockem_prepare_body(&$a,&$b) { } if($found) { $rnd = random_string(8); - $b['html'] = ''; + $b['html'] = ''; } } @@ -186,9 +189,9 @@ function blockem_item_photo_menu(&$a,&$b) { } } if($blocked) - $b['menu'][ t('Unblock Author')] = 'javascript:blockemUnblock(\'' . $author . '\');'; + $b['menu'][L10n::t('Unblock Author')] = 'javascript:blockemUnblock(\'' . $author . '\');'; else - $b['menu'][ t('Block Author')] = 'javascript:blockemBlock(\'' . $author . '\');'; + $b['menu'][L10n::t('Block Author')] = 'javascript:blockemBlock(\'' . $author . '\');'; } function blockem_module() {} @@ -220,6 +223,6 @@ function blockem_init(&$a) { } PConfig::set(local_user(),'blockem','words',$words); - info( t('blockem settings updated') . EOL ); + info(L10n::t('blockem settings updated') . EOL ); killme(); } diff --git a/blogger/blogger.php b/blogger/blogger.php index 050aaa7a1..e9813dc2e 100644 --- a/blogger/blogger.php +++ b/blogger/blogger.php @@ -6,6 +6,7 @@ * */ use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function blogger_install() @@ -43,7 +44,7 @@ function blogger_jot_nets(&$a, &$b) $bl_defpost = PConfig::get(local_user(), 'blogger', 'post_by_default'); $selected = ((intval($bl_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' - . t('Post to blogger') . '
'; + . L10n::t('Post to blogger') . ''; } } @@ -74,40 +75,40 @@ function blogger_settings(&$a, &$s) /* Add some HTML to the existing form */ $s .= ''; - $s .= '

'. t('Blogger Export').'

'; + $s .= '

'. L10n::t('Blogger Export').'

'; $s .= '
'; $s .= ''; + $s .= '
'; } @@ -181,7 +182,7 @@ function blogger_send(&$a, &$b) if ($bl_username && $bl_password && $bl_blog) { require_once('include/bbcode.php'); - $title = '' . (($b['title']) ? $b['title'] : t('Post from Friendica')) . ''; + $title = '' . (($b['title']) ? $b['title'] : L10n::t('Post from Friendica')) . ''; $post = $title . bbcode($b['body']); $post = xmlify($post); diff --git a/buffer/buffer.php b/buffer/buffer.php index 9c36f7c44..02dd7ffbc 100644 --- a/buffer/buffer.php +++ b/buffer/buffer.php @@ -10,6 +10,7 @@ require 'addon/buffer/bufferapp.php'; use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function buffer_install() { @@ -33,7 +34,7 @@ function buffer_module() {} function buffer_content(&$a) { if(! local_user()) { - notice( t('Permission denied.') . EOL); + notice(L10n::t('Permission denied.') . EOL); return ''; } @@ -60,10 +61,10 @@ function buffer_addon_admin(&$a, &$o) $t = get_markup_template("admin.tpl", "addon/buffer/"); $o = replace_macros($t, [ - '$submit' => t('Save Settings'), + '$submit' => L10n::t('Save Settings'), // name, label, value, help, [extra values] - '$client_id' => ['client_id', t('Client ID'), Config::get('buffer', 'client_id'), ''], - '$client_secret' => ['client_secret', t('Client Secret'), Config::get('buffer', 'client_secret'), ''], + '$client_id' => ['client_id', L10n::t('Client ID'), Config::get('buffer', 'client_id'), ''], + '$client_secret' => ['client_secret', L10n::t('Client Secret'), Config::get('buffer', 'client_secret'), ''], ]); } function buffer_addon_admin_post(&$a) @@ -72,13 +73,13 @@ function buffer_addon_admin_post(&$a) $client_secret = ((x($_POST, 'client_secret')) ? notags(trim($_POST['client_secret'])): ''); Config::set('buffer', 'client_id', $client_id); Config::set('buffer', 'client_secret', $client_secret); - info(t('Settings updated.'). EOL); + info(L10n::t('Settings updated.'). EOL); } function buffer_connect(&$a) { if (isset($_REQUEST["error"])) { - $o = t('Error when registering buffer connection:')." ".$_REQUEST["error"]; + $o = L10n::t('Error when registering buffer connection:')." ".$_REQUEST["error"]; return $o; } // Start a session. This is necessary to hold on to a few keys the callback script will also need @@ -97,8 +98,8 @@ function buffer_connect(&$a) { $o .= 'Connect to Buffer!'; } else { logger("buffer_connect: authenticated"); - $o .= t("You are now authenticated to buffer. "); - $o .= '
'.t("return to the connector page").''; + $o .= L10n::t("You are now authenticated to buffer. "); + $o .= '
'.L10n::t("return to the connector page").''; PConfig::set(local_user(), 'buffer','access_token', $buffer->access_token); } @@ -114,7 +115,7 @@ function buffer_jot_nets(&$a,&$b) { $buffer_defpost = PConfig::get(local_user(),'buffer','post_by_default'); $selected = ((intval($buffer_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' - . t('Post to Buffer') . '
'; + . L10n::t('Post to Buffer') . ''; } } @@ -139,11 +140,11 @@ function buffer_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= ''; - $s .= '

'. t('Buffer Export').'

'; + $s .= '

'. L10n::t('Buffer Export').'

'; $s .= '
'; $s .= ''; } } @@ -68,36 +69,36 @@ function dwpost_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= ''; - $s .= '

'. t("Dreamwidth Export").'

'; + $s .= '

'. L10n::t("Dreamwidth Export").'

'; $s .= '
'; $s .= ''; + $s .= '
'; } diff --git a/forumdirectory/forumdirectory.php b/forumdirectory/forumdirectory.php index 97908f8d7..03e770022 100644 --- a/forumdirectory/forumdirectory.php +++ b/forumdirectory/forumdirectory.php @@ -1,5 +1,4 @@ ' . t('Forum Directory') . ''; + $b['app_menu'][] = '
' . L10n::t('Forum Directory') . '
'; } function forumdirectory_init(&$a) @@ -59,7 +61,7 @@ function forumdirectory_post(&$a) function forumdirectory_content(&$a) { if ((Config::get('system', 'block_public')) && (!local_user()) && (!remote_user())) { - notice(t('Public access denied.') . EOL); + notice(L10n::t('Public access denied.') . EOL); return; } @@ -78,7 +80,7 @@ function forumdirectory_content(&$a) $gdirpath = Config::get('system', 'directory'); if (strlen($gdirpath)) { $globaldir = ''; + . Profile::zrl($gdirpath, true) . '">' . L10n::t('Global Directory') . ''; } $admin = ''; @@ -86,11 +88,11 @@ function forumdirectory_content(&$a) $o .= replace_macros($tpl, [ '$search' => $search, '$globaldir' => $globaldir, - '$desc' => t('Find on this site'), + '$desc' => L10n::t('Find on this site'), '$admin' => $admin, - '$finding' => (strlen($search) ? '

' . t('Finding: ') . "'" . $search . "'" . '

' : ""), - '$sitedir' => t('Site Directory'), - '$submit' => t('Find') + '$finding' => (strlen($search) ? '

' . L10n::t('Finding: ') . "'" . $search . "'" . '

' : ""), + '$sitedir' => L10n::t('Site Directory'), + '$submit' => L10n::t('Find') ]); $sql_extra = ''; @@ -148,11 +150,11 @@ function forumdirectory_content(&$a) } if (strlen($rr['dob']) && ($years = age($rr['dob'], $rr['timezone'], '')) != 0) { - $details .= '
' . t('Age: ') . $years; + $details .= '
' . L10n::t('Age: ') . $years; } if (strlen($rr['gender'])) { - $details .= '
' . t('Gender: ') . $rr['gender']; + $details .= '
' . L10n::t('Gender: ') . $rr['gender']; } switch ($rr['page-flags']) { @@ -172,13 +174,13 @@ function forumdirectory_content(&$a) || x($profile, 'postal-code') == 1 || x($profile, 'country-name') == 1 ) { - $location = t('Location:'); + $location = L10n::t('Location:'); } - $gender = x($profile, 'gender') == 1 ? t('Gender:') : false; - $marital = x($profile, 'marital') == 1 ? t('Status:') : false; - $homepage = x($profile, 'homepage') == 1 ? t('Homepage:') : false; - $about = x($profile, 'about') == 1 ? t('About:') : false; + $gender = x($profile, 'gender') == 1 ? L10n::t('Gender:') : false; + $marital = x($profile, 'marital') == 1 ? L10n::t('Status:') : false; + $homepage = x($profile, 'homepage') == 1 ? L10n::t('Homepage:') : false; + $about = x($profile, 'about') == 1 ? L10n::t('About:') : false; $tpl = get_markup_template('forumdirectory_item.tpl', 'addon/forumdirectory/'); @@ -205,7 +207,7 @@ function forumdirectory_content(&$a) $o .= "
\r\n"; $o .= paginate($a); } else { - info(t("No entries \x28some entries may be hidden\x29.") . EOL); + info(L10n::t("No entries \x28some entries may be hidden\x29.") . EOL); } return $o; diff --git a/fromapp/fromapp.php b/fromapp/fromapp.php index 32234d159..afdb087b3 100644 --- a/fromapp/fromapp.php +++ b/fromapp/fromapp.php @@ -7,42 +7,43 @@ * */ use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; -function fromapp_install() { - +function fromapp_install() +{ Addon::registerHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook'); Addon::registerHook('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings'); Addon::registerHook('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post'); - logger("installed fromapp"); } -function fromapp_uninstall() { - +function fromapp_uninstall() +{ Addon::unregisterHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook'); Addon::unregisterHook('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings'); Addon::unregisterHook('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post'); - - logger("removed fromapp"); } -function fromapp_settings_post($a,$post) { - if(! local_user() || (! x($_POST,'fromapp-submit'))) +function fromapp_settings_post($a, $post) +{ + if (!local_user() || (! x($_POST, 'fromapp-submit'))) { return; + } - PConfig::set(local_user(),'fromapp','app',$_POST['fromapp-input']); - PConfig::set(local_user(),'fromapp','force',intval($_POST['fromapp-force'])); + PConfig::set(local_user(), 'fromapp', 'app', $_POST['fromapp-input']); + PConfig::set(local_user(), 'fromapp', 'force', intval($_POST['fromapp-force'])); - info( t('Fromapp settings updated.') . EOL); + info(L10n::t('Fromapp settings updated.') . EOL); } -function fromapp_settings(&$a,&$s) { - - if(! local_user()) +function fromapp_settings(&$a, &$s) +{ + if (!local_user()) { return; + } /* Add our stylesheet to the page so we can make our settings look nice */ @@ -50,9 +51,9 @@ function fromapp_settings(&$a,&$s) { /* Get the current state of our config variable */ - $fromapp = PConfig::get(local_user(),'fromapp', 'app', ''); + $fromapp = PConfig::get(local_user(), 'fromapp', 'app', ''); - $force = intval(PConfig::get(local_user(),'fromapp','force')); + $force = intval(PConfig::get(local_user(), 'fromapp', 'force')); $force_enabled = (($force) ? ' checked="checked" ' : ''); @@ -60,26 +61,25 @@ function fromapp_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= ''; - $s .= '

' . t('FromApp Settings') . '

'; + $s .= '

' . L10n::t('FromApp Settings') . '

'; $s .= '
'; $s .= ''; - + $s .= '
'; } function fromapp_post_hook(&$a, &$item) diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index c028ea852..94ff98340 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -11,6 +11,7 @@ define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Object\Image; @@ -49,27 +50,27 @@ function fromgplus_addon_settings(&$a,&$s) { $account = PConfig::get(local_user(),'fromgplus','account'); $s .= ''; - $s .= '

'. t('Google+ Mirror').'

'; + $s .= '

'. L10n::t('Google+ Mirror').'

'; $s .= '
'; $s .= ''; $s .= ''; return; @@ -90,7 +91,7 @@ function fromgplus_addon_settings_post(&$a,&$b) { if (!$enable) PConfig::delete(local_user(),'fromgplus','lastdate'); - info( t('Google+ Import Settings saved.') . EOL); + info(L10n::t('Google+ Import Settings saved.') . EOL); } } @@ -99,8 +100,8 @@ function fromgplus_addon_admin(&$a, &$o) $t = get_markup_template("admin.tpl", "addon/fromgplus/"); $o = replace_macros($t, [ - '$submit' => t('Save Settings'), - '$key' => ['key', t('Key'), trim(Config::get('fromgplus', 'key')), t('')], + '$submit' => L10n::t('Save Settings'), + '$key' => ['key', L10n::t('Key'), trim(Config::get('fromgplus', 'key')), L10n::t('')], ]); } @@ -108,7 +109,7 @@ function fromgplus_addon_admin_post(&$a) { $key = ((x($_POST, 'key')) ? trim($_POST['key']) : ''); Config::set('fromgplus', 'key', $key); - info(t('Settings updated.'). EOL); + info(L10n::t('Settings updated.'). EOL); } function fromgplus_cron($a,$b) { diff --git a/geocoordinates/geocoordinates.php b/geocoordinates/geocoordinates.php index fa72c2a87..c96f40e00 100644 --- a/geocoordinates/geocoordinates.php +++ b/geocoordinates/geocoordinates.php @@ -8,6 +8,7 @@ use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; +use Friendica\Core\L10n; function geocoordinates_install() { @@ -87,9 +88,9 @@ function geocoordinates_addon_admin(&$a, &$o) $t = get_markup_template("admin.tpl", "addon/geocoordinates/"); $o = replace_macros($t, [ - '$submit' => t('Save Settings'), - '$api_key' => ['api_key', t('API Key'), Config::get('geocoordinates', 'api_key'), ''], - '$language' => ['language', t('Language code (IETF format)'), Config::get('geocoordinates', 'language'), ''], + '$submit' => L10n::t('Save Settings'), + '$api_key' => ['api_key', L10n::t('API Key'), Config::get('geocoordinates', 'api_key'), ''], + '$language' => ['language', L10n::t('Language code (IETF format)'), Config::get('geocoordinates', 'language'), ''], ]); } @@ -100,5 +101,5 @@ function geocoordinates_addon_admin_post(&$a) $language = ((x($_POST, 'language')) ? notags(trim($_POST['language'])) : ''); Config::set('geocoordinates', 'language', $language); - info(t('Settings updated.'). EOL); + info(L10n::t('Settings updated.'). EOL); } diff --git a/geonames/geonames.php b/geonames/geonames.php index 45d8fde57..eb5a0c872 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -21,6 +21,7 @@ */ use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function geonames_install() { @@ -142,7 +143,7 @@ function geonames_addon_admin_post($a,$post) { return; PConfig::set(local_user(),'geonames','enable',intval($_POST['geonames'])); - info( t('Geonames settings updated.') . EOL); + info(L10n::t('Geonames settings updated.') . EOL); } @@ -178,14 +179,14 @@ function geonames_addon_admin(&$a,&$s) { /* Add some HTML to the existing form */ $s .= '
'; - $s .= '

' . t('Geonames Settings') . '

'; + $s .= '

' . L10n::t('Geonames Settings') . '

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; /* provide a submit button */ - $s .= '
'; + $s .= '
'; } diff --git a/gnot/gnot.php b/gnot/gnot.php index 38fb3069a..ccc2c77a8 100644 --- a/gnot/gnot.php +++ b/gnot/gnot.php @@ -8,6 +8,7 @@ * */ use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function gnot_install() { @@ -46,7 +47,7 @@ function gnot_settings_post($a,$post) { return; PConfig::set(local_user(),'gnot','enable',intval($_POST['gnot'])); - info( t('Gnot settings updated.') . EOL); + info(L10n::t('Gnot settings updated.') . EOL); } @@ -77,16 +78,16 @@ function gnot_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= '
'; - $s .= '

' . t('Gnot Settings') . '

'; + $s .= '

' . L10n::t('Gnot Settings') . '

'; $s .= '
'; - $s .= '
' . t("Allows threading of email comment notifications on Gmail and anonymising the subject line.") . '
'; - $s .= ''; + $s .= '
' . L10n::t("Allows threading of email comment notifications on Gmail and anonymising the subject line.") . '
'; + $s .= ''; $s .= ''; $s .= '
'; /* provide a submit button */ - $s .= '
'; + $s .= '
'; } @@ -95,6 +96,5 @@ function gnot_enotify_mail(&$a,&$b) { if((! $b['uid']) || (! intval(PConfig::get($b['uid'], 'gnot','enable')))) return; if($b['type'] == NOTIFY_COMMENT) - $b['subject'] = sprintf( t('[Friendica:Notify] Comment to conversation #%d'), $b['parent']); + $b['subject'] = sprintf(L10n::t('[Friendica:Notify] Comment to conversation #%d'), $b['parent']); } - diff --git a/gravatar/gravatar.php b/gravatar/gravatar.php index 840b361b4..a765a2e07 100644 --- a/gravatar/gravatar.php +++ b/gravatar/gravatar.php @@ -7,6 +7,7 @@ */ use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; /** * Installs the addon hook @@ -70,11 +71,11 @@ function gravatar_addon_admin (&$a, &$o) { // Available options for the select boxes $default_avatars = [ - 'mm' => t('generic profile image'), - 'identicon' => t('random geometric pattern'), - 'monsterid' => t('monster face'), - 'wavatar' => t('computer generated face'), - 'retro' => t('retro arcade style face'), + 'mm' => L10n::t('generic profile image'), + 'identicon' => L10n::t('random geometric pattern'), + 'monsterid' => L10n::t('monster face'), + 'wavatar' => L10n::t('computer generated face'), + 'retro' => L10n::t('retro arcade style face'), ]; $ratings = [ 'g' => 'g', @@ -88,15 +89,15 @@ function gravatar_addon_admin (&$a, &$o) { dbesc('libravatar') ); if (count($r)) { - $o = '
' .t('Information') .'

' .t('Libravatar addon is installed, too. Please disable Libravatar addon or this Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar.') .'



'; + $o = '
' .L10n::t('Information') .'

' .L10n::t('Libravatar addon is installed, too. Please disable Libravatar addon or this Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar.') .'



'; } // output Gravatar settings $o .= ''; $o .= replace_macros( $t, [ - '$submit' => t('Save Settings'), - '$default_avatar' => ['avatar', t('Default avatar image'), $default_avatar, t('Select default avatar image if none was found at Gravatar. See README'), $default_avatars], - '$rating' => ['rating', t('Rating of images'), $rating, t('Select the appropriate avatar rating for your site. See README'), $ratings], + '$submit' => L10n::t('Save Settings'), + '$default_avatar' => ['avatar', L10n::t('Default avatar image'), $default_avatar, L10n::t('Select default avatar image if none was found at Gravatar. See README'), $default_avatars], + '$rating' => ['rating', L10n::t('Rating of images'), $rating, L10n::t('Select the appropriate avatar rating for your site. See README'), $ratings], ]); } @@ -110,6 +111,5 @@ function gravatar_addon_admin_post (&$a) { $rating = ((x($_POST, 'rating')) ? notags(trim($_POST['rating'])) : 'g'); Config::set('gravatar', 'default_img', $default_avatar); Config::set('gravatar', 'rating', $rating); - info( t('Gravatar settings updated.') .EOL); + info(L10n::t('Gravatar settings updated.') .EOL); } -?> diff --git a/group_text/group_text.php b/group_text/group_text.php index d5163e739..4c0cb14a9 100644 --- a/group_text/group_text.php +++ b/group_text/group_text.php @@ -6,6 +6,7 @@ * Author: Thomas Willingham */ use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function group_text_install() { @@ -42,7 +43,7 @@ function group_text_settings_post($a,$post) { return; PConfig::set(local_user(),'system','groupedit_image_limit',intval($_POST['group_text'])); - info( t('Group Text settings updated.') . EOL); + info(L10n::t('Group Text settings updated.') . EOL); } @@ -72,14 +73,14 @@ function group_text_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= '
'; - $s .= '

' . t('Group Text') . '

'; + $s .= '

' . L10n::t('Group Text') . '

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; /* provide a submit button */ - $s .= '
'; + $s .= '
'; } diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index 40cc5250c..bdb2b6076 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -12,6 +12,7 @@ require_once 'include/text.php'; use Friendica\App; use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Database\DBM; @@ -51,35 +52,35 @@ function ifttt_settings(App $a, &$s) } $s .= ''; - $s .= '

' . t('IFTTT Mirror') . '

'; + $s .= '

' . L10n::t('IFTTT Mirror') . '

'; $s .= '
'; $s .= ''; } diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index 6df040fe8..c094eee96 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -8,6 +8,7 @@ * Author: Cat Gray */ use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function ijpost_install() { @@ -37,7 +38,7 @@ function ijpost_jot_nets(&$a,&$b) { $ij_defpost = PConfig::get(local_user(),'ijpost','post_by_default'); $selected = ((intval($ij_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' - . t('Post to Insanejournal') . '
'; + . L10n::t('Post to Insanejournal') . ''; } } @@ -67,36 +68,36 @@ function ijpost_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= ''; - $s .= '

'. t("InsaneJournal Export").'

'; + $s .= '

'. L10n::t("InsaneJournal Export").'

'; $s .= '
'; $s .= ''; + $s .= '
'; } diff --git a/impressum/impressum.php b/impressum/impressum.php index df508868d..3a5efbcc7 100644 --- a/impressum/impressum.php +++ b/impressum/impressum.php @@ -7,11 +7,12 @@ * License: 3-clause BSD license */ -require_once('include/bbcode.php'); -require_once('mod/proxy.php'); +require_once 'include/bbcode.php'; +require_once 'mod/proxy.php'; use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; function impressum_install() { Addon::registerHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show'); @@ -46,7 +47,7 @@ function impressum_footer($a, &$b) { } } function impressum_show($a,&$b) { - $b .= '

'.t('Impressum').'

'; + $b .= '

'.L10n::t('Impressum').'

'; $owner = Config::get('impressum', 'owner'); $owner_profile = Config::get('impressum','ownerprofile'); $postal = proxy_parse_html(bbcode(Config::get('impressum', 'postal'), true)); @@ -59,18 +60,18 @@ function impressum_show($a,&$b) { $tmp = $owner; } if (strlen($email)) { - $b .= '

'.t('Site Owner').': '. $tmp .'
'.t('Email Address').': '.$email.'

'; + $b .= '

'.L10n::t('Site Owner').': '. $tmp .'
'.L10n::t('Email Address').': '.$email.'

'; } else { - $b .= '

'.t('Site Owner').': '. $tmp .'

'; + $b .= '

'.L10n::t('Site Owner').': '. $tmp .'

'; } if (strlen($postal)) { - $b .= '

'.t('Postal Address').'
'. $postal .'

'; + $b .= '

'.L10n::t('Postal Address').'
'. $postal .'

'; } if (strlen($notes)) { $b .= '

'.$notes.'

'; } } else { - $b .= '

'.t('The impressum addon needs to be configured!
Please add at least the owner variable to your config file. For other variables please refer to the README file of the addon.').'

'; + $b .= '

'.L10n::t('The impressum addon needs to be configured!
Please add at least the owner variable to your config file. For other variables please refer to the README file of the addon.').'

'; } } @@ -87,17 +88,17 @@ function impressum_addon_admin_post (&$a) { Config::set('impressum','email',strip_tags($email)); Config::set('impressum','notes',strip_tags($notes)); Config::set('impressum','footer_text',strip_tags($footer_text)); - info( t('Settings updated.'). EOL ); + info(L10n::t('Settings updated.'). EOL ); } function impressum_addon_admin (&$a, &$o) { $t = get_markup_template( "admin.tpl", "addon/impressum/" ); $o = replace_macros($t, [ - '$submit' => t('Save Settings'), - '$owner' => ['owner', t('Site Owner'), Config::get('impressum','owner'), t('The page operators name.')], - '$ownerprofile' => ['ownerprofile', t('Site Owners Profile'), Config::get('impressum','ownerprofile'), t('Profile address of the operator.')], - '$postal' => ['postal', t('Postal Address'), Config::get('impressum','postal'), t('How to contact the operator via snail mail. You can use BBCode here.')], - '$notes' => ['notes', t('Notes'), Config::get('impressum','notes'), t('Additional notes that are displayed beneath the contact information. You can use BBCode here.')], - '$email' => ['email', t('Email Address'), Config::get('impressum','email'), t('How to contact the operator via email. (will be displayed obfuscated)')], - '$footer_text' => ['footer_text', t('Footer note'), Config::get('impressum','footer_text'), t('Text for the footer. You can use BBCode here.')], + '$submit' => L10n::t('Save Settings'), + '$owner' => ['owner', L10n::t('Site Owner'), Config::get('impressum','owner'), L10n::t('The page operators name.')], + '$ownerprofile' => ['ownerprofile', L10n::t('Site Owners Profile'), Config::get('impressum','ownerprofile'), L10n::t('Profile address of the operator.')], + '$postal' => ['postal', L10n::t('Postal Address'), Config::get('impressum','postal'), L10n::t('How to contact the operator via snail mail. You can use BBCode here.')], + '$notes' => ['notes', L10n::t('Notes'), Config::get('impressum','notes'), L10n::t('Additional notes that are displayed beneath the contact information. You can use BBCode here.')], + '$email' => ['email', L10n::t('Email Address'), Config::get('impressum','email'), L10n::t('How to contact the operator via email. (will be displayed obfuscated)')], + '$footer_text' => ['footer_text', L10n::t('Footer note'), Config::get('impressum','footer_text'), L10n::t('Text for the footer. You can use BBCode here.')], ]); } diff --git a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php index cdadf030c..e92d34407 100644 --- a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php +++ b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php @@ -6,45 +6,46 @@ * Author: Thomas Willingham */ use Friendica\Core\Addon; +use Friendica\Core\L10n; -function infiniteimprobabilitydrive_install() { -Addon::registerHook('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu'); +function infiniteimprobabilitydrive_install() +{ + Addon::registerHook('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu'); } -function infiniteimprobabilitydrive_uninstall() { -Addon::unregisterHook('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu'); - +function infiniteimprobabilitydrive_uninstall() +{ + Addon::unregisterHook('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu'); } -function infiniteimprobabilitydrive_app_menu($a,&$b) { -$b['app_menu'][] = ''; +function infiniteimprobabilitydrive_app_menu($a, &$b) +{ + $b['app_menu'][] = ''; } -function infiniteimprobabilitydrive_module() { -return; +function infiniteimprobabilitydrive_module() +{ + return; } -function infiniteimprobabilitydrive_content(&$a) { -$baseurl = $a->get_baseurl() . '/addon/infiniteimprobabilitydrive'; -$o = ''; +function infiniteimprobabilitydrive_content(&$a) +{ + $baseurl = $a->get_baseurl() . '/addon/infiniteimprobabilitydrive'; + $o = ''; -$a->page['htmlhead'] .= ''; + $a->page['htmlhead'] .= ''; -$baseurl = $a->get_baseurl(); + $baseurl = $a->get_baseurl(); - - $o .= <<< EOT + $o .= <<< EOT

Try another destination with the Infinite Improbability Drive
' . (($b['location']) ? escape_tags($b['location']) : t('View Larger')) . ''; + $b['html'] .= '&layer=mapnik&marker=' . $lat . '%2C' . $lon . '" style="border: 1px solid black">
' . (($b['location']) ? escape_tags($b['location']) : L10n::t('View Larger')) . ''; logger('generate_map: ' . $b['html'], LOGGER_DATA); - } function openstreetmap_addon_admin(&$a, &$o) { $t = get_markup_template("admin.tpl", "addon/openstreetmap/"); $tmsserver = Config::get('openstreetmap', 'tmsserver'); - if(! $tmsserver) { + if (!$tmsserver) { $tmsserver = 'http://www.openstreetmap.org'; } $nomserver = Config::get('openstreetmap', 'nomserver'); - if(! $nomserver) { + if (!$nomserver) { $nomserver = 'http://nominatim.openstreetmap.org/search.php'; } $zoom = Config::get('openstreetmap', 'zoom'); - if(! $zoom) { + if (!$zoom) { $zoom = 16; } $marker = Config::get('openstreetmap', 'marker'); - if(! $marker) { + if (!$marker) { $marker = 0; } $o = replace_macros($t, [ - '$submit' => t('Submit'), - '$tmsserver' => ['tmsserver', t('Tile Server URL'), $tmsserver, t('A list of public tile servers')], - '$nomserver' => ['nomserver', t('Nominatim (reverse geocoding) Server URL'), $nomserver, t('A list of Nominatim servers')], - '$zoom' => ['zoom', t('Default zoom'), $zoom, t('The default zoom level. (1:world, 18:highest, also depends on tile server)')], - '$marker' => ['marker', t('Include marker on map'), $marker, t('Include a marker on the map.')], + '$submit' => L10n::t('Submit'), + '$tmsserver' => ['tmsserver', L10n::t('Tile Server URL'), $tmsserver, L10n::t('A list of public tile servers')], + '$nomserver' => ['nomserver', L10n::t('Nominatim (reverse geocoding) Server URL'), $nomserver, L10n::t('A list of Nominatim servers')], + '$zoom' => ['zoom', L10n::t('Default zoom'), $zoom, L10n::t('The default zoom level. (1:world, 18:highest, also depends on tile server)')], + '$marker' => ['marker', L10n::t('Include marker on map'), $marker, L10n::t('Include a marker on the map.')], ]); } @@ -202,5 +201,5 @@ function openstreetmap_addon_admin_post(&$a) Config::set('openstreetmap', 'nomserver', $urlnom); Config::set('openstreetmap', 'zoom', $zoom); Config::set('openstreetmap', 'marker', $marker); - info( t('Settings updated.') . EOL); + info(L10n::t('Settings updated.') . EOL); } diff --git a/pageheader/pageheader.php b/pageheader/pageheader.php index 96ad36301..7b6924167 100644 --- a/pageheader/pageheader.php +++ b/pageheader/pageheader.php @@ -9,6 +9,7 @@ */ use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; function pageheader_install() { Addon::registerHook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); @@ -48,13 +49,13 @@ function pageheader_addon_settings(&$a,&$s) { $words = ''; $s .= '

'; - $s .= '

' . t('"pageheader" Settings') . '

'; + $s .= '

' . L10n::t('"pageheader" Settings') . '

'; $s .= '
'; - $s .= '
'; + $s .= '
'; return; @@ -67,7 +68,7 @@ function pageheader_addon_settings_post(&$a,&$b) { if($_POST['pageheader-submit']) { Config::set('pageheader','text',trim(strip_tags($_POST['pageheader-words']))); - info( t('pageheader Settings saved.') . EOL); + info(L10n::t('pageheader Settings saved.') . EOL); } } diff --git a/piwik/piwik.php b/piwik/piwik.php index 326b931f5..ff141056a 100644 --- a/piwik/piwik.php +++ b/piwik/piwik.php @@ -31,6 +31,7 @@ */ use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; function piwik_install() { Addon::registerHook('page_end', 'addon/piwik/piwik.php', 'piwik_analytics'); @@ -78,21 +79,21 @@ function piwik_analytics($a,&$b) { */ if ($optout) { $b .= ""; } } function piwik_addon_admin (&$a, &$o) { $t = get_markup_template( "admin.tpl", "addon/piwik/" ); $o = replace_macros( $t, [ - '$submit' => t('Save Settings'), - '$piwikbaseurl' => ['baseurl', t('Piwik Base URL'), Config::get('piwik','baseurl' ), t('Absolute path to your Piwik installation. (without protocol (http/s), with trailing slash)')], - '$siteid' => ['siteid', t('Site ID'), Config::get('piwik','siteid' ), ''], - '$optout' => ['optout', t('Show opt-out cookie link?'), Config::get('piwik','optout' ), ''], - '$async' => ['async', t('Asynchronous tracking'), Config::get('piwik','async' ), ''], + '$submit' => L10n::t('Save Settings'), + '$piwikbaseurl' => ['baseurl', L10n::t('Piwik Base URL'), Config::get('piwik','baseurl' ), L10n::t('Absolute path to your Piwik installation. (without protocol (http/s), with trailing slash)')], + '$siteid' => ['siteid', L10n::t('Site ID'), Config::get('piwik','siteid' ), ''], + '$optout' => ['optout', L10n::t('Show opt-out cookie link?'), Config::get('piwik','optout' ), ''], + '$async' => ['async', L10n::t('Asynchronous tracking'), Config::get('piwik','async' ), ''], ]); } function piwik_addon_admin_post (&$a) { @@ -104,5 +105,5 @@ function piwik_addon_admin_post (&$a) { Config::set('piwik', 'siteid', $id); Config::set('piwik', 'optout', $optout); Config::set('piwik', 'async', $async); - info( t('Settings updated.'). EOL); + info(L10n::t('Settings updated.'). EOL); } diff --git a/planets/planets.php b/planets/planets.php index 04fb72ca7..cb4e76319 100644 --- a/planets/planets.php +++ b/planets/planets.php @@ -7,6 +7,7 @@ * Author: Tony Baldwin */ use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function planets_install() { @@ -148,22 +149,22 @@ function planets_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= ''; - $s .= '

' . t('Planets') . '

'; + $s .= '

' . L10n::t('Planets') . '

'; $s .= '
'; $s .= ''; + $s .= '
'; } diff --git a/pledgie/pledgie.php b/pledgie/pledgie.php index 2b75268ba..8b736d8b9 100644 --- a/pledgie/pledgie.php +++ b/pledgie/pledgie.php @@ -5,10 +5,11 @@ * Version: 1.1 * Author: tony baldwin * Hauke Altmann - * + * */ use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; function pledgie_install() { Addon::registerHook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); @@ -41,18 +42,18 @@ function pledgie_addon_settings(&$a,&$s) { $describe = ''; $s .= '
'; - $s .= '

' . t('"pledgie" Settings') . '

'; + $s .= '

' . L10n::t('"pledgie" Settings') . '

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; - $s .= '
'; + $s .= '
'; return; } @@ -65,7 +66,7 @@ function pledgie_addon_settings_post(&$a,&$b) { if($_POST['pledgie-submit']) { Config::set('pledgie-describe','text',trim(strip_tags($_POST['pledgie-describe']))); Config::set('pledgie-campaign','text',trim(strip_tags($_POST['pledgie-campaign']))); - info( t('pledgie Settings saved.') . EOL); + info(L10n::t('pledgie Settings saved.') . EOL); } } diff --git a/public_server/public_server.php b/public_server/public_server.php index 2c0965681..1b30b40b3 100644 --- a/public_server/public_server.php +++ b/public_server/public_server.php @@ -7,14 +7,14 @@ */ use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; use Friendica\Model\User; - function public_server_install() { Addon::registerHook('register_account', 'addon/public_server/public_server.php', 'public_server_register_account'); Addon::registerHook('cron', 'addon/public_server/public_server.php', 'public_server_cron'); - Addon::registerHook('enotify','addon/public_server/public_server.php', 'public_server_enotify'); + Addon::registerHook('enotify', 'addon/public_server/public_server.php', 'public_server_enotify'); Addon::registerHook('logged_in', 'addon/public_server/public_server.php', 'public_server_login'); } @@ -23,7 +23,7 @@ function public_server_uninstall() { Addon::unregisterHook('register_account', 'addon/public_server/public_server.php', 'public_server_register_account'); Addon::unregisterHook('cron', 'addon/public_server/public_server.php', 'public_server_cron'); - Addon::unregisterHook('enotify','addon/public_server/public_server.php', 'public_server_enotify'); + Addon::unregisterHook('enotify', 'addon/public_server/public_server.php', 'public_server_enotify'); Addon::unregisterHook('logged_in', 'addon/public_server/public_server.php', 'public_server_login'); } @@ -61,7 +61,7 @@ function public_server_cron($a,$b) { 'language' => $rr['language'], 'to_name' => $rr['username'], 'to_email' => $rr['email'], - 'source_name' => t('Administrator'), + 'source_name' => L10n::t('Administrator'), 'source_link' => $a->get_baseurl(), 'source_photo' => $a->get_baseurl() . '/images/person-80.jpg', ]); @@ -125,9 +125,9 @@ function public_server_enotify(&$a, &$b) { if (x($b, 'params') && $b['params']['type'] == NOTIFY_SYSTEM && x($b['params'], 'system_type') && $b['params']['system_type'] === 'public_server_expire') { $b['itemlink'] = $a->get_baseurl(); - $b['epreamble'] = $b['preamble'] = sprintf( t('Your account on %s will expire in a few days.'), Config::get('system','sitename')); - $b['subject'] = t('Your Friendica account is about to expire.'); - $b['body'] = sprintf( t("Hi %1\$s,\n\nYour account on %2\$s will expire in less than five days. You may keep your account by logging in at least once every 30 days"), $b['params']['to_name'], "[url=" . $app->config["system"]["url"] . "]" . $app->config["sitename"] . "[/url]"); + $b['epreamble'] = $b['preamble'] = sprintf(L10n::t('Your account on %s will expire in a few days.'), Config::get('system','sitename')); + $b['subject'] = L10n::t('Your Friendica account is about to expire.'); + $b['body'] = sprintf(L10n::t("Hi %1\$s,\n\nYour account on %2\$s will expire in less than five days. You may keep your account by logging in at least once every 30 days"), $b['params']['to_name'], "[url=" . $app->config["system"]["url"] . "]" . $app->config["sitename"] . "[/url]"); } } @@ -155,15 +155,15 @@ function public_server_addon_admin_post ( &$a ) { Config::set( 'public_server','flagusers',$flagusers); Config::set( 'public_server','flagposts',$flagposts ); Config::set( 'public_server','flagpostsexpire',$flagpostsexpire ); - info( t('Settings saved').EOL ); + info(L10n::t('Settings saved').EOL ); } function public_server_addon_admin ( &$a, &$o) { $token = get_form_security_token("publicserver"); $t = get_markup_template( "admin.tpl", "addon/public_server"); $o = replace_macros($t, [ - '$submit' => t('Save Settings'), + '$submit' => L10n::t('Save Settings'), '$form_security_token' => $token, - '$infotext' => t('Set any of these options to 0 to deactivate it.'), + '$infotext' => L10n::t('Set any of these options to 0 to deactivate it.'), '$expiredays' => [ "expiredays","Expire Days", intval(Config::get('public_server', 'expiredays')), "When an account is created on the site, it is given a hard "], '$expireposts' => [ "expireposts", "Expire Posts", intval(Config::get('public_server','expireposts')), "Set the default days for posts to expire here"], '$nologin' => [ "nologin", "No Login", intval(Config::get('public_server','nologin')), "Remove users who have never logged in after nologin days "], @@ -172,4 +172,3 @@ function public_server_addon_admin ( &$a, &$o) { '$flagpostsexpire' => [ "flagpostsexpire", "Flag posts expire", intval(Config::get('public_server','flagpostsexpire'))], ]); } - diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index d4c459895..6ab375834 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -7,6 +7,7 @@ */ use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Worker; use Friendica\Model\Contact; @@ -50,7 +51,7 @@ function pumpio_module() {} function pumpio_content(&$a) { if(! local_user()) { - notice( t('Permission denied.') . EOL); + notice(L10n::t('Permission denied.') . EOL); return ''; } @@ -146,7 +147,7 @@ function pumpio_connect(&$a) { if (($consumer_key == "") || ($consumer_secret == "")) { logger("pumpio_connect: ".sprintf("Unable to register the client at the pump.io server '%s'.", $hostname)); - $o .= sprintf(t("Unable to register the client at the pump.io server '%s'."), $hostname); + $o .= sprintf(L10n::t("Unable to register the client at the pump.io server '%s'."), $hostname); return($o); } @@ -186,8 +187,8 @@ function pumpio_connect(&$a) { if($success) { logger("pumpio_connect: authenticated"); - $o .= t("You are now authenticated to pumpio."); - $o .= '
'.t("return to the connector page").''; + $o .= L10n::t("You are now authenticated to pumpio."); + $o .= '
'.L10n::t("return to the connector page").''; } else { logger("pumpio_connect: could not connect"); $o = 'Could not connect to pumpio. Refresh the page or try again later.'; @@ -205,7 +206,7 @@ function pumpio_jot_nets(&$a,&$b) { $pumpio_defpost = PConfig::get(local_user(),'pumpio','post_by_default'); $selected = ((intval($pumpio_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' - . t('Post to pumpio') . '
'; + . L10n::t('Post to pumpio') . ''; } } @@ -243,20 +244,20 @@ function pumpio_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= ''; - $s .= '

'. t('Pump.io Import/Export/Mirror').'

'; + $s .= '

'. L10n::t('Pump.io Import/Export/Mirror').'

'; $s .= '
'; $s .= ''; } @@ -554,7 +555,7 @@ function pumpio_send(&$a,&$b) { $s = serialize(['url' => $url, 'item' => $b['id'], 'post' => $params]); Queue::add($a->contact, NETWORK_PUMPIO, $s); - notice(t('Pump.io post failed. Queued for retry.').EOL); + notice(L10n::t('Pump.io post failed. Queued for retry.').EOL); } } } @@ -630,7 +631,7 @@ function pumpio_action(&$a, $uid, $uri, $action, $content = "") { $s = serialize(['url' => $url, 'item' => $orig_post["id"], 'post' => $params]); Queue::add($a->contact, NETWORK_PUMPIO, $s); - notice(t('Pump.io like failed. Queued for retry.').EOL); + notice(L10n::t('Pump.io like failed. Queued for retry.').EOL); } } @@ -719,7 +720,7 @@ function pumpio_fetchtimeline(&$a, $uid) { // get the application name for the pump.io app // 1st try personal config, then system config and fallback to the // hostname of the node if neither one is set. - $application_name = PConfig::get( $uid, 'pumpio', 'application_name'); + $application_name = PConfig::get($uid, 'pumpio', 'application_name'); if ($application_name == "") $application_name = Config::get('pumpio', 'application_name'); if ($application_name == "") @@ -963,11 +964,11 @@ function pumpio_dolike(&$a, $uid, $self, $post, $own_id, $threadcompletion = tru $author = '[url=' . $likedata['author-link'] . ']' . $likedata['author-name'] . '[/url]'; $objauthor = '[url=' . $orig_post['author-link'] . ']' . $orig_post['author-name'] . '[/url]'; - $post_type = t('status'); + $post_type = L10n::t('status'); $plink = '[url=' . $orig_post['plink'] . ']' . $post_type . '[/url]'; $likedata['object-type'] = ACTIVITY_OBJ_NOTE; - $likedata['body'] = sprintf( t('%1$s likes %2$s\'s %3$s'), $author, $objauthor, $plink); + $likedata['body'] = sprintf(L10n::t('%1$s likes %2$s\'s %3$s'), $author, $objauthor, $plink); $likedata['object'] = '' . ACTIVITY_OBJ_NOTE . '1' . '' . $orig_post['uri'] . '' . xmlify('') . '' . $orig_post['title'] . '' . $orig_post['body'] . ''; diff --git a/qcomment/qcomment.php b/qcomment/qcomment.php index 447f8abf1..c499fb868 100644 --- a/qcomment/qcomment.php +++ b/qcomment/qcomment.php @@ -1,25 +1,24 @@ - * + * * Provides a set of text "snippets" which can be inserted into a comment window by clicking on them. - * First enable the addon in the system admin panel. - * Then each person can tailor their choice of words in Settings->Addon Settings in the Qcomment + * First enable the addon in the system admin panel. + * Then each person can tailor their choice of words in Settings->Addon Settings in the Qcomment * pane. Initially no qcomments are provided, but on viewing the settings page, a default set of - * of words is suggested. These can be accepted (click Submit) or edited first. Each text line represents - * a different qcomment. + * of words is suggested. These can be accepted (click Submit) or edited first. Each text line represents + * a different qcomment. * Many themes will hide the qcomments above or immediately adjacent to the comment input box until * you wish to use them. On some themes they may be visible. - * Wave the mouse around near the comment input box and the qcomments will show up. Click on any of + * Wave the mouse around near the comment input box and the qcomments will show up. Click on any of * them to open the comment window fully and insert the qcomment. Then "Submit" will submit it. * */ use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function qcomment_install() { @@ -28,17 +27,12 @@ function qcomment_install() { } - function qcomment_uninstall() { Addon::unregisterHook('addon_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings'); Addon::unregisterHook('addon_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post'); } - - - - function qcomment_addon_settings(&$a, &$s) { if (! local_user()) { @@ -49,17 +43,17 @@ function qcomment_addon_settings(&$a, &$s) $a->page['htmlhead'] .= '' . "\r\n"; - $words = PConfig::get(local_user(), 'qcomment', 'words', t(':-)') . "\n" . t(':-(') . "\n" . t('lol')); + $words = PConfig::get(local_user(), 'qcomment', 'words', L10n::t(':-)') . "\n" . L10n::t(':-(') . "\n" . L10n::t('lol')); $s .= '
'; - $s .= '

' . t('Quick Comment Settings') . '

'; + $s .= '

' . L10n::t('Quick Comment Settings') . '

'; $s .= '
'; - $s .= '
' . t("Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies.") . '
'; - $s .= ''; + $s .= '
' . L10n::t("Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies.") . '
'; + $s .= ''; $s .= ''; $s .= '
'; - $s .= '
'; + $s .= '
'; $s .= '
'; return; @@ -72,7 +66,6 @@ function qcomment_addon_settings_post(&$a,&$b) { if($_POST['qcomment-submit']) { PConfig::set(local_user(),'qcomment','words',xmlify($_POST['qcomment-words'])); - info( t('Quick Comment settings saved.') . EOL); + info(L10n::t('Quick Comment settings saved.') . EOL); } } - diff --git a/randplace/randplace.php b/randplace/randplace.php index 96e549a67..abf59e2df 100644 --- a/randplace/randplace.php +++ b/randplace/randplace.php @@ -19,6 +19,7 @@ * */ use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function randplace_install() { @@ -167,14 +168,14 @@ function randplace_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= '
'; - $s .= '

' . t('Randplace Settings') . '

'; + $s .= '

' . L10n::t('Randplace Settings') . '

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; /* provide a submit button */ - $s .= '
'; + $s .= '
'; } diff --git a/remote_permissions/remote_permissions.php b/remote_permissions/remote_permissions.php index 408316e69..94bdf5c11 100644 --- a/remote_permissions/remote_permissions.php +++ b/remote_permissions/remote_permissions.php @@ -8,6 +8,7 @@ */ use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function remote_permissions_install() { @@ -44,10 +45,10 @@ function remote_permissions_settings(&$a,&$o) { // $t = file_get_contents("addon/remote_permissions/settings.tpl" ); $t = get_markup_template("settings.tpl", "addon/remote_permissions/" ); $o .= replace_macros($t, [ - '$remote_perms_title' => t('Remote Permissions Settings'), - '$remote_perms_label' => t('Allow recipients of your private posts to see the other recipients of the posts'), + '$remote_perms_title' => L10n::t('Remote Permissions Settings'), + '$remote_perms_label' => L10n::t('Allow recipients of your private posts to see the other recipients of the posts'), '$checked' => (($remote_perms == 1) ? 'checked="checked"' : ''), - '$submit' => t('Save Settings') + '$submit' => L10n::t('Save Settings') ]); } @@ -57,7 +58,7 @@ function remote_permissions_settings_post($a,$post) { return; PConfig::set(local_user(),'remote_perms','show',intval($_POST['remote-perms'])); - info( t('Remote Permissions settings updated.') . EOL); + info(L10n::t('Remote Permissions settings updated.') . EOL); } function remote_permissions_content($a, $item_copy) { @@ -123,7 +124,7 @@ function remote_permissions_content($a, $item_copy) { $deny_users = expand_acl($item['deny_cid']); $deny_groups = expand_acl($item['deny_gid']); - $o = t('Visible to:') . '
'; + $o = L10n::t('Visible to:') . '
'; $allow = []; $deny = []; @@ -177,7 +178,7 @@ function remote_permissions_content($a, $item_copy) { if(! $r) return; - $o = t('Visible to') . ' (' . t('may only be a partial list') . '):
'; + $o = L10n::t('Visible to') . ' (' . L10n::t('may only be a partial list') . '):
'; foreach($r as $rr) $allow_names[] = $rr['username']; @@ -195,15 +196,14 @@ function remote_permissions_content($a, $item_copy) { function remote_permissions_addon_admin(&$a, &$o){ $t = get_markup_template( "admin.tpl", "addon/remote_permissions/" ); $o = replace_macros($t, [ - '$submit' => t('Save Settings'), - '$global' => ['remotepermschoice', t('Global'), 1, t('The posts of every user on this server show the post recipients'), Config::get('remote_perms', 'global') == 1], - '$individual' => ['remotepermschoice', t('Individual'), 2, t('Each user chooses whether his/her posts show the post recipients'), Config::get('remote_perms', 'global') == 0] + '$submit' => L10n::t('Save Settings'), + '$global' => ['remotepermschoice', L10n::t('Global'), 1, L10n::t('The posts of every user on this server show the post recipients'), Config::get('remote_perms', 'global') == 1], + '$individual' => ['remotepermschoice', L10n::t('Individual'), 2, L10n::t('Each user chooses whether his/her posts show the post recipients'), Config::get('remote_perms', 'global') == 0] ]); } function remote_permissions_addon_admin_post(&$a){ $choice = ((x($_POST,'remotepermschoice')) ? notags(trim($_POST['remotepermschoice'])) : ''); Config::set('remote_perms','global',($choice == 1 ? 1 : 0)); - info( t('Settings updated.'). EOL ); + info(L10n::t('Settings updated.'). EOL); } - diff --git a/securemail/securemail.php b/securemail/securemail.php index e62b60767..d63c2ee97 100644 --- a/securemail/securemail.php +++ b/securemail/securemail.php @@ -8,6 +8,7 @@ use Friendica\App; use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Util\Emailer; @@ -62,11 +63,11 @@ function securemail_settings(App &$a, &$s){ $t = get_markup_template('admin.tpl', 'addon/securemail/'); $s .= replace_macros($t, [ - '$title' => t('"Secure Mail" Settings'), - '$submit' => t('Save Settings'), - '$test' => t('Save and send test'), //NOTE: update also in 'post' - '$enable' => ['securemail-enable', t('Enable Secure Mail'), $enable, ''], - '$publickey' => ['securemail-pkey', t('Public key'), $publickey, t('Your public PGP key, ascii armored format'), 'rows="10"'] + '$title' => L10n::t('"Secure Mail" Settings'), + '$submit' => L10n::t('Save Settings'), + '$test' => L10n::t('Save and send test'), //NOTE: update also in 'post' + '$enable' => ['securemail-enable', L10n::t('Enable Secure Mail'), $enable, ''], + '$publickey' => ['securemail-pkey', L10n::t('Public key'), $publickey, L10n::t('Your public PGP key, ascii armored format'), 'rows="10"'] ]); } @@ -90,9 +91,9 @@ function securemail_settings_post(App &$a, array &$b){ PConfig::set(local_user(), 'securemail', 'pkey', trim($_POST['securemail-pkey'])); $enable = ((x($_POST, 'securemail-enable')) ? 1 : 0); PConfig::set(local_user(), 'securemail', 'enable', $enable); - info(t('Secure Mail Settings saved.') . EOL); + info(L10n::t('Secure Mail Settings saved.') . EOL); - if ($_POST['securemail-submit'] == t('Save and send test')) { + if ($_POST['securemail-submit'] == L10n::t('Save and send test')) { $sitename = $a->config['sitename']; $hostname = $a->get_hostname(); @@ -127,9 +128,9 @@ function securemail_settings_post(App &$a, array &$b){ PConfig::set(local_user(), 'securemail', 'enable', $enable); if ($res) { - info(t('Test email sent') . EOL); + info(L10n::t('Test email sent') . EOL); } else { - notice(t('There was an error sending the test email') . EOL); + notice(L10n::t('There was an error sending the test email') . EOL); } } } diff --git a/showmore/showmore.php b/showmore/showmore.php index f6e5028c6..c2d4b1942 100644 --- a/showmore/showmore.php +++ b/showmore/showmore.php @@ -8,6 +8,7 @@ * */ use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function showmore_install() { @@ -37,24 +38,24 @@ function showmore_addon_settings(&$a,&$s) { $chars = '1100'; $s .= ''; - $s .= '

' . t('"Show more" Settings').'

'; + $s .= '

' . L10n::t('"Show more" Settings').'

'; $s .= '
'; $s .= ''; return; @@ -70,7 +71,7 @@ function showmore_addon_settings_post(&$a,&$b) { $enable = ((x($_POST,'showmore-enable')) ? intval($_POST['showmore-enable']) : 0); $disable = 1-$enable; PConfig::set(local_user(),'showmore','disable', $disable); - info( t('Show More Settings saved.') . EOL); + info(L10n::t('Show More Settings saved.') . EOL); } } @@ -124,7 +125,7 @@ function showmore_prepare_body(&$a,&$b) { if($found) { $rnd = random_string(8); $b['html'] = ''.$shortened." ". - ''.sprintf(t('show more')).''. + ''.sprintf(L10n::t('show more')).''. ''; } } diff --git a/startpage/startpage.php b/startpage/startpage.php index 872fb234d..840b547e5 100644 --- a/startpage/startpage.php +++ b/startpage/startpage.php @@ -7,6 +7,7 @@ * */ use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function startpage_install() { @@ -51,16 +52,12 @@ function startpage_settings_post($a,$post) { PConfig::set(local_user(),'startpage','startpage',strip_tags(trim($_POST['startpage']))); } - /** * * Called from the Addon Setting form. * Add our own settings info to the page. * */ - - - function startpage_settings(&$a,&$s) { if(! local_user()) @@ -78,20 +75,20 @@ function startpage_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= ''; - $s .= '

' . t('Startpage') . '

'; + $s .= '

' . L10n::t('Startpage') . '

'; $s .= '
'; $s .= ''; + $s .= '
'; } diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 3d7083893..f9b770a99 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -49,6 +49,7 @@ use Friendica\App; use Friendica\Content\OEmbed; use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Model\GContact; use Friendica\Model\Group; @@ -190,7 +191,7 @@ function statusnet_jot_nets(App $a, &$b) $statusnet_defpost = PConfig::get(local_user(), 'statusnet', 'post_by_default'); $selected = ((intval($statusnet_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' - . t('Post to GNU Social') . '
'; + . L10n::t('Post to GNU Social') . ''; } } @@ -238,7 +239,7 @@ function statusnet_settings_post(App $a, $post) PConfig::set(local_user(), 'statusnet', 'baseapi', $asn['apiurl']); //PConfig::set(local_user(), 'statusnet', 'application_name', $asn['applicationname'] ); } else { - notice(t('Please contact your site administrator.
The provided API URL is not valid.') . EOL . $asn['apiurl'] . EOL); + notice(L10n::t('Please contact your site administrator.
The provided API URL is not valid.') . EOL . $asn['apiurl'] . EOL); } } } @@ -267,7 +268,7 @@ function statusnet_settings_post(App $a, $post) PConfig::set(local_user(), 'statusnet', 'baseapi', $apibase); } else { // still not the correct API base, let's do noting - notice(t('We could not contact the GNU Social API with the Path you entered.') . EOL); + notice(L10n::t('We could not contact the GNU Social API with the Path you entered.') . EOL); } } goaway('settings/connectors'); @@ -301,7 +302,7 @@ function statusnet_settings_post(App $a, $post) if (!intval($_POST['statusnet-mirror'])) PConfig::delete(local_user(), 'statusnet', 'lastid'); - info(t('GNU Social settings updated.') . EOL); + info(L10n::t('GNU Social settings updated.') . EOL); } } } @@ -342,11 +343,11 @@ function statusnet_settings(App $a, &$s) $css = (($enabled) ? '' : '-disabled'); $s .= ''; - $s .= '

' . t('GNU Social Import/Export/Mirror') . '

'; + $s .= '

' . L10n::t('GNU Social Import/Export/Mirror') . '

'; $s .= '
'; $s .= '
'; @@ -747,7 +748,7 @@ function statusnet_addon_admin(App $a, &$o) foreach ($sites as $id => $s) { $sitesform[] = [ 'sitename' => ["sitename[$id]", "Site name", $s['sitename'], ""], - 'apiurl' => ["apiurl[$id]", "Api url", $s['apiurl'], t("Base API Path \x28remember the trailing /\x29")], + 'apiurl' => ["apiurl[$id]", "Api url", $s['apiurl'], L10n::t("Base API Path \x28remember the trailing /\x29")], 'secret' => ["secret[$id]", "Secret", $s['consumersecret'], ""], 'key' => ["key[$id]", "Key", $s['consumerkey'], ""], //'applicationname' => Array("applicationname[$id]", "Application name", $s['applicationname'], ""), @@ -758,16 +759,16 @@ function statusnet_addon_admin(App $a, &$o) /* empty form to add new site */ $id++; $sitesform[] = [ - 'sitename' => ["sitename[$id]", t("Site name"), "", ""], - 'apiurl' => ["apiurl[$id]", "Api url", "", t("Base API Path \x28remember the trailing /\x29")], - 'secret' => ["secret[$id]", t("Consumer Secret"), "", ""], - 'key' => ["key[$id]", t("Consumer Key"), "", ""], - //'applicationname' => Array("applicationname[$id]", t("Application name"), "", ""), + 'sitename' => ["sitename[$id]", L10n::t("Site name"), "", ""], + 'apiurl' => ["apiurl[$id]", "Api url", "", L10n::t("Base API Path \x28remember the trailing /\x29")], + 'secret' => ["secret[$id]", L10n::t("Consumer Secret"), "", ""], + 'key' => ["key[$id]", L10n::t("Consumer Key"), "", ""], + //'applicationname' => Array("applicationname[$id]", L10n::t("Application name"), "", ""), ]; $t = get_markup_template("admin.tpl", "addon/statusnet/"); $o = replace_macros($t, [ - '$submit' => t('Save Settings'), + '$submit' => L10n::t('Save Settings'), '$sites' => $sitesform, ]); } diff --git a/superblock/superblock.php b/superblock/superblock.php index b6d19de45..241114866 100644 --- a/superblock/superblock.php +++ b/superblock/superblock.php @@ -9,6 +9,7 @@ * */ use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function superblock_install() { @@ -52,18 +53,18 @@ function superblock_addon_settings(&$a,&$s) { } $s .= ''; - $s .= '

' . t('"Superblock"') . '

'; + $s .= '

' . L10n::t('"Superblock"') . '

'; $s .= '
'; $s .= ''; + $s .= '
'; return; } @@ -75,7 +76,7 @@ function superblock_addon_settings_post(&$a,&$b) { if($_POST['superblock-submit']) { PConfig::set(local_user(),'system','blocked',trim($_POST['superblock-words'])); - info( t('SUPERBLOCK Settings saved.') . EOL); + info(L10n::t('SUPERBLOCK Settings saved.') . EOL); } } @@ -147,7 +148,7 @@ function superblock_item_photo_menu(&$a,&$b) { } } - $b['menu'][ t('Block Completely')] = 'javascript:superblockBlock(\'' . $author . '\'); return false;'; + $b['menu'][L10n::t('Block Completely')] = 'javascript:superblockBlock(\'' . $author . '\'); return false;'; } function superblock_module() {} @@ -167,6 +168,6 @@ function superblock_init(&$a) { } PConfig::set(local_user(),'system','blocked',$words); - info( t('superblock settings updated') . EOL ); + info(L10n::t('superblock settings updated') . EOL ); killme(); } diff --git a/testdrive/testdrive.php b/testdrive/testdrive.php index f28d8d55f..6eb9344e6 100644 --- a/testdrive/testdrive.php +++ b/testdrive/testdrive.php @@ -1,5 +1,4 @@ $rr['language'], 'to_name' => $rr['username'], 'to_email' => $rr['email'], - 'source_name' => t('Administrator'), + 'source_name' => L10n::t('Administrator'), 'source_link' => $a->get_baseurl(), 'source_photo' => $a->get_baseurl() . '/images/person-80.jpg', ]); @@ -90,8 +89,8 @@ function testdrive_enotify(&$a, &$b) { if (x($b, 'params') && $b['params']['type'] == NOTIFY_SYSTEM && x($b['params'], 'system_type') && $b['params']['system_type'] === 'testdrive_expire') { $b['itemlink'] = $a->get_baseurl(); - $b['epreamble'] = $b['preamble'] = sprintf( t('Your account on %s will expire in a few days.'), Config::get('system','sitename')); - $b['subject'] = t('Your Friendica test account is about to expire.'); - $b['body'] = sprintf( t("Hi %1\$s,\n\nYour test account on %2\$s will expire in less than five days. We hope you enjoyed this test drive and use this opportunity to find a permanent Friendica website for your integrated social communications. A list of public sites is available at %s/siteinfo - and for more information on setting up your own Friendica server please see the Friendica project website at http://friendica.com."), $b['params']['to_name'], "[url=".$app->config["system"]["url"]."]".$app->config["sitename"]."[/url]", get_server()); + $b['epreamble'] = $b['preamble'] = sprintf(L10n::t('Your account on %s will expire in a few days.'), Config::get('system','sitename')); + $b['subject'] = L10n::t('Your Friendica test account is about to expire.'); + $b['body'] = sprintf(L10n::t("Hi %1\$s,\n\nYour test account on %2\$s will expire in less than five days. We hope you enjoyed this test drive and use this opportunity to find a permanent Friendica website for your integrated social communications. A list of public sites is available at %s/siteinfo - and for more information on setting up your own Friendica server please see the Friendica project website at http://friendica.com."), $b['params']['to_name'], "[url=".$app->config["system"]["url"]."]".$app->config["sitename"]."[/url]", get_server()); } } diff --git a/tictac/tictac.php b/tictac/tictac.php index f928fd5e0..fe2c5cf12 100644 --- a/tictac/tictac.php +++ b/tictac/tictac.php @@ -6,6 +6,7 @@ * Author: Mike Macgirvin */ use Friendica\Core\Addon; +use Friendica\Core\L10n; function tictac_install() { Addon::registerHook('app_menu', 'addon/tictac/tictac.php', 'tictac_app_menu'); @@ -17,7 +18,7 @@ function tictac_uninstall() { } function tictac_app_menu($a,&$b) { - $b['app_menu'][] = ''; + $b['app_menu'][] = ''; } @@ -50,17 +51,17 @@ function tictac_content(&$a) { $dimen = 3; } - $o .= '

' . t('3D Tic-Tac-Toe') . '


'; + $o .= '

' . L10n::t('3D Tic-Tac-Toe') . '


'; $t = new tictac($dimen,$handicap,$mefirst,$yours,$mine); $o .= $t->play(); - $o .= '' . t('New game') . '
'; - $o .= '' . t('New game with handicap') . '
'; - $o .= '

' . t('Three dimensional tic-tac-toe is just like the traditional game except that it is played on multiple levels simultaneously. '); - $o .= t('In this case there are three levels. You win by getting three in a row on any level, as well as up, down, and diagonally across the different levels.'); + $o .= '' . L10n::t('New game') . '
'; + $o .= '' . L10n::t('New game with handicap') . '
'; + $o .= '

' . L10n::t('Three dimensional tic-tac-toe is just like the traditional game except that it is played on multiple levels simultaneously. '); + $o .= L10n::t('In this case there are three levels. You win by getting three in a row on any level, as well as up, down, and diagonally across the different levels.'); $o .= '

'; - $o .= t('The handicap game disables the center position on the middle level because the player claiming this square often has an unfair advantage.'); + $o .= L10n::t('The handicap game disables the center position on the middle level because the player claiming this square often has an unfair advantage.'); $o .= '

'; return $o; @@ -179,24 +180,24 @@ class tictac { if($this->first_move) { if(rand(0,1) == 1) { - $o .= '
' . t('You go first...') . '

'; + $o .= '
' . L10n::t('You go first...') . '

'; $this->mefirst = 0; $o .= $this->draw_board(); return $o; } - $o .= '
' . t('I\'m going first this time...') . '

'; + $o .= '
' . L10n::t('I\'m going first this time...') . '

'; $this->mefirst = 1; } if($this->check_youwin()) { - $o .= '
' . t('You won!') . '

'; + $o .= '
' . L10n::t('You won!') . '

'; $o .= $this->draw_board(); return $o; } if($this->fullboard()) - $o .= '
' . t('"Cat" game!') . '

'; + $o .= '
' . L10n::t('"Cat" game!') . '

'; $move = $this->winning_move(); if(strlen($move)) { @@ -219,9 +220,9 @@ class tictac { } if($this->check_iwon()) - $o .= '
' . t('I won!') . '

'; + $o .= '
' . L10n::t('I won!') . '

'; if($this->fullboard()) - $o .= '
' . t('"Cat" game!') . '

'; + $o .= '
' . L10n::t('"Cat" game!') . '

'; $o .= $this->draw_board(); return $o; } diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index ff218d0a7..008027c04 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -1,5 +1,4 @@ */ -require_once('library/OAuth1.php'); -require_once('addon/tumblr/tumblroauth/tumblroauth.php'); +require_once 'library/OAuth1.php'; +require_once 'addon/tumblr/tumblroauth/tumblroauth.php'; use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; use Friendica\Core\PConfig; function tumblr_install() { @@ -36,7 +36,7 @@ function tumblr_module() {} function tumblr_content(&$a) { if(! local_user()) { - notice( t('Permission denied.') . EOL); + notice(L10n::t('Permission denied.') . EOL); return ''; } @@ -62,10 +62,10 @@ function tumblr_addon_admin(&$a, &$o){ $t = get_markup_template( "admin.tpl", "addon/tumblr/" ); $o = replace_macros($t, [ - '$submit' => t('Save Settings'), + '$submit' => L10n::t('Save Settings'), // name, label, value, help, [extra values] - '$consumer_key' => ['consumer_key', t('Consumer Key'), Config::get('tumblr', 'consumer_key' ), ''], - '$consumer_secret' => ['consumer_secret', t('Consumer Secret'), Config::get('tumblr', 'consumer_secret' ), ''], + '$consumer_key' => ['consumer_key', L10n::t('Consumer Key'), Config::get('tumblr', 'consumer_key' ), ''], + '$consumer_secret' => ['consumer_secret', L10n::t('Consumer Secret'), Config::get('tumblr', 'consumer_secret' ), ''], ]); } @@ -74,7 +74,7 @@ function tumblr_addon_admin_post(&$a){ $consumer_secret = ((x($_POST,'consumer_secret')) ? notags(trim($_POST['consumer_secret'])): ''); Config::set('tumblr','consumer_key',$consumer_key); Config::set('tumblr','consumer_secret',$consumer_secret); - info( t('Settings updated.'). EOL ); + info(L10n::t('Settings updated.'). EOL); } function tumblr_connect($a) { @@ -165,8 +165,8 @@ function tumblr_callback($a) { PConfig::set(local_user(), "tumblr", "oauth_token", $access_token['oauth_token']); PConfig::set(local_user(), "tumblr", "oauth_token_secret", $access_token['oauth_token_secret']); - $o = t("You are now authenticated to tumblr."); - $o .= '
'.t("return to the connector page").''; + $o = L10n::t("You are now authenticated to tumblr."); + $o .= '
'.L10n::t("return to the connector page").''; return($o); } @@ -179,7 +179,7 @@ function tumblr_jot_nets(&$a,&$b) { $tmbl_defpost = PConfig::get(local_user(),'tumblr','post_by_default'); $selected = ((intval($tmbl_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' - . t('Post to Tumblr') . '
'; + . L10n::t('Post to Tumblr') . ''; } } @@ -206,24 +206,24 @@ function tumblr_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= ''; - $s .= '

'. t('Tumblr Export').'

'; + $s .= '

'. L10n::t('Tumblr Export').'

'; $s .= '
'; $s .= '
'; /* provide a submit button */ - $s .= '
'; + $s .= '
'; } diff --git a/twitter/twitter.php b/twitter/twitter.php index 0a831800a..244eaee7d 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -1,5 +1,4 @@ ' - . t('Post to Twitter') . ''; + . L10n::t('Post to Twitter') . ''; } } @@ -241,7 +241,7 @@ function twitter_settings_post(App $a, $post) PConfig::delete(local_user(), 'twitter', 'lastid'); } - info(t('Twitter settings updated.') . EOL); + info(L10n::t('Twitter settings updated.') . EOL); } } } @@ -271,11 +271,11 @@ function twitter_settings(App $a, &$s) $css = (($enabled) ? '' : '-disabled'); $s .= ''; - $s .= '

' . t('Twitter Import/Export/Mirror') . '

'; + $s .= '

' . L10n::t('Twitter Import/Export/Mirror') . '

'; $s .= '
'; $s .= ''; return; @@ -97,6 +96,6 @@ function yourls_addon_settings_post(&$a,&$b) { Config::set('yourls','username1',trim($_POST['yourls_username'])); Config::set('yourls','password1',trim($_POST['yourls_password'])); Config::set('yourls','ssl1',intval($_POST['yourls_ssl'])); - info( t('yourls Settings saved.') . EOL); + info(L10n::t('yourls Settings saved.') . EOL); } }