diff options
author | sgiehl <stefan@piwik.org> | 2015-07-04 22:40:13 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2015-09-25 21:07:47 +0300 |
commit | 417880459ca14234d3fe1e811bf622b12f1ab57b (patch) | |
tree | 41bf9d374c6349591afae4e72b35391be1983b5b | |
parent | 557c1b9bad6c7f7119dba49243eb641a9eb70778 (diff) |
use new date/time formats; use updated internal names
-rw-r--r-- | core/Date.php | 15 | ||||
-rw-r--r-- | core/Period/Day.php | 9 | ||||
-rw-r--r-- | core/Period/Month.php | 4 | ||||
-rw-r--r-- | core/Period/Range.php | 2 | ||||
-rw-r--r-- | core/Period/Year.php | 2 | ||||
-rw-r--r-- | core/Plugin/Visualization.php | 2 | ||||
-rwxr-xr-x | plugins/Annotations/Controller.php | 2 | ||||
-rw-r--r-- | plugins/CoreHome/CoreHome.php | 92 | ||||
-rw-r--r-- | plugins/CoreHome/javascripts/calendar.js | 90 | ||||
-rwxr-xr-x | plugins/CoreHome/javascripts/donate.js | 2 | ||||
-rwxr-xr-x | plugins/CoreHome/templates/_donate.twig | 2 | ||||
-rw-r--r-- | plugins/CorePluginsAdmin/Marketplace.php | 11 | ||||
-rw-r--r-- | plugins/DBStats/Tasks.php | 2 | ||||
-rw-r--r-- | plugins/Live/API.php | 8 | ||||
-rw-r--r-- | plugins/Live/Visitor.php | 2 | ||||
-rw-r--r-- | plugins/Live/VisitorProfile.php | 2 | ||||
-rw-r--r-- | plugins/PrivacyManager/Controller.php | 2 | ||||
-rw-r--r-- | plugins/VisitTime/functions.php | 2 | ||||
-rw-r--r-- | tests/angularjs/bootstrap.js | 2 |
19 files changed, 130 insertions, 123 deletions
diff --git a/core/Date.php b/core/Date.php index 4fac9d8595..44c34ea0ba 100644 --- a/core/Date.php +++ b/core/Date.php @@ -41,6 +41,16 @@ class Date /** The default date time string format. */ const DATE_TIME_FORMAT = 'Y-m-d H:i:s'; + const DATETIME_FORMAT_LONG = 'Intl_Format_DateTime_Long'; + const DATETIME_FORMAT_SHORT = 'Intl_Format_DateTime_Short'; + const DATE_FORMAT_LONG = 'Intl_Format_Date_Long'; + const DATE_FORMAT_DAY_MONTH = 'Intl_Format_Date_Day_Month'; + const DATE_FORMAT_SHORT = 'Intl_Format_Date_Short'; + const DATE_FORMAT_MONTH_SHORT = 'Intl_Format_Month_Short'; + const DATE_FORMAT_MONTH_LONG = 'Intl_Format_Month_Long'; + const DATE_FORMAT_YEAR = 'Intl_Format_Year'; + const TIME_FORMAT = 'Intl_Format_Time'; + /** * Max days for months (non-leap-year). See {@link addPeriod()} implementation. * @@ -612,6 +622,11 @@ class Date { $template = $this->replaceLegacyPlaceholders($template); + if (substr($template, 0, 5) == 'Intl_') { + $translator = StaticContainer::get('Piwik\Translation\Translator'); + $template = $translator->translate($template); + } + $tokens = self::parseFormat($template); $out = ''; diff --git a/core/Period/Day.php b/core/Period/Day.php index 551e5e65aa..4933ddedf6 100644 --- a/core/Period/Day.php +++ b/core/Period/Day.php @@ -9,6 +9,7 @@ namespace Piwik\Period; use Exception; +use Piwik\Date; use Piwik\Period; use Piwik\Piwik; @@ -38,9 +39,7 @@ class Day extends Period { //"Mon 15 Aug" $date = $this->getDateStart(); - $template = $this->translator->translate('CoreHome_ShortDateFormat'); - - $out = $date->getLocalized($template); + $out = $date->getLocalized(Date::DATE_FORMAT_DAY_MONTH); return $out; } @@ -53,9 +52,7 @@ class Day extends Period { //"Mon 15 Aug" $date = $this->getDateStart(); - $template = $this->translator->translate('CoreHome_DateFormat'); - - $out = $date->getLocalized($template); + $out = $date->getLocalized(Date::DATE_FORMAT_LONG); return $out; } diff --git a/core/Period/Month.php b/core/Period/Month.php index 68d97e1d5f..4c779e4853 100644 --- a/core/Period/Month.php +++ b/core/Period/Month.php @@ -25,7 +25,7 @@ class Month extends Period public function getLocalizedShortString() { //"Aug 09" - $out = $this->getDateStart()->getLocalized($this->translator->translate('CoreHome_ShortMonthFormat')); + $out = $this->getDateStart()->getLocalized(Date::DATE_FORMAT_MONTH_SHORT); return $out; } @@ -37,7 +37,7 @@ class Month extends Period public function getLocalizedLongString() { //"August 2009" - $out = $this->getDateStart()->getLocalized($this->translator->translate('CoreHome_LongMonthFormat')); + $out = $this->getDateStart()->getLocalized(Date::DATE_FORMAT_MONTH_LONG); return $out; } diff --git a/core/Period/Range.php b/core/Period/Range.php index 9e14565517..0bac3aad81 100644 --- a/core/Period/Range.php +++ b/core/Period/Range.php @@ -110,7 +110,7 @@ class Range extends Period //"30 Dec 08 - 26 Feb 09" $dateStart = $this->getDateStart(); $dateEnd = $this->getDateEnd(); - $template = $this->translator->translate('CoreHome_ShortDateFormatWithYear'); + $template = Date::DATE_FORMAT_SHORT; $shortDateStart = $dateStart->getLocalized($template); $shortDateEnd = $dateEnd->getLocalized($template); diff --git a/core/Period/Year.php b/core/Period/Year.php index ccd9c2e2b3..cfda052bf5 100644 --- a/core/Period/Year.php +++ b/core/Period/Year.php @@ -35,7 +35,7 @@ class Year extends Period public function getLocalizedLongString() { //"2009" - $out = $this->getDateStart()->getLocalized("%longYear%"); + $out = $this->getDateStart()->getLocalized(Date::DATE_FORMAT_YEAR); return $out; } diff --git a/core/Plugin/Visualization.php b/core/Plugin/Visualization.php index ceccc4ab13..b4ff042932 100644 --- a/core/Plugin/Visualization.php +++ b/core/Plugin/Visualization.php @@ -471,7 +471,7 @@ class Visualization extends ViewDataTable return Piwik::translate('CoreHome_ReportGeneratedXAgo', $timeAgo); } - $prettyDate = $date->getLocalized("%longYear%, %longMonth% %day%") . $date->toString('S'); + $prettyDate = $date->getLocalized(Date::DATE_FORMAT_SHORT); return Piwik::translate('CoreHome_ReportGeneratedOn', $prettyDate); } diff --git a/plugins/Annotations/Controller.php b/plugins/Annotations/Controller.php index 9a777050f1..2572864a80 100755 --- a/plugins/Annotations/Controller.php +++ b/plugins/Annotations/Controller.php @@ -78,7 +78,7 @@ class Controller extends \Piwik\Plugin\Controller $view->selectedDate = $endDate->toString(); } - $dateFormat = Piwik::translate('CoreHome_ShortDateFormatWithYear'); + $dateFormat = Date::DATE_FORMAT_SHORT; $view->startDatePretty = $startDate->getLocalized($dateFormat); $view->endDatePretty = $endDate->getLocalized($dateFormat); diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php index 45a3dde104..23da8326aa 100644 --- a/plugins/CoreHome/CoreHome.php +++ b/plugins/CoreHome/CoreHome.php @@ -171,7 +171,7 @@ class CoreHome extends \Piwik\Plugin $translationKeys[] = 'General_Loading'; $translationKeys[] = 'General_Show'; $translationKeys[] = 'General_Hide'; - $translationKeys[] = 'Intl_YearShort'; + $translationKeys[] = 'Intl_Year_Short'; $translationKeys[] = 'General_MultiSitesSummary'; $translationKeys[] = 'CoreHome_YouAreUsingTheLatestVersion'; $translationKeys[] = 'CoreHome_IncludeRowsWithLowPopulation'; @@ -193,51 +193,51 @@ class CoreHome extends \Piwik\Plugin $translationKeys[] = 'Annotations_HideAnnotationsFor'; $translationKeys[] = 'General_LoadingPopover'; $translationKeys[] = 'General_LoadingPopoverFor'; - $translationKeys[] = 'Intl_ShortMonth_1'; - $translationKeys[] = 'Intl_ShortMonth_2'; - $translationKeys[] = 'Intl_ShortMonth_3'; - $translationKeys[] = 'Intl_ShortMonth_4'; - $translationKeys[] = 'Intl_ShortMonth_5'; - $translationKeys[] = 'Intl_ShortMonth_6'; - $translationKeys[] = 'Intl_ShortMonth_7'; - $translationKeys[] = 'Intl_ShortMonth_8'; - $translationKeys[] = 'Intl_ShortMonth_9'; - $translationKeys[] = 'Intl_ShortMonth_10'; - $translationKeys[] = 'Intl_ShortMonth_11'; - $translationKeys[] = 'Intl_ShortMonth_12'; - $translationKeys[] = 'Intl_LongMonth_1'; - $translationKeys[] = 'Intl_LongMonth_2'; - $translationKeys[] = 'Intl_LongMonth_3'; - $translationKeys[] = 'Intl_LongMonth_4'; - $translationKeys[] = 'Intl_LongMonth_5'; - $translationKeys[] = 'Intl_LongMonth_6'; - $translationKeys[] = 'Intl_LongMonth_7'; - $translationKeys[] = 'Intl_LongMonth_8'; - $translationKeys[] = 'Intl_LongMonth_9'; - $translationKeys[] = 'Intl_LongMonth_10'; - $translationKeys[] = 'Intl_LongMonth_11'; - $translationKeys[] = 'Intl_LongMonth_12'; - $translationKeys[] = 'Intl_ShortDay_1'; - $translationKeys[] = 'Intl_ShortDay_2'; - $translationKeys[] = 'Intl_ShortDay_3'; - $translationKeys[] = 'Intl_ShortDay_4'; - $translationKeys[] = 'Intl_ShortDay_5'; - $translationKeys[] = 'Intl_ShortDay_6'; - $translationKeys[] = 'Intl_ShortDay_7'; - $translationKeys[] = 'Intl_LongDay_1'; - $translationKeys[] = 'Intl_LongDay_2'; - $translationKeys[] = 'Intl_LongDay_3'; - $translationKeys[] = 'Intl_LongDay_4'; - $translationKeys[] = 'Intl_LongDay_5'; - $translationKeys[] = 'Intl_LongDay_6'; - $translationKeys[] = 'Intl_LongDay_7'; - $translationKeys[] = 'Intl_DayMo'; - $translationKeys[] = 'Intl_DayTu'; - $translationKeys[] = 'Intl_DayWe'; - $translationKeys[] = 'Intl_DayTh'; - $translationKeys[] = 'Intl_DayFr'; - $translationKeys[] = 'Intl_DaySa'; - $translationKeys[] = 'Intl_DaySu'; + $translationKeys[] = 'Intl_Month_Short_StandAlone_1'; + $translationKeys[] = 'Intl_Month_Short_StandAlone_2'; + $translationKeys[] = 'Intl_Month_Short_StandAlone_3'; + $translationKeys[] = 'Intl_Month_Short_StandAlone_4'; + $translationKeys[] = 'Intl_Month_Short_StandAlone_5'; + $translationKeys[] = 'Intl_Month_Short_StandAlone_6'; + $translationKeys[] = 'Intl_Month_Short_StandAlone_7'; + $translationKeys[] = 'Intl_Month_Short_StandAlone_8'; + $translationKeys[] = 'Intl_Month_Short_StandAlone_9'; + $translationKeys[] = 'Intl_Month_Short_StandAlone_10'; + $translationKeys[] = 'Intl_Month_Short_StandAlone_11'; + $translationKeys[] = 'Intl_Month_Short_StandAlone_12'; + $translationKeys[] = 'Intl_Month_Long_StandAlone_1'; + $translationKeys[] = 'Intl_Month_Long_StandAlone_2'; + $translationKeys[] = 'Intl_Month_Long_StandAlone_3'; + $translationKeys[] = 'Intl_Month_Long_StandAlone_4'; + $translationKeys[] = 'Intl_Month_Long_StandAlone_5'; + $translationKeys[] = 'Intl_Month_Long_StandAlone_6'; + $translationKeys[] = 'Intl_Month_Long_StandAlone_7'; + $translationKeys[] = 'Intl_Month_Long_StandAlone_8'; + $translationKeys[] = 'Intl_Month_Long_StandAlone_9'; + $translationKeys[] = 'Intl_Month_Long_StandAlone_10'; + $translationKeys[] = 'Intl_Month_Long_StandAlone_11'; + $translationKeys[] = 'Intl_Month_Long_StandAlone_12'; + $translationKeys[] = 'Intl_Day_Short_StandAlone_1'; + $translationKeys[] = 'Intl_Day_Short_StandAlone_2'; + $translationKeys[] = 'Intl_Day_Short_StandAlone_3'; + $translationKeys[] = 'Intl_Day_Short_StandAlone_4'; + $translationKeys[] = 'Intl_Day_Short_StandAlone_5'; + $translationKeys[] = 'Intl_Day_Short_StandAlone_6'; + $translationKeys[] = 'Intl_Day_Short_StandAlone_7'; + $translationKeys[] = 'Intl_Day_Long_StandAlone_1'; + $translationKeys[] = 'Intl_Day_Long_StandAlone_2'; + $translationKeys[] = 'Intl_Day_Long_StandAlone_3'; + $translationKeys[] = 'Intl_Day_Long_StandAlone_4'; + $translationKeys[] = 'Intl_Day_Long_StandAlone_5'; + $translationKeys[] = 'Intl_Day_Long_StandAlone_6'; + $translationKeys[] = 'Intl_Day_Long_StandAlone_7'; + $translationKeys[] = 'Intl_Day_Min_StandAlone_1'; + $translationKeys[] = 'Intl_Day_Min_StandAlone_2'; + $translationKeys[] = 'Intl_Day_Min_StandAlone_3'; + $translationKeys[] = 'Intl_Day_Min_StandAlone_4'; + $translationKeys[] = 'Intl_Day_Min_StandAlone_5'; + $translationKeys[] = 'Intl_Day_Min_StandAlone_6'; + $translationKeys[] = 'Intl_Day_Min_StandAlone_7'; $translationKeys[] = 'General_Search'; $translationKeys[] = 'General_Clear'; $translationKeys[] = 'General_MoreDetails'; diff --git a/plugins/CoreHome/javascripts/calendar.js b/plugins/CoreHome/javascripts/calendar.js index cf70781055..1c308fb74c 100644 --- a/plugins/CoreHome/javascripts/calendar.js +++ b/plugins/CoreHome/javascripts/calendar.js @@ -131,55 +131,55 @@ stepMonths: 1, // jquery-ui-i18n 1.7.2 lacks some translations, so we use our own dayNamesMin: [ - _pk_translate('Intl_DaySu'), - _pk_translate('Intl_DayMo'), - _pk_translate('Intl_DayTu'), - _pk_translate('Intl_DayWe'), - _pk_translate('Intl_DayTh'), - _pk_translate('Intl_DayFr'), - _pk_translate('Intl_DaySa')], + _pk_translate('Intl_Day_Min_StandAlone_7'), + _pk_translate('Intl_Day_Min_StandAlone_1'), + _pk_translate('Intl_Day_Min_StandAlone_2'), + _pk_translate('Intl_Day_Min_StandAlone_3'), + _pk_translate('Intl_Day_Min_StandAlone_4'), + _pk_translate('Intl_Day_Min_StandAlone_5'), + _pk_translate('Intl_Day_Min_StandAlone_6')], dayNamesShort: [ - _pk_translate('Intl_ShortDay_7'), // start with sunday - _pk_translate('Intl_ShortDay_1'), - _pk_translate('Intl_ShortDay_2'), - _pk_translate('Intl_ShortDay_3'), - _pk_translate('Intl_ShortDay_4'), - _pk_translate('Intl_ShortDay_5'), - _pk_translate('Intl_ShortDay_6')], + _pk_translate('Intl_Day_Short_StandAlone_7'), // start with sunday + _pk_translate('Intl_Day_Short_StandAlone_1'), + _pk_translate('Intl_Day_Short_StandAlone_2'), + _pk_translate('Intl_Day_Short_StandAlone_3'), + _pk_translate('Intl_Day_Short_StandAlone_4'), + _pk_translate('Intl_Day_Short_StandAlone_5'), + _pk_translate('Intl_Day_Short_StandAlone_6')], dayNames: [ - _pk_translate('Intl_LongDay_7'), // start with sunday - _pk_translate('Intl_LongDay_1'), - _pk_translate('Intl_LongDay_2'), - _pk_translate('Intl_LongDay_3'), - _pk_translate('Intl_LongDay_4'), - _pk_translate('Intl_LongDay_5'), - _pk_translate('Intl_LongDay_6')], + _pk_translate('Intl_Day_Long_StandAlone_7'), // start with sunday + _pk_translate('Intl_Day_Long_StandAlone_1'), + _pk_translate('Intl_Day_Long_StandAlone_2'), + _pk_translate('Intl_Day_Long_StandAlone_3'), + _pk_translate('Intl_Day_Long_StandAlone_4'), + _pk_translate('Intl_Day_Long_StandAlone_5'), + _pk_translate('Intl_Day_Long_StandAlone_6')], monthNamesShort: [ - _pk_translate('Intl_ShortMonth_1'), - _pk_translate('Intl_ShortMonth_2'), - _pk_translate('Intl_ShortMonth_3'), - _pk_translate('Intl_ShortMonth_4'), - _pk_translate('Intl_ShortMonth_5'), - _pk_translate('Intl_ShortMonth_6'), - _pk_translate('Intl_ShortMonth_7'), - _pk_translate('Intl_ShortMonth_8'), - _pk_translate('Intl_ShortMonth_9'), - _pk_translate('Intl_ShortMonth_10'), - _pk_translate('Intl_ShortMonth_11'), - _pk_translate('Intl_ShortMonth_12')], + _pk_translate('Intl_Month_Short_StandAlone_1'), + _pk_translate('Intl_Month_Short_StandAlone_2'), + _pk_translate('Intl_Month_Short_StandAlone_3'), + _pk_translate('Intl_Month_Short_StandAlone_4'), + _pk_translate('Intl_Month_Short_StandAlone_5'), + _pk_translate('Intl_Month_Short_StandAlone_6'), + _pk_translate('Intl_Month_Short_StandAlone_7'), + _pk_translate('Intl_Month_Short_StandAlone_8'), + _pk_translate('Intl_Month_Short_StandAlone_9'), + _pk_translate('Intl_Month_Short_StandAlone_10'), + _pk_translate('Intl_Month_Short_StandAlone_11'), + _pk_translate('Intl_Month_Short_StandAlone_12')], monthNames: [ - _pk_translate('Intl_LongMonth_1'), - _pk_translate('Intl_LongMonth_2'), - _pk_translate('Intl_LongMonth_3'), - _pk_translate('Intl_LongMonth_4'), - _pk_translate('Intl_LongMonth_5'), - _pk_translate('Intl_LongMonth_6'), - _pk_translate('Intl_LongMonth_7'), - _pk_translate('Intl_LongMonth_8'), - _pk_translate('Intl_LongMonth_9'), - _pk_translate('Intl_LongMonth_10'), - _pk_translate('Intl_LongMonth_11'), - _pk_translate('Intl_LongMonth_12')] + _pk_translate('Intl_Month_Long_StandAlone_1'), + _pk_translate('Intl_Month_Long_StandAlone_2'), + _pk_translate('Intl_Month_Long_StandAlone_3'), + _pk_translate('Intl_Month_Long_StandAlone_4'), + _pk_translate('Intl_Month_Long_StandAlone_5'), + _pk_translate('Intl_Month_Long_StandAlone_6'), + _pk_translate('Intl_Month_Long_StandAlone_7'), + _pk_translate('Intl_Month_Long_StandAlone_8'), + _pk_translate('Intl_Month_Long_StandAlone_9'), + _pk_translate('Intl_Month_Long_StandAlone_10'), + _pk_translate('Intl_Month_Long_StandAlone_11'), + _pk_translate('Intl_Month_Long_StandAlone_12')] }; }; diff --git a/plugins/CoreHome/javascripts/donate.js b/plugins/CoreHome/javascripts/donate.js index a1f78a38f9..e403f18497 100755 --- a/plugins/CoreHome/javascripts/donate.js +++ b/plugins/CoreHome/javascripts/donate.js @@ -24,7 +24,7 @@ // set's the correct amount text & smiley face image based on the position of the slider var setSmileyFaceAndAmount = function (slider, pos) { // set text yearly amount - $('.slider-donate-amount', slider).text('$' + donateAmounts[pos] + '/' + _pk_translate('Intl_YearShort')); + $('.slider-donate-amount', slider).text('$' + donateAmounts[pos] + '/' + _pk_translate('Intl_Year_Short')); // set the right smiley face $('.slider-smiley-face').attr('src', 'plugins/Morpheus/images/smileyprog_' + pos + '.png'); diff --git a/plugins/CoreHome/templates/_donate.twig b/plugins/CoreHome/templates/_donate.twig index 34cd206575..cfee8557b8 100755 --- a/plugins/CoreHome/templates/_donate.twig +++ b/plugins/CoreHome/templates/_donate.twig @@ -24,7 +24,7 @@ <div class="slider-position"></div> </div> <div style="display:inline-block;"> - <div class="slider-donate-amount">$30/{{ 'Intl_YearShort'|translate }}</div> + <div class="slider-donate-amount">$30/{{ 'Intl_Year_Short'|translate }}</div> <img class="slider-smiley-face" width="40" height="40" src="plugins/Morpheus/images/smileyprog_1.png"/> </div> diff --git a/plugins/CorePluginsAdmin/Marketplace.php b/plugins/CorePluginsAdmin/Marketplace.php index b413ddf13b..c4835856b0 100644 --- a/plugins/CorePluginsAdmin/Marketplace.php +++ b/plugins/CorePluginsAdmin/Marketplace.php @@ -141,11 +141,9 @@ class Marketplace private function enrichPluginInformation($plugin) { - $dateFormat = Piwik::translate('CoreHome_ShortDateFormatWithYear'); - $plugin['isInstalled'] = \Piwik\Plugin\Manager::getInstance()->isPluginLoaded($plugin['name']); $plugin['canBeUpdated'] = $plugin['isInstalled'] && $this->hasPluginUpdate($plugin); - $plugin['lastUpdated'] = Date::factory($plugin['lastUpdated'])->getLocalized($dateFormat); + $plugin['lastUpdated'] = Date::factory($plugin['lastUpdated'])->getLocalized(Date::DATE_FORMAT_SHORT); if ($plugin['canBeUpdated']) { $pluginUpdate = $this->getPluginUpdateInformation($plugin); @@ -156,18 +154,15 @@ class Marketplace if (!empty($plugin['activity']['lastCommitDate']) && false === strpos($plugin['activity']['lastCommitDate'], '0000')) { - $dateFormat = Piwik::translate('CoreHome_DateFormat'); - $plugin['activity']['lastCommitDate'] = Date::factory($plugin['activity']['lastCommitDate'])->getLocalized($dateFormat); + $plugin['activity']['lastCommitDate'] = Date::factory($plugin['activity']['lastCommitDate'])->getLocalized(Date::DATE_FORMAT_LONG); } else { $plugin['activity']['lastCommitDate'] = null; } if (!empty($plugin['versions'])) { - $dateFormat = Piwik::translate('CoreHome_DateFormat'); - foreach ($plugin['versions'] as $index => $version) { - $plugin['versions'][$index]['release'] = Date::factory($version['release'])->getLocalized($dateFormat); + $plugin['versions'][$index]['release'] = Date::factory($version['release'])->getLocalized(Date::DATE_FORMAT_LONG); } } diff --git a/plugins/DBStats/Tasks.php b/plugins/DBStats/Tasks.php index 149cca82bb..0d777760e5 100644 --- a/plugins/DBStats/Tasks.php +++ b/plugins/DBStats/Tasks.php @@ -28,7 +28,7 @@ class Tasks extends \Piwik\Plugin\Tasks $api->getIndividualReportsSummary(true); $api->getIndividualMetricsSummary(true); - $now = Date::now()->getLocalized("%longYear%, %shortMonth% %day%"); + $now = Date::now()->getLocalized(Date::DATE_FORMAT_SHORT); Option::set(DBStats::TIME_OF_LAST_TASK_RUN_OPTION, $now); } }
\ No newline at end of file diff --git a/plugins/Live/API.php b/plugins/Live/API.php index 63ef0bbbd2..9d02eac3ee 100644 --- a/plugins/Live/API.php +++ b/plugins/Live/API.php @@ -317,13 +317,13 @@ class API extends \Piwik\Plugin\API $dateTimeVisit = Date::factory($visitorDetailsArray['lastActionTimestamp'], $timezone); if ($dateTimeVisit) { - $visitorDetailsArray['serverTimePretty'] = $dateTimeVisit->getLocalized('%time%'); - $visitorDetailsArray['serverDatePretty'] = $dateTimeVisit->getLocalized(Piwik::translate('CoreHome_DateFormat')); + $visitorDetailsArray['serverTimePretty'] = $dateTimeVisit->getLocalized(Date::TIME_FORMAT); + $visitorDetailsArray['serverDatePretty'] = $dateTimeVisit->getLocalized(Date::DATE_FORMAT_LONG); } $dateTimeVisitFirstAction = Date::factory($visitorDetailsArray['firstActionTimestamp'], $timezone); - $visitorDetailsArray['serverDatePrettyFirstAction'] = $dateTimeVisitFirstAction->getLocalized(Piwik::translate('CoreHome_DateFormat')); - $visitorDetailsArray['serverTimePrettyFirstAction'] = $dateTimeVisitFirstAction->getLocalized('%time%'); + $visitorDetailsArray['serverDatePrettyFirstAction'] = $dateTimeVisitFirstAction->getLocalized(Date::DATE_FORMAT_LONG); + $visitorDetailsArray['serverTimePrettyFirstAction'] = $dateTimeVisitFirstAction->getLocalized(Date::TIME_FORMAT); $visitorDetailsArray['actionDetails'] = array(); if (!$doNotFetchActions) { diff --git a/plugins/Live/Visitor.php b/plugins/Live/Visitor.php index 341ac590c9..a330f3ea3a 100644 --- a/plugins/Live/Visitor.php +++ b/plugins/Live/Visitor.php @@ -426,7 +426,7 @@ class Visitor implements VisitorInterface // Convert datetimes to the site timezone $dateTimeVisit = Date::factory($details['serverTimePretty'], $timezone); - $details['serverTimePretty'] = $dateTimeVisit->getLocalized(Piwik::translate('CoreHome_ShortDateFormat') . ' %time%'); + $details['serverTimePretty'] = $dateTimeVisit->getLocalized(Date::DATETIME_FORMAT_SHORT); $details['timestamp'] = $dateTimeVisit->getTimestamp(); } diff --git a/plugins/Live/VisitorProfile.php b/plugins/Live/VisitorProfile.php index 36ab1bce72..58201a3f9f 100644 --- a/plugins/Live/VisitorProfile.php +++ b/plugins/Live/VisitorProfile.php @@ -97,7 +97,7 @@ class VisitorProfile $serverDate = $visit->getColumn('firstActionTimestamp'); return array( 'date' => $serverDate, - 'prettyDate' => Date::factory($serverDate)->getLocalized(Piwik::translate('CoreHome_DateFormat')), + 'prettyDate' => Date::factory($serverDate)->getLocalized(Date::DATE_FORMAT_LONG), 'daysAgo' => (int)Date::secondsToDays($today->getTimestamp() - Date::factory($serverDate)->getTimestamp()), 'referrerType' => $visit->getColumn('referrerType'), 'referralSummary' => self::getReferrerSummaryForVisit($visit), diff --git a/plugins/PrivacyManager/Controller.php b/plugins/PrivacyManager/Controller.php index 3f34c1829b..c385f84376 100644 --- a/plugins/PrivacyManager/Controller.php +++ b/plugins/PrivacyManager/Controller.php @@ -279,7 +279,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin $deleteDataInfos["nextScheduleTime"] = $nextPossibleSchedule; } else { $deleteDataInfos["lastRun"] = $optionTable; - $deleteDataInfos["lastRunPretty"] = Date::factory((int)$optionTable)->getLocalized('%day% %shortMonth% %longYear%'); + $deleteDataInfos["lastRunPretty"] = Date::factory((int)$optionTable)->getLocalized(Date::DATE_FORMAT_SHORT); //Calculate next run based on last run + interval $nextScheduleRun = (int)($deleteDataInfos["lastRun"] + $deleteDataInfos["config"]["delete_logs_schedule_lowest_interval"] * 24 * 60 * 60); diff --git a/plugins/VisitTime/functions.php b/plugins/VisitTime/functions.php index caba56ecfa..5a9162c6ed 100644 --- a/plugins/VisitTime/functions.php +++ b/plugins/VisitTime/functions.php @@ -36,5 +36,5 @@ function dayOfWeekFromDate($dateStr) */ function translateDayOfWeek($dayOfWeek) { - return Piwik::translate('Intl_LongDay_' . $dayOfWeek); + return Piwik::translate('Intl_Day_Long_StandAlone_' . $dayOfWeek); } diff --git a/tests/angularjs/bootstrap.js b/tests/angularjs/bootstrap.js index 9483f56459..77e0340519 100644 --- a/tests/angularjs/bootstrap.js +++ b/tests/angularjs/bootstrap.js @@ -21,7 +21,7 @@ piwik.hasSuperUserAccess = 1; piwik.config = {}; piwik.config = {"action_url_category_delimiter":"\/","autocomplete_min_sites":"5","datatable_export_range_as_day":"rss"}; -var translations = {"CorePluginsAdmin_NoZipFileSelected":"Please select a ZIP file.","General_InvalidDateRange":"Invalid Date Range, Please Try Again","General_Loading":"Loading...","General_Show":"show","General_Hide":"hide","Intl_YearShort":"yr","General_MultiSitesSummary":"All Websites","CoreHome_YouAreUsingTheLatestVersion":"You are using the latest version of Piwik!","CoreHome_IncludeRowsWithLowPopulation":"Rows with low population are hidden %s Show all rows","CoreHome_ExcludeRowsWithLowPopulation":"All rows are shown %s Exclude low population","CoreHome_DataTableIncludeAggregateRows":"Aggregate rows are hidden %s Show them","CoreHome_DataTableExcludeAggregateRows":"Aggregate rows are shown %s Hide them","CoreHome_Default":"default","CoreHome_PageOf":"%1$s of %2$s","CoreHome_FlattenDataTable":"The report is hierarchical %s Make it flat","CoreHome_UnFlattenDataTable":"The report is flat %s Make it hierarchical","CoreHome_ExternalHelp":"Help (opens in new tab)","SitesManager_NotFound":"No websites found for","Annotations_ViewAndAddAnnotations":"View and add annotations for %s...","General_RowEvolutionRowActionTooltipTitle":"Open Row Evolution","General_RowEvolutionRowActionTooltip":"See how the metrics for this row changed over time","Annotations_IconDesc":"View notes for this date range.","Annotations_IconDescHideNotes":"Hide notes for this date range.","Annotations_HideAnnotationsFor":"Hide annotations for %s...","General_LoadingPopover":"Loading %s...","General_LoadingPopoverFor":"Loading %s for","Intl_ShortMonth_1":"Jan","Intl_ShortMonth_2":"Feb","Intl_ShortMonth_3":"Mar","Intl_ShortMonth_4":"Apr","Intl_ShortMonth_5":"May","Intl_ShortMonth_6":"Jun","Intl_ShortMonth_7":"Jul","Intl_ShortMonth_8":"Aug","Intl_ShortMonth_9":"Sep","Intl_ShortMonth_10":"Oct","Intl_ShortMonth_11":"Nov","Intl_ShortMonth_12":"Dec","Intl_LongMonth_1":"January","Intl_LongMonth_2":"February","Intl_LongMonth_3":"March","Intl_LongMonth_4":"April","Intl_LongMonth_5":"May","Intl_LongMonth_6":"June","Intl_LongMonth_7":"July","Intl_LongMonth_8":"August","Intl_LongMonth_9":"September","Intl_LongMonth_10":"October","Intl_LongMonth_11":"November","Intl_LongMonth_12":"December","Intl_ShortDay_1":"Mon","Intl_ShortDay_2":"Tue","Intl_ShortDay_3":"Wed","Intl_ShortDay_4":"Thu","Intl_ShortDay_5":"Fri","Intl_ShortDay_6":"Sat","Intl_ShortDay_7":"Sun","Intl_LongDay_1":"Monday","Intl_LongDay_2":"Tuesday","Intl_LongDay_3":"Wednesday","Intl_LongDay_4":"Thursday","Intl_LongDay_5":"Friday","Intl_LongDay_6":"Saturday","Intl_LongDay_7":"Sunday","Intl_DayMo":"Mo","Intl_DayTu":"Tu","Intl_DayWe":"We","Intl_DayTh":"Th","Intl_DayFr":"Fr","Intl_DaySa":"Sa","Intl_DaySu":"Su","General_Search":"Search","General_MoreDetails":"More Details","General_Help":"Help","General_MetricsToPlot":"Metrics to plot","General_MetricToPlot":"Metric to plot","General_RecordsToPlot":"Records to plot","General_SaveImageOnYourComputer":"To save the image on your computer, right click on the image and select \"Save Image As...\"","General_ExportAsImage":"Export as Image","General_NoDataForGraph":"No data for this graph.","Widgetize_OpenInNewWindow":"Open in a new window","Dashboard_LoadingWidget":"Loading widget, please wait...","General_TransitionsRowActionTooltipTitle":"Open Transitions","General_TransitionsRowActionTooltip":"See what visitors did before and after viewing this page","Dashboard_AddPreviewedWidget":"Click to add widget to the dashboard","Dashboard_WidgetPreview":"Widget preview","Dashboard_Maximise":"Maximise","Dashboard_Minimise":"Minimise","Dashboard_WidgetNotFound":"Widget not found","Dashboard_DashboardCopied":"Current dashboard successfully copied to selected user.","General_Close":"Close","General_Refresh":"Refresh","General_Website":"Website","General_ColumnNbVisits":"Visits","General_ColumnPageviews":"Pageviews","General_ColumnRevenue":"Revenue","General_TotalVisitsPageviewsRevenue":"(Total: %s visits, %s pageviews, %s revenue)","General_EvolutionSummaryGeneric":"%1$s in %2$s compared to %3$s in %4$s. Evolution: %5$s","General_AllWebsitesDashboard":"All Websites dashboard","General_NVisits":"%s visits","MultiSites_Evolution":"Evolution","SitesManager_AddSite":"Add a new website","General_Next":"Next","General_Previous":"Previous","General_GoTo":"Go to %s","Dashboard_DashboardOf":"Dashboard of %s","Actions_SubmenuSitesearch":"Site Search","MultiSites_LoadingWebsites":"Loading websites","General_ErrorRequest":"Oops\u2026 problem during the request, please try again.","Goals_AddGoal":"Add Goal","Goals_UpdateGoal":"Update Goal","Goals_DeleteGoalConfirm":"Are you sure you want to delete the Goal %s?","UserCountry_FatalErrorDuringDownload":"A fatal error occurred while downloading this file. There might be something wrong with your internet connection, with the GeoIP database you downloaded or Piwik. Try downloading and installing it manually.","UserCountry_SetupAutomaticUpdatesOfGeoIP":"Setup automatic updates of GeoIP databases","General_Done":"Done","Feedback_ThankYou":"Thank you for helping us to make Piwik better!","Feedback_RateFeatureTitle":"Do you like the '%s' feature? Please rate and leave a comment","Feedback_RateFeatureThankYouTitle":"Thank you for rating '%s'!","Feedback_RateFeatureLeaveMessageLike":"We are glad you like it! Please let us know what you like the most or if you have a feature request.","Feedback_RateFeatureLeaveMessageDislike":"We are sorry to hear you don't like it! Please let us know how we can improve.","Feedback_SendFeedback":"Send Feedback","Feedback_RateFeatureSendFeedbackInformation":"Your Piwik platform will send us (the Piwik team) an email (including your email address) so we can get in contact with you if you have any question.","General_Ok":"Ok","General_OrCancel":"or %s Cancel %s","General_Save":"Save","UsersManager_DeleteConfirm":"Are you sure you want to delete the user %s?","UsersManager_ConfirmGrantSuperUserAccess":"Do you really want to grant '%s' Super User access? Warning: the user will have access to all websites and will be able to perform administrative tasks.","UsersManager_ConfirmProhibitOtherUsersSuperUserAccess":"Do you really want to remove Super User access from '%s'? The user will lose all permissions and access to all websites. Make sure to set permissions to needed websites afterwards if necessary.","UsersManager_ConfirmProhibitMySuperUserAccess":"%s, do you really want to remove your own Super User access? You will lose all permissions and access to all websites and will be logged out from Piwik.","SitesManager_OnlyOneSiteAtTime":"You can only edit one website at a time. Please Save or Cancel your current modifications to the website %s.","SitesManager_DeleteConfirm":"Are you sure you want to delete the website %s?","ScheduledReports_ReportSent":"Report sent","ScheduledReports_ReportUpdated":"Report updated","General_OverlayRowActionTooltipTitle":"Open Page Overlay","General_OverlayRowActionTooltip":"See analytics data directly on your website (opens new tab)","CustomAlerts_InvalidMetricValue":"Value must be numeric","Live_VisitorProfile":"Visitor profile","Live_NoMoreVisits":"There are no more visits for this visitor.","Live_ShowMap":"show map","Live_HideMap":"hide map","Live_PageRefreshed":"Number of times this page was viewed \/ refreshed in a row."}; +var translations = {"CorePluginsAdmin_NoZipFileSelected":"Please select a ZIP file.","General_InvalidDateRange":"Invalid Date Range, Please Try Again","General_Loading":"Loading...","General_Show":"show","General_Hide":"hide","Intl_Year_Short":"yr","General_MultiSitesSummary":"All Websites","CoreHome_YouAreUsingTheLatestVersion":"You are using the latest version of Piwik!","CoreHome_IncludeRowsWithLowPopulation":"Rows with low population are hidden %s Show all rows","CoreHome_ExcludeRowsWithLowPopulation":"All rows are shown %s Exclude low population","CoreHome_DataTableIncludeAggregateRows":"Aggregate rows are hidden %s Show them","CoreHome_DataTableExcludeAggregateRows":"Aggregate rows are shown %s Hide them","CoreHome_Default":"default","CoreHome_PageOf":"%1$s of %2$s","CoreHome_FlattenDataTable":"The report is hierarchical %s Make it flat","CoreHome_UnFlattenDataTable":"The report is flat %s Make it hierarchical","CoreHome_ExternalHelp":"Help (opens in new tab)","SitesManager_NotFound":"No websites found for","Annotations_ViewAndAddAnnotations":"View and add annotations for %s...","General_RowEvolutionRowActionTooltipTitle":"Open Row Evolution","General_RowEvolutionRowActionTooltip":"See how the metrics for this row changed over time","Annotations_IconDesc":"View notes for this date range.","Annotations_IconDescHideNotes":"Hide notes for this date range.","Annotations_HideAnnotationsFor":"Hide annotations for %s...","General_LoadingPopover":"Loading %s...","General_LoadingPopoverFor":"Loading %s for","Intl_Month_Short_StandAlone_1":"Jan","Intl_Month_Short_StandAlone_2":"Feb","Intl_Month_Short_StandAlone_3":"Mar","Intl_Month_Short_StandAlone_4":"Apr","Intl_Month_Short_StandAlone_5":"May","Intl_Month_Short_StandAlone_6":"Jun","Intl_Month_Short_StandAlone_7":"Jul","Intl_Month_Short_StandAlone_8":"Aug","Intl_Month_Short_StandAlone_9":"Sep","Intl_Month_Short_StandAlone_10":"Oct","Intl_Month_Short_StandAlone_11":"Nov","Intl_Month_Short_StandAlone_12":"Dec","Intl_Month_Long_StandAlone_1":"January","Intl_Month_Long_StandAlone_2":"February","Intl_Month_Long_StandAlone_3":"March","Intl_Month_Long_StandAlone_4":"April","Intl_Month_Long_StandAlone_5":"May","Intl_Month_Long_StandAlone_6":"June","Intl_Month_Long_StandAlone_7":"July","Intl_Month_Long_StandAlone_8":"August","Intl_Month_Long_StandAlone_9":"September","Intl_Month_Long_StandAlone_10":"October","Intl_Month_Long_StandAlone_11":"November","Intl_Month_Long_StandAlone_12":"December","Intl_Day_Short_StandAlone_1":"Mon","Intl_Day_Short_StandAlone_2":"Tue","Intl_Day_Short_StandAlone_3":"Wed","Intl_Day_Short_StandAlone_4":"Thu","Intl_Day_Short_StandAlone_5":"Fri","Intl_Day_Short_StandAlone_6":"Sat","Intl_Day_Short_StandAlone_7":"Sun","Intl_Day_Long_StandAlone_1":"Monday","Intl_Day_Long_StandAlone_2":"Tuesday","Intl_Day_Long_StandAlone_3":"Wednesday","Intl_Day_Long_StandAlone_4":"Thursday","Intl_Day_Long_StandAlone_5":"Friday","Intl_Day_Long_StandAlone_6":"Saturday","Intl_Day_Long_StandAlone_7":"Sunday","Intl_Day_Min_StandAlone_1":"Mo","Intl_Day_Min_StandAlone_2":"Tu","Intl_Day_Min_StandAlone_3":"We","Intl_Day_Min_StandAlone_4":"Th","Intl_Day_Min_StandAlone_5":"Fr","Intl_Day_Min_StandAlone_6":"Sa","Intl_Day_Min_StandAlone_7":"Su","General_Search":"Search","General_MoreDetails":"More Details","General_Help":"Help","General_MetricsToPlot":"Metrics to plot","General_MetricToPlot":"Metric to plot","General_RecordsToPlot":"Records to plot","General_SaveImageOnYourComputer":"To save the image on your computer, right click on the image and select \"Save Image As...\"","General_ExportAsImage":"Export as Image","General_NoDataForGraph":"No data for this graph.","Widgetize_OpenInNewWindow":"Open in a new window","Dashboard_LoadingWidget":"Loading widget, please wait...","General_TransitionsRowActionTooltipTitle":"Open Transitions","General_TransitionsRowActionTooltip":"See what visitors did before and after viewing this page","Dashboard_AddPreviewedWidget":"Click to add widget to the dashboard","Dashboard_WidgetPreview":"Widget preview","Dashboard_Maximise":"Maximise","Dashboard_Minimise":"Minimise","Dashboard_WidgetNotFound":"Widget not found","Dashboard_DashboardCopied":"Current dashboard successfully copied to selected user.","General_Close":"Close","General_Refresh":"Refresh","General_Website":"Website","General_ColumnNbVisits":"Visits","General_ColumnPageviews":"Pageviews","General_ColumnRevenue":"Revenue","General_TotalVisitsPageviewsRevenue":"(Total: %s visits, %s pageviews, %s revenue)","General_EvolutionSummaryGeneric":"%1$s in %2$s compared to %3$s in %4$s. Evolution: %5$s","General_AllWebsitesDashboard":"All Websites dashboard","General_NVisits":"%s visits","MultiSites_Evolution":"Evolution","SitesManager_AddSite":"Add a new website","General_Next":"Next","General_Previous":"Previous","General_GoTo":"Go to %s","Dashboard_DashboardOf":"Dashboard of %s","Actions_SubmenuSitesearch":"Site Search","MultiSites_LoadingWebsites":"Loading websites","General_ErrorRequest":"Oops\u2026 problem during the request, please try again.","Goals_AddGoal":"Add Goal","Goals_UpdateGoal":"Update Goal","Goals_DeleteGoalConfirm":"Are you sure you want to delete the Goal %s?","UserCountry_FatalErrorDuringDownload":"A fatal error occurred while downloading this file. There might be something wrong with your internet connection, with the GeoIP database you downloaded or Piwik. Try downloading and installing it manually.","UserCountry_SetupAutomaticUpdatesOfGeoIP":"Setup automatic updates of GeoIP databases","General_Done":"Done","Feedback_ThankYou":"Thank you for helping us to make Piwik better!","Feedback_RateFeatureTitle":"Do you like the '%s' feature? Please rate and leave a comment","Feedback_RateFeatureThankYouTitle":"Thank you for rating '%s'!","Feedback_RateFeatureLeaveMessageLike":"We are glad you like it! Please let us know what you like the most or if you have a feature request.","Feedback_RateFeatureLeaveMessageDislike":"We are sorry to hear you don't like it! Please let us know how we can improve.","Feedback_SendFeedback":"Send Feedback","Feedback_RateFeatureSendFeedbackInformation":"Your Piwik platform will send us (the Piwik team) an email (including your email address) so we can get in contact with you if you have any question.","General_Ok":"Ok","General_OrCancel":"or %s Cancel %s","General_Save":"Save","UsersManager_DeleteConfirm":"Are you sure you want to delete the user %s?","UsersManager_ConfirmGrantSuperUserAccess":"Do you really want to grant '%s' Super User access? Warning: the user will have access to all websites and will be able to perform administrative tasks.","UsersManager_ConfirmProhibitOtherUsersSuperUserAccess":"Do you really want to remove Super User access from '%s'? The user will lose all permissions and access to all websites. Make sure to set permissions to needed websites afterwards if necessary.","UsersManager_ConfirmProhibitMySuperUserAccess":"%s, do you really want to remove your own Super User access? You will lose all permissions and access to all websites and will be logged out from Piwik.","SitesManager_OnlyOneSiteAtTime":"You can only edit one website at a time. Please Save or Cancel your current modifications to the website %s.","SitesManager_DeleteConfirm":"Are you sure you want to delete the website %s?","ScheduledReports_ReportSent":"Report sent","ScheduledReports_ReportUpdated":"Report updated","General_OverlayRowActionTooltipTitle":"Open Page Overlay","General_OverlayRowActionTooltip":"See analytics data directly on your website (opens new tab)","CustomAlerts_InvalidMetricValue":"Value must be numeric","Live_VisitorProfile":"Visitor profile","Live_NoMoreVisits":"There are no more visits for this visitor.","Live_ShowMap":"show map","Live_HideMap":"hide map","Live_PageRefreshed":"Number of times this page was viewed \/ refreshed in a row."}; if(typeof(piwik_translations) == 'undefined') { var piwik_translations = new Object; }for(var i in translations) { piwik_translations[i] = translations[i];} var expect = chai.expect |