Update t() calls

Update all t() calls.
This commit is contained in:
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

@ -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#", $summary, t("#name# is about to begin."));
$text = str_replace("#name#", $summary, L10n::t("#name# is about to begin."));
$alarm->add(new Sabre\VObject\Property("DESCRIPTION", $text));
break;
default:
@ -735,7 +737,7 @@ function wdcal_postEditPage($uri, $uid = 0, $timezone = "", $goaway_url = "")
$vObject = dav_get_current_user_calendarobject($server, $calendar, $obj_uri, DAV_ACL_WRITE);
$component = dav_get_eventComponent($vObject);
if ($component == null) return array("ok" => false, "msg" => t('Could not open component for editing'));
if ($component == null) return array("ok" => false, "msg" => L10n::t('Could not open component for editing'));
} else {
$calendar = dav_get_current_user_calendar_by_id($server, $_REQUEST["calendar"], DAV_ACL_WRITE);
$vObject = dav_create_empty_vevent();
@ -766,7 +768,7 @@ function wdcal_postEditPage($uri, $uid = 0, $timezone = "", $goaway_url = "")
$obj = $calendar->getChild($obj_uri);
$obj->put($data);
}
return array("ok" => false, "msg" => t("Saved"));
return array("ok" => false, "msg" => L10n::t("Saved"));
}

View file

@ -1,5 +1,7 @@
<?php
use Friendica\Core\L10n;
$a = get_app();
$uri = parse_url($a->get_baseurl());
$path = "/";
@ -203,9 +205,9 @@ function wdcal_create_std_calendars_get_statements($user_id, $withcheck = true)
$stms = [];
$a = get_app();
$uris = [
'private' => t("Private Calendar"),
CALDAV_FRIENDICA_MINE => t("Friendica Events: Mine"),
CALDAV_FRIENDICA_CONTACTS => t("Friendica Events: Contacts"),
'private' => L10n::t("Private Calendar"),
CALDAV_FRIENDICA_MINE => L10n::t("Friendica Events: Mine"),
CALDAV_FRIENDICA_CONTACTS => L10n::t("Friendica Events: Contacts"),
];
foreach ($uris as $uri => $name) {
$cals = q("SELECT * FROM %s%scalendars WHERE `namespace` = %d AND `namespace_id` = %d AND `uri` = '%s'",
@ -245,8 +247,8 @@ function wdcal_create_std_addressbooks_get_statements($user_id, $withcheck = tru
$stms = [];
$a = get_app();
$uris = [
'private' => t("Private Addresses"),
CARDDAV_FRIENDICA_CONTACT => t("Friendica Contacts"),
'private' => L10n::t("Private Addresses"),
CARDDAV_FRIENDICA_CONTACT => L10n::t("Friendica Contacts"),
];
foreach ($uris as $uri => $name) {
$cals = q("SELECT * FROM %s%saddressbooks WHERE `namespace` = %d AND `namespace_id` = %d AND `uri` = '%s'",

View file

@ -1,5 +1,7 @@
<?php
use Friendica\Core\L10n;
class Sabre_CalDAV_Backend_Friendica extends Sabre_CalDAV_Backend_Virtual
{
@ -33,7 +35,7 @@ class Sabre_CalDAV_Backend_Friendica extends Sabre_CalDAV_Backend_Virtual
* @return string
*/
public static function getBackendTypeName() {
return t("Friendica-Native events");
return L10n::t("Friendica-Native events");
}
/**

View file

@ -1,5 +1,7 @@
<?php
use Friendica\Core\L10n;
class Sabre_CardDAV_Backend_Friendica extends Sabre_CardDAV_Backend_Virtual
{
@ -33,7 +35,7 @@ class Sabre_CardDAV_Backend_Friendica extends Sabre_CardDAV_Backend_Virtual
* @return string
*/
public static function getBackendTypeName() {
return t("Friendica-Contacts");
return L10n::t("Friendica-Contacts");
}
/**
@ -56,8 +58,8 @@ class Sabre_CardDAV_Backend_Friendica extends Sabre_CardDAV_Backend_Virtual
'id' => $books[0]["id"],
'uri' => "friendica",
'principaluri' => $principalUri,
'{DAV:}displayname' => t("Friendica-Contacts"),
'{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}addressbook-description' => t("Your Friendica-Contacts"),
'{DAV:}displayname' => L10n::t("Friendica-Contacts"),
'{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}addressbook-description' => L10n::t("Your Friendica-Contacts"),
'{http://calendarserver.org/ns/}getctag' => $ctag,
'{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}supported-address-data' =>
new Sabre_CardDAV_Property_SupportedAddressData(),

View file

@ -1,6 +1,7 @@
<?php
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
/**
@ -98,7 +99,7 @@ function wdcal_import_user_ics($calendar_id) {
if (!isset($imported[$uid])) $imported[$uid] = "";
$imported[$uid] .= $c->serialize();
} catch (Exception $e) {
notice(t("Something went wrong when trying to import the file. Sorry. Maybe some events were imported anyway."));
notice(L10n::t("Something went wrong when trying to import the file. Sorry. Maybe some events were imported anyway."));
}
if (isset($_REQUEST["overwrite"])) {
@ -130,28 +131,28 @@ function wdcal_import_user_ics($calendar_id) {
$calendar->createFile("import-" . $i . ".ics", $str);
$i++;
} catch (Exception $e) {
notice(t("Something went wrong when trying to import the file. Sorry."));
notice(L10n::t("Something went wrong when trying to import the file. Sorry."));
}
$o = t("The ICS-File has been imported.");
$o = L10n::t("The ICS-File has been imported.");
} catch (Exception $e) {
notice(t("Something went wrong when trying to import the file. Sorry. Maybe some events were imported anyway."));
notice(L10n::t("Something went wrong when trying to import the file. Sorry. Maybe some events were imported anyway."));
} else {
notice(t("No file was uploaded."));
notice(L10n::t("No file was uploaded."));
}
}
$o .= "<a href='" . $a->get_baseurl() . "/dav/wdcal/'>" . t("Go back to the calendar") . "</a><br><br>";
$o .= "<a href='" . $a->get_baseurl() . "/dav/wdcal/'>" . L10n::t("Go back to the calendar") . "</a><br><br>";
$num = q("SELECT COUNT(*) num FROM %s%scalendarobjects WHERE `calendar_id` = %d", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, $calendar_id);
$o .= "<h2>" . t("Import a ICS-file") . "</h2>";
$o .= "<h2>" . L10n::t("Import a ICS-file") . "</h2>";
$o .= '<form method="POST" action="' . $a->get_baseurl() . '/dav/wdcal/' . $calendar_id . '/ics-import/" enctype="multipart/form-data">';
$o .= "<input type='hidden' name='form_security_token' value='" . get_form_security_token('icsimport') . "'>\n";
$o .= "<label for='ics_file'>" . t("ICS-File") . "</label><input type='file' name='ics_file' id='ics_file'><br>\n";
if ($num[0]["num"] > 0) $o .= "<label for='overwrite'>" . str_replace("#num#", $num[0]["num"], t("Overwrite all #num# existing events")) . "</label> <input name='overwrite' id='overwrite' type='checkbox'><br>\n";
$o .= "<input type='submit' name='save' value='" . t("Upload") . "'>";
$o .= "<label for='ics_file'>" . L10n::t("ICS-File") . "</label><input type='file' name='ics_file' id='ics_file'><br>\n";
if ($num[0]["num"] > 0) $o .= "<label for='overwrite'>" . str_replace("#num#", $num[0]["num"], L10n::t("Overwrite all #num# existing events")) . "</label> <input name='overwrite' id='overwrite' type='checkbox'><br>\n";
$o .= "<input type='submit' name='save' value='" . L10n::t("Upload") . "'>";
$o .= '</form>';
return $o;
@ -224,14 +225,14 @@ function wdcal_printCalendar($calendars, $calendars_selected, $data_feed_url, $v
$x .= '<div class="ctoolbar">
<div class="fbutton faddbtn" style="float: right;">
<div><a href="' . $a->get_baseurl() . '/dav/settings/"><span>' . t("Settings") . ' / ' . t("Help") . '</span></a></div>
<div><a href="' . $a->get_baseurl() . '/dav/settings/"><span>' . L10n::t("Settings") . ' / ' . L10n::t("Help") . '</span></a></div>
</div>
<div class="fbutton addcal">
<div><a href="' . $a->get_baseurl() . '/dav/wdcal/new/" class="addcal">' . t("New event") . '</a></div>
<div><a href="' . $a->get_baseurl() . '/dav/wdcal/new/" class="addcal">' . L10n::t("New event") . '</a></div>
</div>
<div class="btnseparator"></div>
<div class="fbutton showtodaybtn">
<div><span class="showtoday">' . t("Today") . '</span></div>
<div><span class="showtoday">' . L10n::t("Today") . '</span></div>
</div>
<div class="btnseparator"></div>
@ -240,37 +241,37 @@ function wdcal_printCalendar($calendars, $calendars_selected, $data_feed_url, $v
if ($view == "day") $x .= 'fcurrent';
$x .= '">' . t("Day") . '</span></div>
$x .= '">' . L10n::t("Day") . '</span></div>
</div>
<div class="fbutton showweekbtn ';
if ($view == "week") $x .= "fcurrent";
$x .= '">
<div><span title="Week" class="showweekview">' . t("Week") . '</span></div>
<div><span title="Week" class="showweekview">' . L10n::t("Week") . '</span></div>
</div>
<div class="showmonthbtn fbutton ';
if ($view == "month") $x .= 'fcurrent';
$x .= '">
<div><span title="Month" class="showmonthview">' . t("Month") . '</span></div>
<div><span title="Month" class="showmonthview">' . L10n::t("Month") . '</span></div>
</div>
<div class="btnseparator"></div>
<div class="fbutton showreflashbtn">
<div><span class="showdayflash">' . t("Reload") . '</span></div>
<div><span class="showdayflash">' . L10n::t("Reload") . '</span></div>
</div>
<div class="btnseparator"></div>
<div title="' . t("Previous") . '" class="fbutton sfprevbtn">
<div title="' . L10n::t("Previous") . '" class="fbutton sfprevbtn">
<span class="fprev"></span>
</div>
<div title="' . t("Next") . '" class="fbutton sfnextbtn">
<div title="' . L10n::t("Next") . '" class="fbutton sfnextbtn">
<span class="fnext"></span>
</div>
<div class="fshowdatep fbutton" style="white-space: nowrap; position: relative;">
<input name="txtshow" class="hdtxtshow" style="position: absolute; bottom: 0; left: 0; width: 0; height: 0; border: 0; padding: 0; margin: 0;">
<span class="txtdatetimeshow">' . t("Date") . '</span>
<span class="txtdatetimeshow">' . L10n::t("Date") . '</span>
</div>
<div style="float: right;">
<div class="clear"></div>
@ -312,7 +313,7 @@ function wdcal_getDetailPage($calendar_id, $calendarobject_id)
$details = $obj;
} catch (Exception $e) {
info(t("Error") . ": " . $e);
info(L10n::t("Error") . ": " . $e);
goaway('dav/wdcal/');
}
@ -353,14 +354,14 @@ function wdcal_getSettingsPage(&$a)
{
if (!local_user()) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
return '';
}
if (isset($_REQUEST["save"])) {
check_form_security_token_redirectOnErr('/dav/settings/', 'calprop');
PConfig::set($a->user["uid"], "dav", "dateformat", $_REQUEST["wdcal_date_format"]);
info(t('The new values have been saved.'));
info(L10n::t('The new values have been saved.'));
}
if (isset($_REQUEST["save_cals"])) {
@ -379,7 +380,7 @@ function wdcal_getSettingsPage(&$a)
if ($change_sql != "") {
q("UPDATE %s%scalendars SET `ctag` = `ctag` + 1 $change_sql WHERE `id` = %d AND `namespace_id` = %d AND `namespace_id` = %d",
CALDAV_SQL_DB, CALDAV_SQL_PREFIX, $cal["id"], CALDAV_NAMESPACE_PRIVATE, IntVal($a->user["uid"]));
info(t('The calendar has been updated.'));
info(L10n::t('The calendar has been updated.'));
}
}
@ -392,7 +393,7 @@ function wdcal_getSettingsPage(&$a)
CALDAV_SQL_DB, CALDAV_SQL_PREFIX, CALDAV_NAMESPACE_PRIVATE, IntVal($a->user["uid"]), $neworder, dbesc(strtolower(substr($_REQUEST["color"]["new"], 1))),
dbesc($_REQUEST["name"]["new"]), dbesc($a->timezone), dbesc($_REQUEST["uri"]["new"])
);
info(t('The new calendar has been created.'));
info(L10n::t('The new calendar has been created.'));
}
}
@ -416,20 +417,20 @@ function wdcal_getSettingsPage(&$a)
q("DELETE FROM %s%scalendars WHERE `id` = %s", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($_REQUEST["remove_cal"]));
q("UPDATE %s%scalendars SET `ctag` = `ctag` + 1 WHERE `id` = " . CALDAV_SQL_DB, CALDAV_SQL_PREFIX, $newcal[0]["id"]);
info(t('The calendar has been deleted.'));
info(L10n::t('The calendar has been deleted.'));
}
$o = "";
$o .= "<a href='" . $a->get_baseurl() . "/dav/wdcal/'>" . t("Go back to the calendar") . "</a><br><br>";
$o .= "<a href='" . $a->get_baseurl() . "/dav/wdcal/'>" . L10n::t("Go back to the calendar") . "</a><br><br>";
$o .= '<h3>' . t('Calendar Settings') . '</h3>';
$o .= '<h3>' . L10n::t('Calendar Settings') . '</h3>';
$current_format = wdcal_local::getInstanceByUser($a->user["uid"]);
$o .= '<form method="POST" action="' . $a->get_baseurl() . '/dav/settings/">';
$o .= "<input type='hidden' name='form_security_token' value='" . get_form_security_token('calprop') . "'>\n";
$o .= '<label for="wdcal_date_format">' . t('Date format') . ':</label><select name="wdcal_date_format" id="wdcal_date_format" size="1">';
$o .= '<label for="wdcal_date_format">' . L10n::t('Date format') . ':</label><select name="wdcal_date_format" id="wdcal_date_format" size="1">';
$classes = wdcal_local::getInstanceClasses();
foreach ($classes as $c) {
$o .= '<option value="' . $c::getID() . '" ';
@ -438,13 +439,13 @@ function wdcal_getSettingsPage(&$a)
}
$o .= '</select><br>';
$o .= '<label for="wdcal_time_zone">' . t('Time zone') . ':</label><input id="wdcal_time_zone" value="' . $a->timezone . '" disabled><br>';
$o .= '<label for="wdcal_time_zone">' . L10n::t('Time zone') . ':</label><input id="wdcal_time_zone" value="' . $a->timezone . '" disabled><br>';
$o .= '<input type="submit" name="save" value="' . t('Save') . '">';
$o .= '<input type="submit" name="save" value="' . L10n::t('Save') . '">';
$o .= '</form>';
$o .= '<br><br><h3>' . t('Calendars') . '</h3>';
$o .= '<br><br><h3>' . L10n::t('Calendars') . '</h3>';
$o .= '<form method="POST" action="' . $a->get_baseurl() . '/dav/settings/">';
$o .= "<input type='hidden' name='form_security_token' value='" . get_form_security_token('calprop') . "'>\n";
$o .= "<table><tr><th>Type</th><th>Color</th><th>Name</th><th>URI (for CalDAV)</th><th>ICS</th></tr>";
@ -486,8 +487,8 @@ function wdcal_getSettingsPage(&$a)
$o .= "</tr>\n";
$o .= "</table>";
$o .= "<div style='text-align: center;'>[<a href='#' class='calendar_add_caller'>" . t("Create a new calendar") . "</a>]</div>";
$o .= '<input type="submit" name="save_cals" value="' . t('Save') . '">';
$o .= "<div style='text-align: center;'>[<a href='#' class='calendar_add_caller'>" . L10n::t("Create a new calendar") . "</a>]</div>";
$o .= '<input type="submit" name="save_cals" value="' . L10n::t('Save') . '">';
$o .= '</form>';
$baseurl = $a->get_baseurl();
$o .= "<script>\$(function() {
@ -495,22 +496,22 @@ function wdcal_getSettingsPage(&$a)
});</script>";
$o .= "<br><h3>" . t("Limitations") . "</h3>";
$o .= "<br><h3>" . L10n::t("Limitations") . "</h3>";
$o .= "- The native friendica events are embedded as read-only, half-transparent in the calendar.<br>";
$o .= "<br><h3>" . t("Warning") . "</h3>";
$o .= "<br><h3>" . L10n::t("Warning") . "</h3>";
$o .= "This addon still is in a very early stage of development. Expect major bugs!<br>";
$o .= "<br><h3>" . t("Synchronization (iPhone, Thunderbird Lightning, Android, ...)") . "</h3>";
$o .= "<br><h3>" . L10n::t("Synchronization (iPhone, Thunderbird Lightning, Android, ...)") . "</h3>";
$o .= 'This addon enables synchronization of your dates and contacts with CalDAV- and CardDAV-enabled programs or devices.<br>
As an example, the instructions how to set up two-way synchronization with an iPhone/iPodTouch are provided below.<br>
Unfortunately, Android does not have native support for CalDAV or CardDAV, so an app has to be installed.<br>
On desktops, the Lightning-extension to Mozilla Thunderbird should be able to use this addon as a backend.<br><br>';
$o .= '<h4>' . t('Synchronizing this calendar with the iPhone') . '</h4>';
$o .= '<h4>' . L10n::t('Synchronizing this calendar with the iPhone') . '</h4>';
$o .= "<ul>
<li>Go to the settings</li>
@ -521,7 +522,7 @@ function wdcal_getSettingsPage(&$a)
<li><b>Server:</b> " . $a->get_baseurl() . "/dav/ / <b>Username/Password:</b> <em>the same as your friendica-login</em></li>
</ul>";
$o .= '<h4>' . t('Synchronizing your Friendica-Contacts with the iPhone') . '</h4>';
$o .= '<h4>' . L10n::t('Synchronizing your Friendica-Contacts with the iPhone') . '</h4>';
$o .= "<ul>
<li>Go to the settings</li>

View file

@ -1,6 +1,7 @@
<?php
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Module\Login;
use Friendica\Util\Emailer;
@ -203,7 +204,7 @@ function dav_content()
}
}
} catch (DAVVersionMismatchException $e) {
$x = t("The current version of this addon has not been set up correctly. Please contact the system administrator of your installation of friendica to fix this.");
$x = L10n::t("The current version of this addon has not been set up correctly. Please contact the system administrator of your installation of friendica to fix this.");
}
return $x;
}
@ -240,10 +241,10 @@ function dav_event_updated_hook(&$a, &$b)
function dav_profile_tabs_hook(&$a, &$b)
{
$b["tabs"][] = [
"label" => t('Calendar'),
"label" => L10n::t('Calendar'),
"url" => $a->get_baseurl() . "/dav/wdcal/",
"sel" => "",
"title" => t('Extended calendar with CalDAV-support'),
"title" => L10n::t('Extended calendar with CalDAV-support'),
];
}
@ -281,10 +282,10 @@ function dav_cron(&$a, &$b)
$text_html = str_replace($find, $repl, "Hi %to%!<br>\n<br>\nThe event \"%event%\" is about to begin:<br>\n<a href='" . "%url%" . "'>%url%</a>");
$params = [
'fromName' => FRIENDICA_PLATFORM,
'fromEmail' => t('noreply') . '@' . $a->get_hostname(),
'replyTo' => t('noreply') . '@' . $a->get_hostname(),
'fromEmail' => L10n::t('noreply') . '@' . $a->get_hostname(),
'replyTo' => L10n::t('noreply') . '@' . $a->get_hostname(),
'toEmail' => $user["email"],
'messageSubject' => t("Notification: " . $event[0]["Summary"]),
'messageSubject' => L10n::t("Notification: " . $event[0]["Summary"]),
'htmlVersion' => $text_html,
'textVersion' => $text_text,
'additionalMailHeader' => "",
@ -311,15 +312,15 @@ function dav_addon_admin_post(&$a = null, &$o = null)
if (isset($_REQUEST["install"])) {
$errs = dav_create_tables();
if (count($errs) == 0) info(t('The database tables have been installed.') . EOL);
else notice(t("An error occurred during the installation.") . EOL);
if (count($errs) == 0) info(L10n::t('The database tables have been installed.') . EOL);
else notice(L10n::t("An error occurred during the installation.") . EOL);
}
if (isset($_REQUEST["upgrade"])) {
$errs = dav_upgrade_tables();
if (count($errs) == 0) {
renderAllCalDavEntries();
info(t('The database tables have been updated.') . EOL);
} else notice(t("An error occurred during the update.") . EOL);
info(L10n::t('The database tables have been updated.') . EOL);
} else notice(L10n::t("An error occurred during the update.") . EOL);
}
}
@ -335,31 +336,31 @@ function dav_addon_admin(&$a, &$o)
$dbstatus = dav_check_tables();
$o = '<input type="hidden" name="form_security_token" value="' . get_form_security_token("dav_admin_save") . '">';
$o .= '<i>' . t("No system-wide settings yet.") . '</i><br><br>';
$o .= '<i>' . L10n::t("No system-wide settings yet.") . '</i><br><br>';
$o .= '<h3>' . t('Database status') . '</h3>';
$o .= '<h3>' . L10n::t('Database status') . '</h3>';
switch ($dbstatus) {
case 0:
$o .= t('Installed');
$o .= L10n::t('Installed');
break;
case 1:
case 2:
$o .= "<strong>" . t('Upgrade needed') . "</strong><br>" . t("Please back up all calendar data (the tables beginning with dav_*) before proceeding. While all calendar events <i>should</i> be converted to the new database structure, it's always safe to have a backup. Below, you can have a look at the database-queries that will be made when pressing the 'update'-button.") . "<br><br><input type='submit' name='upgrade' value='" . t('Upgrade') . "'>";
$o .= "<strong>" . L10n::t('Upgrade needed') . "</strong><br>" . L10n::t("Please back up all calendar data (the tables beginning with dav_*) before proceeding. While all calendar events <i>should</i> be converted to the new database structure, it's always safe to have a backup. Below, you can have a look at the database-queries that will be made when pressing the 'update'-button.") . "<br><br><input type='submit' name='upgrade' value='" . L10n::t('Upgrade') . "'>";
break;
case -1:
$o .= t('Not installed') . "<br><br><input type='submit' name='install' value='" . t('Install') . "'>";
$o .= L10n::t('Not installed') . "<br><br><input type='submit' name='install' value='" . L10n::t('Install') . "'>";
break;
case -2:
default:
$o .= t('Unknown') . "<br><br>" . t("Something really went wrong. I cannot recover from this state automatically, sorry. Please go to the database backend, back up the data, and delete all tables beginning with 'dav_' manually. Afterwards, this installation routine should be able to reinitialize the tables automatically.");
$o .= L10n::t('Unknown') . "<br><br>" . L10n::t("Something really went wrong. I cannot recover from this state automatically, sorry. Please go to the database backend, back up the data, and delete all tables beginning with 'dav_' manually. Afterwards, this installation routine should be able to reinitialize the tables automatically.");
break;
}
$o .= "<br><br>";
$o .= "<h3>" . t("Troubleshooting") . "</h3>";
$o .= "<h4>" . t("Manual creation of the database tables:") . "</h4>";
$o .= "<a href='#' onClick='\$(\"#sqlstatements\").show(); return false;'>" . t("Show SQL-statements") . "</a><blockquote style='display: none;' id='sqlstatements'><pre>";
$o .= "<h3>" . L10n::t("Troubleshooting") . "</h3>";
$o .= "<h4>" . L10n::t("Manual creation of the database tables:") . "</h4>";
$o .= "<a href='#' onClick='\$(\"#sqlstatements\").show(); return false;'>" . L10n::t("Show SQL-statements") . "</a><blockquote style='display: none;' id='sqlstatements'><pre>";
switch ($dbstatus) {
case 1: case 2:
$tables = dav_get_update_statements($dbstatus);