Update t() calls

Update all t() calls.
pull/497/head
Adam Magness 2018-01-22 14:03:11 -05:00
parent 3ae390c6ee
commit f8c162cbfb
77 changed files with 1043 additions and 968 deletions

View File

@ -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<br />(YYYY-MM-DD hh:mm)", $mystart, "format is <em>YYYY</em> year, <em>MM</em> month, <em>DD</em> day, <em>hh</em> hour and <em>mm</em> minute"],
'$enddate' => ["enddate", "End of the Blackout<br />(YYYY-MM-DD hh:mm)", $myend, ""],

View File

@ -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 .= '<span id="settings_blockem_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_blockem_expanded\'); openClose(\'settings_blockem_inflated\');">';
$s .= '<h3>' . t('"Blockem"') . '</h3>';
$s .= '<h3>' . L10n::t('"Blockem"') . '</h3>';
$s .= '</span>';
$s .= '<div id="settings_blockem_expanded" class="settings-block" style="display: none;">';
$s .= '<span class="fakelink" onclick="openClose(\'settings_blockem_expanded\'); openClose(\'settings_blockem_inflated\');">';
$s .= '<h3>' . t('"Blockem"') . '</h3>';
$s .= '<h3>' . L10n::t('"Blockem"') . '</h3>';
$s .= '</span>';
$s .= '<div id="blockem-wrapper">';
$s .= '<label id="blockem-label" for="blockem-words">' . t('Comma separated profile URLS to block') . ' </label>';
$s .= '<label id="blockem-label" for="blockem-words">' . L10n::t('Comma separated profile URLS to block') . ' </label>';
$s .= '<textarea id="blockem-words" type="text" name="blockem-words" >' . htmlspecialchars($words) . '</textarea>';
$s .= '</div><div class="clear"></div>';
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="blockem-submit" name="blockem-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="blockem-submit" name="blockem-submit" class="settings-submit" value="' . L10n::t('Save Settings') . '" /></div></div>';
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'] = '<div id="blockem-wrap-' . $rnd . '" class="fakelink" onclick=openClose(\'blockem-' . $rnd . '\'); >' . sprintf( t('Blocked %s - Click to open/close'),$word ) . '</div><div id="blockem-' . $rnd . '" style="display: none; " >' . $b['html'] . '</div>';
$b['html'] = '<div id="blockem-wrap-' . $rnd . '" class="fakelink" onclick=openClose(\'blockem-' . $rnd . '\'); >' . sprintf(L10n::t('Blocked %s - Click to open/close'),$word ) . '</div><div id="blockem-' . $rnd . '" style="display: none; " >' . $b['html'] . '</div>';
}
}
@ -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();
}

View File

@ -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 .= '<div class="profile-jot-net"><input type="checkbox" name="blogger_enable" ' . $selected . ' value="1" /> '
. t('Post to blogger') . '</div>';
. L10n::t('Post to blogger') . '</div>';
}
}
@ -74,40 +75,40 @@ function blogger_settings(&$a, &$s)
/* Add some HTML to the existing form */
$s .= '<span id="settings_blogger_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_blogger_expanded\'); openClose(\'settings_blogger_inflated\');">';
$s .= '<img class="connector'.$css.'" src="images/blogger.png" /><h3 class="connector">'. t('Blogger Export').'</h3>';
$s .= '<img class="connector'.$css.'" src="images/blogger.png" /><h3 class="connector">'. L10n::t('Blogger Export').'</h3>';
$s .= '</span>';
$s .= '<div id="settings_blogger_expanded" class="settings-block" style="display: none;">';
$s .= '<span class="fakelink" onclick="openClose(\'settings_blogger_expanded\'); openClose(\'settings_blogger_inflated\');">';
$s .= '<img class="connector'.$css.'" src="images/blogger.png" /><h3 class="connector">'. t('Blogger Export').'</h3>';
$s .= '<img class="connector'.$css.'" src="images/blogger.png" /><h3 class="connector">'. L10n::t('Blogger Export').'</h3>';
$s .= '</span>';
$s .= '<div id="blogger-enable-wrapper">';
$s .= '<label id="blogger-enable-label" for="blogger-checkbox">' . t('Enable Blogger Post Addon') . '</label>';
$s .= '<label id="blogger-enable-label" for="blogger-checkbox">' . L10n::t('Enable Blogger Post Addon') . '</label>';
$s .= '<input id="blogger-checkbox" type="checkbox" name="blogger" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
$s .= '<div id="blogger-username-wrapper">';
$s .= '<label id="blogger-username-label" for="blogger-username">' . t('Blogger username') . '</label>';
$s .= '<label id="blogger-username-label" for="blogger-username">' . L10n::t('Blogger username') . '</label>';
$s .= '<input id="blogger-username" type="text" name="bl_username" value="' . $bl_username . '" />';
$s .= '</div><div class="clear"></div>';
$s .= '<div id="blogger-password-wrapper">';
$s .= '<label id="blogger-password-label" for="blogger-password">' . t('Blogger password') . '</label>';
$s .= '<label id="blogger-password-label" for="blogger-password">' . L10n::t('Blogger password') . '</label>';
$s .= '<input id="blogger-password" type="password" name="bl_password" value="' . $bl_password . '" />';
$s .= '</div><div class="clear"></div>';
$s .= '<div id="blogger-blog-wrapper">';
$s .= '<label id="blogger-blog-label" for="blogger-blog">' . t('Blogger API URL') . '</label>';
$s .= '<label id="blogger-blog-label" for="blogger-blog">' . L10n::t('Blogger API URL') . '</label>';
$s .= '<input id="blogger-blog" type="text" name="bl_blog" value="' . $bl_blog . '" />';
$s .= '</div><div class="clear"></div>';
$s .= '<div id="blogger-bydefault-wrapper">';
$s .= '<label id="blogger-bydefault-label" for="blogger-bydefault">' . t('Post to Blogger by default') . '</label>';
$s .= '<label id="blogger-bydefault-label" for="blogger-bydefault">' . L10n::t('Post to Blogger by default') . '</label>';
$s .= '<input id="blogger-bydefault" type="checkbox" name="bl_bydefault" value="1" ' . $def_checked . '/>';
$s .= '</div><div class="clear"></div>';
/* provide a submit button */
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="blogger-submit" name="blogger-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="blogger-submit" name="blogger-submit" class="settings-submit" value="' . L10n::t('Save Settings') . '" /></div></div>';
}
@ -181,7 +182,7 @@ function blogger_send(&$a, &$b)
if ($bl_username && $bl_password && $bl_blog) {
require_once('include/bbcode.php');
$title = '<title>' . (($b['title']) ? $b['title'] : t('Post from Friendica')) . '</title>';
$title = '<title>' . (($b['title']) ? $b['title'] : L10n::t('Post from Friendica')) . '</title>';
$post = $title . bbcode($b['body']);
$post = xmlify($post);

View File

@ -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 .= '<a href="' . $buffer->get_login_url() . '">Connect to Buffer!</a>';
} else {
logger("buffer_connect: authenticated");
$o .= t("You are now authenticated to buffer. ");
$o .= '<br /><a href="'.$a->get_baseurl().'/settings/connectors">'.t("return to the connector page").'</a>';
$o .= L10n::t("You are now authenticated to buffer. ");
$o .= '<br /><a href="'.$a->get_baseurl().'/settings/connectors">'.L10n::t("return to the connector page").'</a>';
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 .= '<div class="profile-jot-net"><input type="checkbox" name="buffer_enable"' . $selected . ' value="1" /> '
. t('Post to Buffer') . '</div>';
. L10n::t('Post to Buffer') . '</div>';
}
}
@ -139,11 +140,11 @@ function buffer_settings(&$a,&$s) {
/* Add some HTML to the existing form */
$s .= '<span id="settings_buffer_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_buffer_expanded\'); openClose(\'settings_buffer_inflated\');">';
$s .= '<img class="connector'.$css.'" src="images/buffer.png" /><h3 class="connector">'. t('Buffer Export').'</h3>';
$s .= '<img class="connector'.$css.'" src="images/buffer.png" /><h3 class="connector">'. L10n::t('Buffer Export').'</h3>';
$s .= '</span>';
$s .= '<div id="settings_buffer_expanded" class="settings-block" style="display: none;">';
$s .= '<span class="fakelink" onclick="openClose(\'settings_buffer_expanded\'); openClose(\'settings_buffer_inflated\');">';
$s .= '<img class="connector'.$css.'" src="images/buffer.png" /><h3 class="connector">'. t('Buffer Export').'</h3>';
$s .= '<img class="connector'.$css.'" src="images/buffer.png" /><h3 class="connector">'. L10n::t('Buffer Export').'</h3>';
$s .= '</span>';
$client_id = Config::get("buffer", "client_id");
@ -153,21 +154,21 @@ function buffer_settings(&$a,&$s) {
$s .= '<div id="buffer-password-wrapper">';
if ($access_token == "") {
$s .= '<div id="buffer-authenticate-wrapper">';
$s .= '<a href="'.$a->get_baseurl().'/buffer/connect">'.t("Authenticate your Buffer connection").'</a>';
$s .= '<a href="'.$a->get_baseurl().'/buffer/connect">'.L10n::t("Authenticate your Buffer connection").'</a>';
$s .= '</div><div class="clear"></div>';
} else {
$s .= '<div id="buffer-enable-wrapper">';
$s .= '<label id="buffer-enable-label" for="buffer-checkbox">' . t('Enable Buffer Post Addon') . '</label>';
$s .= '<label id="buffer-enable-label" for="buffer-checkbox">' . L10n::t('Enable Buffer Post Addon') . '</label>';
$s .= '<input id="buffer-checkbox" type="checkbox" name="buffer" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
$s .= '<div id="buffer-bydefault-wrapper">';
$s .= '<label id="buffer-bydefault-label" for="buffer-bydefault">' . t('Post to Buffer by default') . '</label>';
$s .= '<label id="buffer-bydefault-label" for="buffer-bydefault">' . L10n::t('Post to Buffer by default') . '</label>';
$s .= '<input id="buffer-bydefault" type="checkbox" name="buffer_bydefault" value="1" ' . $def_checked . '/>';
$s .= '</div><div class="clear"></div>';
$s .= '<div id="buffer-delete-wrapper">';
$s .= '<label id="buffer-delete-label" for="buffer-delete">' . t('Check to delete this preset') . '</label>';
$s .= '<label id="buffer-delete-label" for="buffer-delete">' . L10n::t('Check to delete this preset') . '</label>';
$s .= '<input id="buffer-delete" type="checkbox" name="buffer_delete" value="1" />';
$s .= '</div><div class="clear"></div>';
@ -176,7 +177,7 @@ function buffer_settings(&$a,&$s) {
$profiles = $buffer->go('/profiles');
if (is_array($profiles)) {
$s .= '<div id="buffer-accounts-wrapper">';
$s .= t("Posts are going to all accounts that are enabled by default:");
$s .= L10n::t("Posts are going to all accounts that are enabled by default:");
$s .= "<ul>";
foreach ($profiles as $profile) {
if (!$profile->default)
@ -196,7 +197,7 @@ function buffer_settings(&$a,&$s) {
/* provide a submit button */
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="buffer-submit" name="buffer-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="buffer-submit" name="buffer-submit" class="settings-submit" value="' . L10n::t('Save Settings') . '" /></div></div>';
}

View File

@ -7,9 +7,17 @@
*/
use Friendica\Core\Addon;
function buglink_install() { Addon::registerHook('page_end', 'addon/buglink/buglink.php', 'buglink_active'); }
function buglink_install()
{
Addon::registerHook('page_end', 'addon/buglink/buglink.php', 'buglink_active');
}
function buglink_uninstall()
{
Addon::unregisterHook('page_end', 'addon/buglink/buglink.php', 'buglink_active');
}
function buglink_uninstall() { Addon::unregisterHook('page_end', 'addon/buglink/buglink.php', 'buglink_active'); }
function buglink_active(&$a,&$b) { $b .= '<div id="buglink_wrapper" style="position: fixed; bottom: 5px; left: 5px;"><a href="https://github.com/friendica/friendica/issues" target="_blank" title="' . t('Report Bug') . '"><img src="addon/buglink/bug-x.gif" alt="' . t('Report Bug') . '" /></a></div>'; }
function buglink_active(&$a, &$b)
{
$b .= '<div id="buglink_wrapper" style="position: fixed; bottom: 5px; left: 5px;"><a href="https://github.com/friendica/friendica/issues" target="_blank" title="' . L10n::t('Report Bug') . '"><img src="addon/buglink/bug-x.gif" alt="' . L10n::t('Report Bug') . '" /></a></div>';
}

View File

@ -7,6 +7,7 @@
*/
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Module\Login;
require_once('mod/community.php');
@ -24,12 +25,12 @@ function communityhome_uninstall() {
function communityhome_getopts() {
return [
'hidelogin'=>t('Hide login form'),
'showlastusers'=>t('Show last new users'),
'showactiveusers'=>t('Show last active users'),
'showlastphotos'=>t('Show last photos'),
'showlastlike'=>t('Show last liked items'),
'showcommunitystream'=>t('Show community stream')
'hidelogin'=>L10n::t('Hide login form'),
'showlastusers'=>L10n::t('Show last new users'),
'showactiveusers'=>L10n::t('Show last active users'),
'showlastphotos'=>L10n::t('Show last photos'),
'showlastlike'=>L10n::t('Show last liked items'),
'showcommunitystream'=>L10n::t('Show community stream')
];
}
@ -39,7 +40,7 @@ function communityhome_addon_admin(&$a, &$o)
$opts = communityhome_getopts();
$ctx = [
'$submit' => t("Submit"),
'$submit' => L10n::t("Submit"),
'$fields' => [],
];
@ -66,25 +67,25 @@ function communityhome_home(&$a, &$o){
if (!Config::get('communityhome','hidelogin')){
$aside = [
'$tab_1' => t('Login'),
'$tab_2' => t('OpenID'),
'$tab_1' => L10n::t('Login'),
'$tab_2' => L10n::t('OpenID'),
'$noOid' => Config::get('system','no_openid'),
];
// login form
$aside['$login_title'] = t('Login');
$aside['$login_title'] = L10n::t('Login');
$aside['$login_form'] = Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? false : true);
} else {
$aside = [
//'$tab_1' => t('Login'),
//'$tab_2' => t('OpenID'),
//'$tab_1' => L10n::t('Login'),
//'$tab_2' => L10n::t('OpenID'),
//'$noOid' => Config::get('system','no_openid'),
];
}
// last 12 users
if (Config::get('communityhome','showlastusers')){
$aside['$lastusers_title'] = t('Latest users');
$aside['$lastusers_title'] = L10n::t('Latest users');
$aside['$lastusers_items'] = [];
$sql_extra = "";
$publish = (Config::get('system','publish_all') ? '' : " AND `publish` = 1 " );
@ -129,7 +130,7 @@ function communityhome_home(&$a, &$o){
ORDER BY `items` DESC,`contacts` DESC
LIMIT 0,10");
if($r && count($r)) {
$aside['$activeusers_title'] = t('Most active users');
$aside['$activeusers_title'] = L10n::t('Most active users');
$aside['$activeusers_items'] = [];
$photo = 'thumb';
@ -147,7 +148,7 @@ function communityhome_home(&$a, &$o){
}
// last 12 photos
if (Config::get('communityhome','showlastphotos')){
$aside['$photos_title'] = t('Latest photos');
$aside['$photos_title'] = L10n::t('Latest photos');
$aside['$photos_items'] = [];
$r = q("SELECT `photo`.`id`, `photo`.`resource-id`, `photo`.`scale`, `photo`.`desc`, `user`.`nickname`, `user`.`username` FROM
(SELECT `resource-id`, MAX(`scale`) as maxscale FROM `photo`
@ -160,8 +161,8 @@ function communityhome_home(&$a, &$o){
AND `user`.`hidewall` = 0
ORDER BY `photo`.`edited` DESC
LIMIT 0, 12",
dbesc(t('Contact Photos')),
dbesc(t('Profile Photos'))
dbesc(L10n::t('Contact Photos')),
dbesc(L10n::t('Profile Photos'))
);
@ -187,7 +188,7 @@ function communityhome_home(&$a, &$o){
// last 10 liked items
if (Config::get('communityhome','showlastlike')){
$aside['$like_title'] = t('Latest likes');
$aside['$like_title'] = L10n::t('Latest likes');
$aside['$like_items'] = [];
$r = q("SELECT `T1`.`created`, `T1`.`liker`, `T1`.`liker-link`, `item`.* FROM
(SELECT `parent-uri`, `created`, `author-name` AS `liker`,`author-link` AS `liker-link`
@ -209,24 +210,24 @@ function communityhome_home(&$a, &$o){
case 'http://activitystrea.ms/schema/1.0/post':
switch ($rr['object-type']){
case 'http://activitystrea.ms/schema/1.0/event':
$post_type = t('event');
$post_type = L10n::t('event');
break;
default:
$post_type = t('status');
$post_type = L10n::t('status');
}
break;
default:
if ($rr['resource-id']){
$post_type = t('photo');
$post_type = L10n::t('photo');
$m=[]; preg_match("/\[url=([^]]*)\]/", $rr['body'], $m);
$rr['plink'] = $m[1];
} else {
$post_type = t('status');
$post_type = L10n::t('status');
}
}
$plink = '<a href="' . $rr['plink'] . '">' . $post_type . '</a>';
$aside['$like_items'][] = sprintf( t('%1$s likes %2$s\'s %3$s'), $author, $objauthor, $plink);
$aside['$like_items'][] = sprintf(L10n::t('%1$s likes %2$s\'s %3$s'), $author, $objauthor, $plink);
}
}
@ -235,7 +236,7 @@ function communityhome_home(&$a, &$o){
$tpl = get_markup_template('communityhome.tpl', 'addon/communityhome/');
$a->page['aside'] = replace_macros($tpl, $aside);
$o = '<h1>' . ((x($a->config,'sitename')) ? sprintf( t("Welcome to %s") ,$a->config['sitename']) : "" ) . '</h1>';
$o = '<h1>' . ((x($a->config,'sitename')) ? sprintf(L10n::t("Welcome to %s") ,$a->config['sitename']) : "" ) . '</h1>';
if(file_exists('home.html'))
$o = file_get_contents('home.html');

View File

@ -9,13 +9,14 @@
*
*/
require_once('include/network.php');
require_once("mod/proxy.php");
require_once('include/text.php');
require_once 'include/network.php';
require_once 'mod/proxy.php';
require_once 'include/text.php';
use Friendica\Core\Addon;
use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
// get the weather data from OpenWeatherMap
@ -33,7 +34,7 @@ function getWeather( $loc, $units='metric', $lang='en', $appid='', $cachetime=0)
try {
$res = new SimpleXMLElement(fetch_url($url));
} catch (Exception $e) {
info(t('Error fetching weather data.\nError was: '.$e->getMessage()));
info(L10n::t('Error fetching weather data.\nError was: '.$e->getMessage()));
return false;
}
if ((string)$res->temperature['unit']==='metric') {
@ -114,26 +115,26 @@ function curweather_network_mod_init(&$fk_app,&$b) {
if ($ok) {
$t = get_markup_template("widget.tpl", "addon/curweather/" );
$curweather = replace_macros ($t, [
'$title' => t("Current Weather"),
'$title' => L10n::t("Current Weather"),
'$icon' => proxy_url('http://openweathermap.org/img/w/'.$res['icon'].'.png'),
'$city' => $res['city'],
'$lon' => $res['lon'],
'$lat' => $res['lat'],
'$description' => $res['descripion'],
'$temp' => $res['temperature'],
'$relhumidity' => ['caption'=>t('Relative Humidity'), 'val'=>$res['humidity']],
'$pressure' => ['caption'=>t('Pressure'), 'val'=>$res['pressure']],
'$wind' => ['caption'=>t('Wind'), 'val'=> $res['wind']],
'$lastupdate' => t('Last Updated').': '.$res['update'].'UTC',
'$databy' => t('Data by'),
'$showonmap' => t('Show on map')
'$relhumidity' => ['caption'=>L10n::t('Relative Humidity'), 'val'=>$res['humidity']],
'$pressure' => ['caption'=>L10n::t('Pressure'), 'val'=>$res['pressure']],
'$wind' => ['caption'=>L10n::t('Wind'), 'val'=> $res['wind']],
'$lastupdate' => L10n::t('Last Updated').': '.$res['update'].'UTC',
'$databy' => L10n::t('Data by'),
'$showonmap' => L10n::t('Show on map')
]);
} else {
$t = get_markup_template('widget-error.tpl', 'addon/curweather/');
$curweather = replace_macros( $t, [
'$problem' => t('There was a problem accessing the weather data. But have a look'),
'$problem' => L10n::t('There was a problem accessing the weather data. But have a look'),
'$rpt' => $rpt,
'$atOWM' => t('at OpenWeatherMap')
'$atOWM' => L10n::t('at OpenWeatherMap')
]);
}
@ -149,7 +150,7 @@ function curweather_addon_settings_post($a,$post) {
PConfig::set(local_user(),'curweather','curweather_enable',intval($_POST['curweather_enable']));
PConfig::set(local_user(),'curweather','curweather_units',trim($_POST['curweather_units']));
info( t('Current Weather settings updated.') . EOL);
info(L10n::t('Current Weather settings updated.') . EOL);
}
@ -164,7 +165,7 @@ function curweather_addon_settings(&$a,&$s) {
$curweather_units = PConfig::get(local_user(), 'curweather', 'curweather_units');
$appid = Config::get('curweather','appid');
if ($appid=="") {
$noappidtext = t('No APPID found, please contact your admin to obtain one.');
$noappidtext = L10n::t('No APPID found, please contact your admin to obtain one.');
} else {
$noappidtext = '';
}
@ -174,13 +175,13 @@ function curweather_addon_settings(&$a,&$s) {
// load template and replace the macros
$t = get_markup_template("settings.tpl", "addon/curweather/" );
$s = replace_macros ($t, [
'$submit' => t('Save Settings'),
'$header' => t('Current Weather').' '.t('Settings'),
'$submit' => L10n::t('Save Settings'),
'$header' => L10n::t('Current Weather').' '.L10n::t('Settings'),
'$noappidtext' => $noappidtext,
'$info' => t('Enter either the name of your location or the zip code.'),
'$curweather_loc' => [ 'curweather_loc', t('Your Location'), $curweather_loc, t('Identifier of your location (name or zip code), e.g. <em>Berlin,DE</em> or <em>14476,DE</em>.') ],
'$curweather_units' => [ 'curweather_units', t('Units'), $curweather_units, t('select if the temperature should be displayed in &deg;C or &deg;F'), ['metric'=>'°C', 'imperial'=>'°F']],
'$enabled' => [ 'curweather_enable', t('Show weather data'), $enable, '']
'$info' => L10n::t('Enter either the name of your location or the zip code.'),
'$curweather_loc' => [ 'curweather_loc', L10n::t('Your Location'), $curweather_loc, L10n::t('Identifier of your location (name or zip code), e.g. <em>Berlin,DE</em> or <em>14476,DE</em>.') ],
'$curweather_units' => [ 'curweather_units', L10n::t('Units'), $curweather_units, L10n::t('select if the temperature should be displayed in &deg;C or &deg;F'), ['metric'=>'°C', 'imperial'=>'°F']],
'$enabled' => [ 'curweather_enable', L10n::t('Show weather data'), $enable, '']
]);
return;
@ -193,7 +194,7 @@ function curweather_addon_admin_post (&$a) {
if ($_POST['curweather-submit']) {
Config::set('curweather','appid',trim($_POST['appid']));
Config::set('curweather','cachetime',trim($_POST['cachetime']));
info( t('Curweather settings saved.'.EOL));
info(L10n::t('Curweather settings saved.'.EOL));
}
}
function curweather_addon_admin (&$a, &$o) {
@ -203,8 +204,8 @@ function curweather_addon_admin (&$a, &$o) {
$cachetime = Config::get('curweather','cachetime');
$t = get_markup_template("admin.tpl", "addon/curweather/" );
$o = replace_macros ($t, [
'$submit' => t('Save Settings'),
'$cachetime' => ['cachetime', t('Caching Interval'), $cachetime, t('For how long should the weather data be cached? Choose according your OpenWeatherMap account type.'), ['0'=>t('no cache'), '300'=>'5 '.t('minutes'), '900'=>'15 '.t('minutes'), '1800'=>'30 '.t('minutes'), '3600'=>'60 '.t('minutes')]],
'$appid' => ['appid', t('Your APPID'), $appid, t('Your API key provided by OpenWeatherMap')]
'$submit' => L10n::t('Save Settings'),
'$cachetime' => ['cachetime', L10n::t('Caching Interval'), $cachetime, L10n::t('For how long should the weather data be cached? Choose according your OpenWeatherMap account type.'), ['0'=>L10n::t('no cache'), '300'=>'5 '.L10n::t('minutes'), '900'=>'15 '.L10n::t('minutes'), '1800'=>'30 '.L10n::t('minutes'), '3600'=>'60 '.L10n::t('minutes')]],
'$appid' => ['appid', L10n::t('Your APPID'), $appid, L10n::t('Your API key provided by OpenWeatherMap')]
]);
}

View File

@ -1,5 +1,7 @@
<?php
use Friendica\Core\L10n;
class Sabre_CalDAV_Backend_Private extends Sabre_CalDAV_Backend_Common
{
@ -36,7 +38,7 @@ class Sabre_CalDAV_Backend_Private extends Sabre_CalDAV_Backend_Common
*/
public static function getBackendTypeName()
{
return t("Private Events");
return L10n::t("Private Events");
}
/**

View File

@ -1,5 +1,7 @@
<?php
use Friendica\Core\L10n;
class Sabre_CardDAV_Backend_Std extends Sabre_CardDAV_Backend_Common
{
@ -43,7 +45,7 @@ class Sabre_CardDAV_Backend_Std extends Sabre_CardDAV_Backend_Common
*/
public static function getBackendTypeName()
{
return t("Private Addressbooks");
return L10n::t("Private Addressbooks");
}
/**

View File

@ -1,7 +1,6 @@
<?php
use Friendica\Core\L10n;
/**
* @param mixed $obj
@ -89,7 +88,7 @@ function wdcal_print_feed($base_path = "")
$cs = wdcal_print_feed_getCal($server, DAV_ACL_WRITE);
if ($cs == null) {
echo wdcal_jsonp_encode(array('IsSuccess' => false,
'Msg' => t('No access')));
'Msg' => L10n::t('No access')));
killme();
}
try {
@ -163,7 +162,7 @@ function wdcal_print_feed($base_path = "")
$r = q("SELECT `calendarobject_id`, `calendar_id` FROM %s%sjqcalendar WHERE `id`=%d", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($_REQUEST["jq_id"]));
if (count($r) != 1) {
echo wdcal_jsonp_encode(array('IsSuccess' => false,
'Msg' => t('No access')));
'Msg' => L10n::t('No access')));
killme();
}
try {
@ -175,7 +174,7 @@ function wdcal_print_feed($base_path = "")
if (!$component) {
echo wdcal_jsonp_encode(array('IsSuccess' => false,
'Msg' => t('No access')));
'Msg' => L10n::t('No access')));
killme();
}
@ -203,7 +202,7 @@ function wdcal_print_feed($base_path = "")
);
} catch (Exception $e) {
echo wdcal_jsonp_encode(array('IsSuccess' => false,
'Msg' => t('No access')));
'Msg' => L10n::t('No access')));
killme();
}
break;
@ -211,7 +210,7 @@ function wdcal_print_feed($base_path = "")
$r = q("SELECT `calendarobject_id`, `calendar_id` FROM %s%sjqcalendar WHERE `id`=%d", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($_REQUEST["jq_id"]));
if (count($r) != 1) {
echo wdcal_jsonp_encode(array('IsSuccess' => false,
'Msg' => t('No access')));
'Msg' => L10n::t('No access')));
killme();
}
try {
@ -226,7 +225,7 @@ function wdcal_print_feed($base_path = "")
);
} catch (Exception $e) {
echo wdcal_jsonp_encode(array('IsSuccess' => false,
'Msg' => t('No access')));
'Msg' => L10n::t('No access')));
killme();
}

View File

@ -1,5 +1,6 @@
<?php
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
abstract class wdcal_local
@ -147,7 +148,7 @@ class wdcal_local_us extends wdcal_local {
* @return string
*/
static function getName() {
return t("U.S. Time Format (mm/dd/YYYY)");
return L10n::t("U.S. Time Format (mm/dd/YYYY)");
}
/**
@ -242,7 +243,7 @@ class wdcal_local_de extends wdcal_local {
* @return string
*/
static function getName() {
return t("German Time Format (dd.mm.YYYY)");
return L10n::t("German Time Format (dd.mm.YYYY)");
}
/**

View File

@ -1,5 +1,7 @@
<?php
use Friendica\Core\L10n;
/**
* @param wdcal_local $localization
* @param string $baseurl
@ -27,7 +29,7 @@ function wdcal_getEditPage_str(&$localization, $baseurl, $calendar_id, $uri)
$vObject = dav_get_current_user_calendarobject($server, $calendar, $obj_uri["uri"], DAV_ACL_WRITE);
$component = dav_get_eventComponent($vObject);
if ($component == null) return t('Could not open component for editing');
if ($component == null) return L10n::t('Could not open component for editing');
/** @var Sabre\VObject\Property\DateTime $dtstart */
$dtstart = $component->__get("DTSTART");
@ -137,13 +139,13 @@ function wdcal_getEditPage_str(&$localization, $baseurl, $calendar_id, $uri)
$postto = $baseurl . "/dav/wdcal/" . ($uri == 0 ? "new/" : $calendar_id . "/" . $uri . "/edit/");
$out = "<a href='" . $baseurl . "/dav/wdcal/'>" . t("Go back to the calendar") . "</a><br><br>";
$out = "<a href='" . $baseurl . "/dav/wdcal/'>" . L10n::t("Go back to the calendar") . "</a><br><br>";
$out .= "<form method='POST' action='$postto'>
<input type='hidden' name='form_security_token' value='" . get_form_security_token('caledit') . "'>\n";
$out .= "<h2>" . t("Event data") . "</h2>";
$out .= "<h2>" . L10n::t("Event data") . "</h2>";
$out .= "<label for='calendar' class='block'>" . t("Calendar") . ":</label><select id='calendar' name='calendar' size='1'>";
$out .= "<label for='calendar' class='block'>" . L10n::t("Calendar") . ":</label><select id='calendar' name='calendar' size='1'>";
$found = false;
$cal_col = "aaaaaa";
foreach ($calendars as $cal) {
@ -160,47 +162,47 @@ function wdcal_getEditPage_str(&$localization, $baseurl, $calendar_id, $uri)
$out .= "</select>";
$out .= "&nbsp; &nbsp; <label class='plain'><input type='checkbox' name='color_override' id='color_override' ";
if (!is_null($event["Color"])) $out .= "checked";
$out .= "> " . t("Special color") . ":</label>";
$out .= "> " . L10n::t("Special color") . ":</label>";
$out .= "<span id='cal_color_holder' ";
if (is_null($event["Color"])) $out .= "style='display: none;'";
$out .= "><input name='color' id='cal_color' value='" . (is_null($event["Color"]) ? "#" . $cal_col : escape_tags($event["Color"])) . "'></span>";
$out .= "<br>\n";
$out .= "<label class='block' for='cal_summary'>" . t("Subject") . ":</label>
$out .= "<label class='block' for='cal_summary'>" . L10n::t("Subject") . ":</label>
<input name='summary' id='cal_summary' value=\"" . escape_tags($event["Summary"]) . "\"><br>\n";
$out .= "<label class='block' for='cal_allday'>Is All-Day event:</label><input type='checkbox' name='allday' id='cal_allday' " . ($event["IsAllDayEvent"] ? "checked" : "") . "><br>\n";
$out .= "<label class='block' for='cal_start_date'>" . t("Starts") . ":</label>";
$out .= "<label class='block' for='cal_start_date'>" . L10n::t("Starts") . ":</label>";
$out .= "<input name='start_date' value='" . $localization->dateformat_datepicker_php($event["StartTime"]) . "' id='cal_start_date'>";
$out .= "<input name='start_time' value='" . date("H:i", $event["StartTime"]) . "' id='cal_start_time'>";
$out .= "<br>\n";
$out .= "<label class='block' for='cal_end_date'>" . t("Ends") . ":</label>";
$out .= "<label class='block' for='cal_end_date'>" . L10n::t("Ends") . ":</label>";
$out .= "<input name='end_date' value='" . $localization->dateformat_datepicker_php($event["EndTime"]) . "' id='cal_end_date'>";
$out .= "<input name='end_time' value='" . date("H:i", $event["EndTime"]) . "' id='cal_end_time'>";
$out .= "<br>\n";
$out .= "<label class='block' for='cal_location'>" . t("Location") . ":</label><input name='location' id='cal_location' value=\"" . escape_tags($event["Location"]) . "\"><br>\n";
$out .= "<label class='block' for='cal_location'>" . L10n::t("Location") . ":</label><input name='location' id='cal_location' value=\"" . escape_tags($event["Location"]) . "\"><br>\n";
$out .= "<label class='block' for='event-desc-textarea'>" . t("Description") . ":</label> <textarea id='event-desc-textarea' name='wdcal_desc' style='vertical-align: top; width: 400px; height: 100px;'>" . escape_tags($event["Description"]) . "</textarea>";
$out .= "<label class='block' for='event-desc-textarea'>" . L10n::t("Description") . ":</label> <textarea id='event-desc-textarea' name='wdcal_desc' style='vertical-align: top; width: 400px; height: 100px;'>" . escape_tags($event["Description"]) . "</textarea>";
$out .= "<br style='clear: both;'>";
$out .= "<h2>" . t("Recurrence") . "</h2>";
$out .= "<h2>" . L10n::t("Recurrence") . "</h2>";
$out .= "<label class='block' for='rec_frequency'>" . t("Frequency") . ":</label> <select id='rec_frequency' name='rec_frequency' size='1'>";
$out .= "<option value=''>" . t("None") . "</option>\n";
$out .= "<label class='block' for='rec_frequency'>" . L10n::t("Frequency") . ":</label> <select id='rec_frequency' name='rec_frequency' size='1'>";
$out .= "<option value=''>" . L10n::t("None") . "</option>\n";
$out .= "<option value='daily' ";
if ($recurrence && $recurrence->frequency == "daily") $out .= "selected";
$out .= ">" . t("Daily") . "</option>\n";
$out .= ">" . L10n::t("Daily") . "</option>\n";
$out .= "<option value='weekly' ";
if ($recurrence && $recurrence->frequency == "weekly") $out .= "selected";
$out .= ">" . t("Weekly") . "</option>\n";
$out .= ">" . L10n::t("Weekly") . "</option>\n";
$out .= "<option value='monthly' ";
if ($recurrence && $recurrence->frequency == "monthly") $out .= "selected";
$out .= ">" . t("Monthly") . "</option>\n";
$out .= ">" . L10n::t("Monthly") . "</option>\n";
$out .= "<option value='yearly' ";
if ($recurrence && $recurrence->frequency == "yearly") $out .= "selected";
$out .= ">" . t("Yearly") . "</option>\n";
$out .= ">" . L10n::t("Yearly") . "</option>\n";
$out .= "</select><br>\n";
$out .= "<div id='rec_details'>";
@ -211,15 +213,15 @@ function wdcal_getEditPage_str(&$localization, $baseurl, $calendar_id, $uri)
$select .= ">$i</option>\n";
}
$select .= "</select>";
$time = "<span class='rec_daily'>" . t("days") . "</span>";
$time .= "<span class='rec_weekly'>" . t("weeks") . "</span>";
$time .= "<span class='rec_monthly'>" . t("months") . "</span>";
$time .= "<span class='rec_yearly'>" . t("years") . "</span>";
$out .= "<label class='block'>" . t("Interval") . ":</label> " . str_replace(array("%select%", "%time%"), array($select, $time), t("All %select% %time%")) . "<br>";
$time = "<span class='rec_daily'>" . L10n::t("days") . "</span>";
$time .= "<span class='rec_weekly'>" . L10n::t("weeks") . "</span>";
$time .= "<span class='rec_monthly'>" . L10n::t("months") . "</span>";
$time .= "<span class='rec_yearly'>" . L10n::t("years") . "</span>";
$out .= "<label class='block'>" . L10n::t("Interval") . ":</label> " . str_replace(array("%select%", "%time%"), array($select, $time), L10n::t("All %select% %time%")) . "<br>";
$out .= "<div class='rec_daily'>";
$out .= "<label class='block'>" . t("Days") . ":</label>";
$out .= "<label class='block'>" . L10n::t("Days") . ":</label>";
if ($recurrence && $recurrence->byDay) {
$byday = $recurrence->byDay;
} else {
@ -228,36 +230,36 @@ function wdcal_getEditPage_str(&$localization, $baseurl, $calendar_id, $uri)
if ($localization->getFirstDayOfWeek() == 0) {
$out .= "<label class='plain'><input class='rec_daily_byday' type='checkbox' name='rec_daily_byday[]' value='SU' ";
if (in_array("SU", $byday)) $out .= "checked";
$out .= ">" . t("Sunday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Sunday") . "</label> &nbsp; ";
}
$out .= "<label class='plain'><input class='rec_daily_byday' type='checkbox' name='rec_daily_byday[]' value='MO' ";
if (in_array("MO", $byday)) $out .= "checked";
$out .= ">" . t("Monday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Monday") . "</label> &nbsp; ";
$out .= "<label class='plain'><input class='rec_daily_byday' type='checkbox' name='rec_daily_byday[]' value='TU' ";
if (in_array("TU", $byday)) $out .= "checked";
$out .= ">" . t("Tuesday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Tuesday") . "</label> &nbsp; ";
$out .= "<label class='plain'><input class='rec_daily_byday' type='checkbox' name='rec_daily_byday[]' value='WE' ";
if (in_array("WE", $byday)) $out .= "checked";
$out .= ">" . t("Wednesday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Wednesday") . "</label> &nbsp; ";
$out .= "<label class='plain'><input class='rec_daily_byday' type='checkbox' name='rec_daily_byday[]' value='TH' ";
if (in_array("TH", $byday)) $out .= "checked";
$out .= ">" . t("Thursday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Thursday") . "</label> &nbsp; ";
$out .= "<label class='plain'><input class='rec_daily_byday' type='checkbox' name='rec_daily_byday[]' value='FR' ";
if (in_array("FR", $byday)) $out .= "checked";
$out .= ">" . t("Friday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Friday") . "</label> &nbsp; ";
$out .= "<label class='plain'><input class='rec_daily_byday' type='checkbox' name='rec_daily_byday[]' value='SA' ";
if (in_array("SA", $byday)) $out .= "checked";
$out .= ">" . t("Saturday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Saturday") . "</label> &nbsp; ";
if ($localization->getFirstDayOfWeek() != 0) {
$out .= "<label class='plain'><input class='rec_daily_byday' type='checkbox' name='rec_daily_byday[]' value='SU' ";
if (in_array("SU", $byday)) $out .= "checked";
$out .= ">" . t("Sunday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Sunday") . "</label> &nbsp; ";
}
$out .= "</div>";
$out .= "<div class='rec_weekly'>";
$out .= "<label class='block'>" . t("Days") . ":</label>";
$out .= "<label class='block'>" . L10n::t("Days") . ":</label>";
if ($recurrence && $recurrence->byDay) {
$byday = $recurrence->byDay;
} else {
@ -267,34 +269,34 @@ function wdcal_getEditPage_str(&$localization, $baseurl, $calendar_id, $uri)
if ($localization->getFirstDayOfWeek() == 0) {
$out .= "<label class='plain'><input class='rec_weekly_byday' type='checkbox' name='rec_weekly_byday[]' value='SU' ";
if (in_array("SU", $byday)) $out .= "checked";
$out .= ">" . t("Sunday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Sunday") . "</label> &nbsp; ";
}
$out .= "<label class='plain'><input class='rec_weekly_byday' type='checkbox' name='rec_weekly_byday[]' value='MO' ";
if (in_array("MO", $byday)) $out .= "checked";
$out .= ">" . t("Monday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Monday") . "</label> &nbsp; ";
$out .= "<label class='plain'><input class='rec_weekly_byday' type='checkbox' name='rec_weekly_byday[]' value='TU' ";
if (in_array("TU", $byday)) $out .= "checked";
$out .= ">" . t("Tuesday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Tuesday") . "</label> &nbsp; ";
$out .= "<label class='plain'><input class='rec_weekly_byday' type='checkbox' name='rec_weekly_byday[]' value='WE' ";
if (in_array("WE", $byday)) $out .= "checked";
$out .= ">" . t("Wednesday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Wednesday") . "</label> &nbsp; ";
$out .= "<label class='plain'><input class='rec_weekly_byday' type='checkbox' name='rec_weekly_byday[]' value='TH' ";
if (in_array("TH", $byday)) $out .= "checked";
$out .= ">" . t("Thursday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Thursday") . "</label> &nbsp; ";
$out .= "<label class='plain'><input class='rec_weekly_byday' type='checkbox' name='rec_weekly_byday[]' value='FR' ";
if (in_array("FR", $byday)) $out .= "checked";
$out .= ">" . t("Friday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Friday") . "</label> &nbsp; ";
$out .= "<label class='plain'><input class='rec_weekly_byday' type='checkbox' name='rec_weekly_byday[]' value='SA' ";
if (in_array("SA", $byday)) $out .= "checked";
$out .= ">" . t("Saturday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Saturday") . "</label> &nbsp; ";
if ($localization->getFirstDayOfWeek() != 0) {
$out .= "<label class='plain'><input class='rec_weekly_byday' type='checkbox' name='rec_weekly_byday[]' value='SU' ";
if (in_array("SU", $byday)) $out .= "checked";
$out .= ">" . t("Sunday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Sunday") . "</label> &nbsp; ";
}
$out .= "<br>";
$out .= "<label class='block'>" . t("First day of week:") . "</label>";
$out .= "<label class='block'>" . L10n::t("First day of week:") . "</label>";
if ($recurrence && $recurrence->weekStart != "") $wkst = $recurrence->weekStart;
else {
if ($localization->getFirstDayOfWeek() == 0) $wkst = "SU";
@ -302,10 +304,10 @@ function wdcal_getEditPage_str(&$localization, $baseurl, $calendar_id, $uri)
}
$out .= "<label class='plain'><input type='radio' name='rec_weekly_wkst' value='SU' ";
if ($wkst == "SU") $out .= "checked";
$out .= ">" . t("Sunday") . "</label> &nbsp; ";
$out .= ">" . L10n::t("Sunday") . "</label> &nbsp; ";
$out .= "<label class='plain'><input type='radio' name='rec_weekly_wkst' value='MO' ";
if ($wkst == "MO") $out .= "checked";
$out .= ">" . t("Monday") . "</label><br>\n";
$out .= ">" . L10n::t("Monday") . "</label><br>\n";
$out .= "</div>";
@ -347,20 +349,20 @@ function wdcal_getEditPage_str(&$localization, $baseurl, $calendar_id, $uri)
}
$out .= "<div class='rec_monthly'>";
$out .= "<label class='block' for='rec_monthly_day'>" . t("Day of month") . ":</label>";
$out .= "<label class='block' for='rec_monthly_day'>" . L10n::t("Day of month") . ":</label>";
$out .= "<select id='rec_monthly_day' name='rec_monthly_day' size='1'>";
$out .= "<option value='bymonthday' ";
if ($monthly_rule == "bymonthday") $out .= "selected";
$out .= ">" . t("#num#th of each month") . "</option>\n";
$out .= ">" . L10n::t("#num#th of each month") . "</option>\n";
$out .= "<option value='bymonthday_neg' ";
if ($monthly_rule == "bymonthday_neg") $out .= "selected";
$out .= ">" . t("#num#th-last of each month") . "</option>\n";
$out .= ">" . L10n::t("#num#th-last of each month") . "</option>\n";
$out .= "<option value='byday' ";
if ($monthly_rule == "byday") $out .= "selected";
$out .= ">" . t("#num#th #wkday# of each month") . "</option>\n";
$out .= ">" . L10n::t("#num#th #wkday# of each month") . "</option>\n";
$out .= "<option value='byday_neg' ";
if ($monthly_rule == "byday_neg") $out .= "selected";
$out .= ">" . t("#num#th-last #wkday# of each month") . "</option>\n";
$out .= ">" . L10n::t("#num#th-last #wkday# of each month") . "</option>\n";
$out .= "</select>";
$out .= "</div>\n";
@ -369,21 +371,21 @@ function wdcal_getEditPage_str(&$localization, $baseurl, $calendar_id, $uri)
}
$out .= "<div class='rec_yearly'>";
$out .= "<label class='block'>" . t("Month") . ":</label> <span class='rec_month_name'>#month#</span><br>\n";
$out .= "<label class='block' for='rec_yearly_day'>" . t("Day of month") . ":</label>";
$out .= "<label class='block'>" . L10n::t("Month") . ":</label> <span class='rec_month_name'>#month#</span><br>\n";
$out .= "<label class='block' for='rec_yearly_day'>" . L10n::t("Day of month") . ":</label>";
$out .= "<select id='rec_yearly_day' name='rec_yearly_day' size='1'>";
$out .= "<option value='bymonthday' ";
if ($monthly_rule == "bymonthday") $out .= "selected";
$out .= ">" . t("#num#th of the given month") . "</option>\n";
$out .= ">" . L10n::t("#num#th of the given month") . "</option>\n";
$out .= "<option value='bymonthday_neg' ";
if ($monthly_rule == "bymonthday_neg") $out .= "selected";
$out .= ">" . t("#num#th-last of the given month") . "</option>\n";
$out .= ">" . L10n::t("#num#th-last of the given month") . "</option>\n";
$out .= "<option value='byday' ";
if ($monthly_rule == "byday") $out .= "selected";
$out .= ">" . t("#num#th #wkday# of the given month") . "</option>\n";
$out .= ">" . L10n::t("#num#th #wkday# of the given month") . "</option>\n";
$out .= "<option value='byday_neg' ";
if ($monthly_rule == "byday_neg") $out .= "selected";
$out .= ">" . t("#num#th-last #wkday# of the given month") . "</option>\n";
$out .= ">" . L10n::t("#num#th-last #wkday# of the given month") . "</option>\n";
$out .= "</select>";
$out .= "</div>\n";
@ -410,26 +412,26 @@ function wdcal_getEditPage_str(&$localization, $baseurl, $calendar_id, $uri)
$rule_until_date = time();
$rule_until_count = 1;
}
$out .= "<label class='block' for='rec_until_type'>" . t("Repeat until") . ":</label> ";
$out .= "<label class='block' for='rec_until_type'>" . L10n::t("Repeat until") . ":</label> ";
$out .= "<select name='rec_until_type' id='rec_until_type' size='1'>";
$out .= "<option value='infinite' ";
if ($rule_type == "infinite") $out .= "selected";
$out .= ">" . t("Infinite") . "</option>\n";
$out .= ">" . L10n::t("Infinite") . "</option>\n";
$out .= "<option value='date' ";
if ($rule_type == "date") $out .= "selected";
$out .= ">" . t("Until the following date") . ":</option>\n";
$out .= ">" . L10n::t("Until the following date") . ":</option>\n";
$out .= "<option value='count' ";
if ($rule_type == "count") $out .= "selected";
$out .= ">" . t("Number of times") . ":</option>\n";
$out .= ">" . L10n::t("Number of times") . ":</option>\n";
$out .= "</select>";
$out .= "<input name='rec_until_date' value='" . $localization->dateformat_datepicker_php($rule_until_date) . "' id='rec_until_date'>";
$out .= "<input name='rec_until_count' value='$rule_until_count' id='rec_until_count'><br>";
$out .= "<label class='block'>" . t("Exceptions") . ":</label><div class='rec_exceptions'>";
$out .= "<label class='block'>" . L10n::t("Exceptions") . ":</label><div class='rec_exceptions'>";
$out .= "<div class='rec_exceptions_none' ";
if (count($recurrentce_exdates) > 0) $out .= "style='display: none;'";
$out .= ">" . t("none") . "</div>";
$out .= ">" . L10n::t("none") . "</div>";
$out .= "<div class='rec_exceptions_holder' ";
if (count($recurrentce_exdates) == 0) $out .= "style='display: none;'";
$out .= ">";
@ -446,7 +448,7 @@ function wdcal_getEditPage_str(&$localization, $baseurl, $calendar_id, $uri)
$out .= "</div><br>";
$out .= "<h2>" . t("Notification") . "</h2>";
$out .= "<h2>" . L10n::t("Notification") . "</h2>";
if (!$notifications) $notifications = array();
$notifications["new"] = array(
@ -463,33 +465,33 @@ function wdcal_getEditPage_str(&$localization, $baseurl, $calendar_id, $uri)
$out .= "<div class='noti_holder' ";
if (!is_numeric($index) && $index == "new") $out .= "style='display: none;' id='noti_new_row'";
$out .= "><label class='block' for='noti_type_" . $index . "'>" . t("Notify by") . ":</label>";
$out .= "><label class='block' for='noti_type_" . $index . "'>" . L10n::t("Notify by") . ":</label>";
$out .= "<select name='noti_type[$index]' size='1' id='noti_type_" . $index . "'>";
$out .= "<option value=''>- " . t("Remove") . " -</option>\n";
$out .= "<option value='email' "; if (!$unparsable && $noti["action"] == "email") $out .= "selected"; $out .= ">" . t("E-Mail") . "</option>\n";
$out .= "<option value='display' "; if (!$unparsable && $noti["action"] == "display") $out .= "selected"; $out .= ">" . t("On Friendica / Display") . "</option>\n";
//$out .= "<option value='other' "; if ($unparsable) $out .= "selected"; $out .= ">- " . t("other (leave it untouched)") . " -</option>\n"; // @TODO
$out .= "<option value=''>- " . L10n::t("Remove") . " -</option>\n";
$out .= "<option value='email' "; if (!$unparsable && $noti["action"] == "email") $out .= "selected"; $out .= ">" . L10n::t("E-Mail") . "</option>\n";
$out .= "<option value='display' "; if (!$unparsable && $noti["action"] == "display") $out .= "selected"; $out .= ">" . L10n::t("On Friendica / Display") . "</option>\n";
//$out .= "<option value='other' "; if ($unparsable) $out .= "selected"; $out .= ">- " . L10n::t("other (leave it untouched)") . " -</option>\n"; // @TODO
$out .= "</select><br>";
$out .= "<label class='block'>" . t("Time") . ":</label>";
$out .= "<label class='block'>" . L10n::t("Time") . ":</label>";
$out .= "<input name='noti_value[$index]' size='5' style='width: 5em;' value='" . $noti["trigger_value"] . "'>";
$out .= "<select name='noti_unit[$index]' size='1'>";
$out .= "<option value='H' "; if ($noti["trigger_unit"] == "hour") $out .= "selected"; $out .= ">" . t("Hours") . "</option>\n";
$out .= "<option value='M' "; if ($noti["trigger_unit"] == "minute") $out .= "selected"; $out .= ">" . t("Minutes") . "</option>\n";
$out .= "<option value='S' "; if ($noti["trigger_unit"] == "second") $out .= "selected"; $out .= ">" . t("Seconds") . "</option>\n";
$out .= "<option value='D' "; if ($noti["trigger_unit"] == "day") $out .= "selected"; $out .= ">" . t("Days") . "</option>\n";
$out .= "<option value='W' "; if ($noti["trigger_unit"] == "week") $out .= "selected"; $out .= ">" . t("Weeks") . "</option>\n";
$out .= "<option value='H' "; if ($noti["trigger_unit"] == "hour") $out .= "selected"; $out .= ">" . L10n::t("Hours") . "</option>\n";
$out .= "<option value='M' "; if ($noti["trigger_unit"] == "minute") $out .= "selected"; $out .= ">" . L10n::t("Minutes") . "</option>\n";
$out .= "<option value='S' "; if ($noti["trigger_unit"] == "second") $out .= "selected"; $out .= ">" . L10n::t("Seconds") . "</option>\n";
$out .= "<option value='D' "; if ($noti["trigger_unit"] == "day") $out .= "selected"; $out .= ">" . L10n::t("Days") . "</option>\n";
$out .= "<option value='W' "; if ($noti["trigger_unit"] == "week") $out .= "selected"; $out .= ">" . L10n::t("Weeks") . "</option>\n";
$out .= "</select>";
$out .= " <label class='plain'>" . t("before the") . " <select name='noti_ref[$index]' size='1'>";
$out .= "<option value='start' "; if ($noti["rel"] == "start") $out .= "selected"; $out .= ">" . t("start of the event") . "</option>\n";
$out .= "<option value='end' "; if ($noti["rel"] == "end") $out .= "selected"; $out .= ">" . t("end of the event") . "</option>\n";
$out .= " <label class='plain'>" . L10n::t("before the") . " <select name='noti_ref[$index]' size='1'>";
$out .= "<option value='start' "; if ($noti["rel"] == "start") $out .= "selected"; $out .= ">" . L10n::t("start of the event") . "</option>\n";
$out .= "<option value='end' "; if ($noti["rel"] == "end") $out .= "selected"; $out .= ">" . L10n::t("end of the event") . "</option>\n";
$out .= "</select></label>\n";
$out .= "</div>";
}
$out .= "<input type='hidden' name='new_alarm' id='new_alarm' value='0'><div id='new_alarm_adder'><a href='#'>" . t("Add a notification") . "</a></div>";
$out .= "<input type='hidden' name='new_alarm' id='new_alarm' value='0'><div id='new_alarm_adder'><a href='#'>" . L10n::t("Add a notification") . "</a></div>";
$out .= "<script>\$(function() {
wdcal_edit_init('" . $localization->dateformat_datepicker_js() . "', '${baseurl}/dav/');
@ -684,7 +686,7 @@ function wdcal_set_component_alerts(&$component, &$localization, $summary, $dtst
"#date#", "#name",
), array(
$localization->date_timestamp2local($dtstart), $summary,
), t("The event #name# will start at #date"));
), L10n::t("The event #name# will start at #date"));
$alarm->add(new Sabre\VObject\Property("ACTION", "EMAIL"));
$alarm->add(new Sabre\VObject\Property("SUMMARY", $summary));
@ -693,7 +695,7 @@ function wdcal_set_component_alerts(&$component, &$localization, $summary, $dtst
break;
case "display":
$alarm->add(new Sabre\VObject\Property("ACTION", "DISPLAY"));
$text = str_replace("#name#