diff options
author | sgiehl <stefan@piwik.org> | 2013-09-14 02:38:28 +0400 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2013-09-14 02:39:09 +0400 |
commit | e0fd925e0d39fcf17c1e52b36c55812af7881297 (patch) | |
tree | f3dd2366aa048c1421eebd4bc601661d40cd36ef /plugins | |
parent | c7b7707222492f18b1ae2de72d2e856be2753271 (diff) |
refs #4151 refactored some usages of _js hack
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/Annotations/Annotations.php | 4 | ||||
-rwxr-xr-x | plugins/Annotations/templates/getAnnotationManager.twig | 2 | ||||
-rw-r--r-- | plugins/CoreHome/CoreHome.php | 13 | ||||
-rw-r--r-- | plugins/CoreHome/javascripts/calendar.js | 2 | ||||
-rw-r--r-- | plugins/CoreHome/javascripts/dataTable.js | 2 | ||||
-rw-r--r-- | plugins/CoreHome/templates/_dataTableFooter.twig | 2 | ||||
-rw-r--r-- | plugins/CoreHome/templates/_periodSelect.twig | 4 | ||||
-rw-r--r-- | plugins/CoreVisualizations/CoreVisualizations.php | 17 | ||||
-rw-r--r-- | plugins/CoreVisualizations/javascripts/jqplot.js | 12 | ||||
-rw-r--r-- | plugins/CoreVisualizations/javascripts/seriesPicker.js | 6 | ||||
-rw-r--r-- | plugins/Feedback/Feedback.php | 12 | ||||
-rw-r--r-- | plugins/Feedback/javascripts/feedback.js | 2 | ||||
-rw-r--r-- | plugins/ImageGraph/API.php | 4 | ||||
-rw-r--r-- | plugins/MobileMessaging/Controller.php | 2 | ||||
-rw-r--r-- | plugins/Overlay/Overlay.php | 2 | ||||
-rw-r--r-- | plugins/Overlay/templates/index.twig | 2 | ||||
-rw-r--r-- | plugins/UserCountry/UserCountry.php | 2 | ||||
-rwxr-xr-x | plugins/UserCountry/templates/adminIndex.twig | 2 | ||||
-rw-r--r-- | plugins/Widgetize/javascripts/widgetize.js | 2 |
19 files changed, 59 insertions, 35 deletions
diff --git a/plugins/Annotations/Annotations.php b/plugins/Annotations/Annotations.php index 92609ecf16..fc60db2b91 100755 --- a/plugins/Annotations/Annotations.php +++ b/plugins/Annotations/Annotations.php @@ -24,8 +24,8 @@ class Annotations extends \Piwik\Plugin public function getListHooksRegistered() { return array( - 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', - 'AssetManager.getJsFiles' => 'getJsFiles' + 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', + 'AssetManager.getJsFiles' => 'getJsFiles', ); } diff --git a/plugins/Annotations/templates/getAnnotationManager.twig b/plugins/Annotations/templates/getAnnotationManager.twig index 41da86fa90..0cb594426e 100755 --- a/plugins/Annotations/templates/getAnnotationManager.twig +++ b/plugins/Annotations/templates/getAnnotationManager.twig @@ -12,7 +12,7 @@ <div class="annotation-list"> {% include "@Annotations/_annotationList.twig" %} - <span class="loadingPiwik" style="display:none;"><img src="plugins/Zeitgeist/images/loading-blue.gif"/>{{ 'General_Loading_js'|translate }}</span> + <span class="loadingPiwik" style="display:none;"><img src="plugins/Zeitgeist/images/loading-blue.gif"/>{{ 'General_Loading'|translate }}</span> </div> diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php index 5ed00a718a..13591bd21a 100644 --- a/plugins/CoreHome/CoreHome.php +++ b/plugins/CoreHome/CoreHome.php @@ -24,9 +24,10 @@ class CoreHome extends \Piwik\Plugin public function getListHooksRegistered() { return array( - 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', - 'AssetManager.getJsFiles' => 'getJsFiles', - 'WidgetsList.add' => 'addWidgets', + 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', + 'AssetManager.getJsFiles' => 'getJsFiles', + 'WidgetsList.add' => 'addWidgets', + 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys' ); } @@ -89,4 +90,10 @@ class CoreHome extends \Piwik\Plugin $jsFiles[] = "plugins/CoreHome/javascripts/promo.js"; $jsFiles[] = "plugins/CoreHome/javascripts/color_manager.js"; } + + public function getClientSideTranslationKeys(&$translationKeys) + { + $translationKeys[] = 'General_InvalidDateRange'; + $translationKeys[] = 'General_Loading'; + } }
\ No newline at end of file diff --git a/plugins/CoreHome/javascripts/calendar.js b/plugins/CoreHome/javascripts/calendar.js index e0580b1be0..db24108573 100644 --- a/plugins/CoreHome/javascripts/calendar.js +++ b/plugins/CoreHome/javascripts/calendar.js @@ -500,7 +500,7 @@ if (!isValidDate(oDateFrom) || !isValidDate(oDateTo) || oDateFrom > oDateTo) { - $('#alert').find('h2').text(_pk_translate('General_InvalidDateRange_js')); + $('#alert').find('h2').text(_pk_translate('General_InvalidDateRange')); piwikHelper.modalConfirm('#alert', {}); return false; } diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js index 2ee0ca797d..bdbaccb8e2 100644 --- a/plugins/CoreHome/javascripts/dataTable.js +++ b/plugins/CoreHome/javascripts/dataTable.js @@ -1144,7 +1144,7 @@ dataTable.prototype = '<tr>' + '<td colspan="' + numberOfColumns + '" class="cellSubDataTable">' + '<div id="' + divIdToReplaceWithSubTable + '">' + - '<span class="loadingPiwik" style="display:inline"><img src="plugins/Zeitgeist/images/loading-blue.gif" />' + _pk_translate('General_Loading_js') + '</span>' + + '<span class="loadingPiwik" style="display:inline"><img src="plugins/Zeitgeist/images/loading-blue.gif" />' + _pk_translate('General_Loading') + '</span>' + '</div>' + '</td>' + '</tr>' diff --git a/plugins/CoreHome/templates/_dataTableFooter.twig b/plugins/CoreHome/templates/_dataTableFooter.twig index 1655c5d18e..3fb4f0f3ce 100644 --- a/plugins/CoreHome/templates/_dataTableFooter.twig +++ b/plugins/CoreHome/templates/_dataTableFooter.twig @@ -69,7 +69,7 @@ {% if properties.show_export_as_image_icon %} <span id="dataTableFooterExportAsImageIcon"> <a class="tableIcon" href="#" onclick="$(this).closest('.dataTable').find('div.jqplot-target').trigger('piwikExportAsImage'); return false;"> - <img title="{{ 'General_ExportAsImage_js'|translate }}" src="plugins/Zeitgeist/images/image.png"/> + <img title="{{ 'General_ExportAsImage'|translate }}" src="plugins/Zeitgeist/images/image.png"/> </a> </span> {% endif %} diff --git a/plugins/CoreHome/templates/_periodSelect.twig b/plugins/CoreHome/templates/_periodSelect.twig index 3df678d645..bc3cb4a7ff 100644 --- a/plugins/CoreHome/templates/_periodSelect.twig +++ b/plugins/CoreHome/templates/_periodSelect.twig @@ -9,12 +9,12 @@ </div> <div class="period-range" style="display:none;"> <div id="calendarRangeFrom"> - <h6>{{ 'General_DateRangeFrom_js'|translate }}<input tabindex="1" type="text" id="inputCalendarFrom" name="inputCalendarFrom"/></h6> + <h6>{{ 'General_DateRangeFrom'|translate }}<input tabindex="1" type="text" id="inputCalendarFrom" name="inputCalendarFrom"/></h6> <div id="calendarFrom"></div> </div> <div id="calendarRangeTo"> - <h6>{{ 'General_DateRangeTo_js'|translate }}<input tabindex="2" type="text" id="inputCalendarTo" name="inputCalendarTo"/></h6> + <h6>{{ 'General_DateRangeTo'|translate }}<input tabindex="2" type="text" id="inputCalendarTo" name="inputCalendarTo"/></h6> <div id="calendarTo"></div> </div> diff --git a/plugins/CoreVisualizations/CoreVisualizations.php b/plugins/CoreVisualizations/CoreVisualizations.php index 535f3b284e..206eaa9e47 100644 --- a/plugins/CoreVisualizations/CoreVisualizations.php +++ b/plugins/CoreVisualizations/CoreVisualizations.php @@ -28,9 +28,10 @@ class CoreVisualizations extends \Piwik\Plugin public function getListHooksRegistered() { return array( - 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', - 'AssetManager.getJsFiles' => 'getJsFiles', - 'DataTableVisualization.getAvailable' => 'getAvailableDataTableVisualizations', + 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', + 'AssetManager.getJsFiles' => 'getJsFiles', + 'DataTableVisualization.getAvailable' => 'getAvailableDataTableVisualizations', + 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys' ); } @@ -59,4 +60,14 @@ class CoreVisualizations extends \Piwik\Plugin $jsFiles[] = "plugins/CoreVisualizations/javascripts/jqplotPieGraph.js"; $jsFiles[] = "plugins/CoreVisualizations/javascripts/jqplotEvolutionGraph.js"; } + + public function getClientSideTranslationKeys(&$translationKeys) + { + $translationKeys[] = 'General_MetricsToPlot'; + $translationKeys[] = 'General_MetricToPlot'; + $translationKeys[] = 'General_RecordsToPlot'; + $translationKeys[] = 'General_SaveImageOnYourComputer'; + $translationKeys[] = 'General_ExportAsImage'; + $translationKeys[] = 'General_NoDataForGraph'; + } }
\ No newline at end of file diff --git a/plugins/CoreVisualizations/javascripts/jqplot.js b/plugins/CoreVisualizations/javascripts/jqplot.js index 6445781c85..61a0399bc9 100644 --- a/plugins/CoreVisualizations/javascripts/jqplot.js +++ b/plugins/CoreVisualizations/javascripts/jqplot.js @@ -43,12 +43,12 @@ } this._lang = { - noData: _pk_translate('General_NoDataForGraph_js'), - exportTitle: _pk_translate('General_ExportAsImage_js'), - exportText: _pk_translate('General_SaveImageOnYourComputer_js'), - metricsToPlot: _pk_translate('General_MetricsToPlot_js'), - metricToPlot: _pk_translate('General_MetricToPlot_js'), - recordsToPlot: _pk_translate('General_RecordsToPlot_js') + noData: _pk_translate('General_NoDataForGraph'), + exportTitle: _pk_translate('General_ExportAsImage'), + exportText: _pk_translate('General_SaveImageOnYourComputer'), + metricsToPlot: _pk_translate('General_MetricsToPlot'), + metricToPlot: _pk_translate('General_MetricToPlot'), + recordsToPlot: _pk_translate('General_RecordsToPlot') }; // set a unique ID for the graph element (required by jqPlot) diff --git a/plugins/CoreVisualizations/javascripts/seriesPicker.js b/plugins/CoreVisualizations/javascripts/seriesPicker.js index 8c31d986d3..bfefed2263 100644 --- a/plugins/CoreVisualizations/javascripts/seriesPicker.js +++ b/plugins/CoreVisualizations/javascripts/seriesPicker.js @@ -58,9 +58,9 @@ // language strings this.lang = { - metricsToPlot: _pk_translate('General_MetricsToPlot_js'), - metricToPlot: _pk_translate('General_MetricToPlot_js'), - recordsToPlot: _pk_translate('General_RecordsToPlot_js') + metricsToPlot: _pk_translate('General_MetricsToPlot'), + metricToPlot: _pk_translate('General_MetricToPlot'), + recordsToPlot: _pk_translate('General_RecordsToPlot') }; this._pickerState = null; diff --git a/plugins/Feedback/Feedback.php b/plugins/Feedback/Feedback.php index b8c0d6ff52..6a79409c47 100644 --- a/plugins/Feedback/Feedback.php +++ b/plugins/Feedback/Feedback.php @@ -24,9 +24,10 @@ class Feedback extends \Piwik\Plugin public function getListHooksRegistered() { return array( - 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', - 'AssetManager.getJsFiles' => 'getJsFiles', - 'TopMenu.add' => 'addTopMenu', + 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', + 'AssetManager.getJsFiles' => 'getJsFiles', + 'TopMenu.add' => 'addTopMenu', + 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys' ); } @@ -51,4 +52,9 @@ class Feedback extends \Piwik\Plugin { $jsFiles[] = "plugins/Feedback/javascripts/feedback.js"; } + + public function getClientSideTranslationKeys(&$translationKeys) + { + $translationKeys[] = 'General_Loading'; + } } diff --git a/plugins/Feedback/javascripts/feedback.js b/plugins/Feedback/javascripts/feedback.js index f99464c5bd..bd96332578 100644 --- a/plugins/Feedback/javascripts/feedback.js +++ b/plugins/Feedback/javascripts/feedback.js @@ -12,7 +12,7 @@ $(function () { feedback.click(function () { if (fbDiv.html() == '') { - fbDiv.html('<div id="feedback-loading"><img alt="" src="plugins/Zeitgeist/images/loading-blue.gif"> ' + _pk_translate('General_Loading_js') + '</div>'); + fbDiv.html('<div id="feedback-loading"><img alt="" src="plugins/Zeitgeist/images/loading-blue.gif"> ' + _pk_translate('General_Loading') + '</div>'); } if ($('#feedback-loading', fbDiv).length) { $.get(feedback.attr('href'), function (data) { diff --git a/plugins/ImageGraph/API.php b/plugins/ImageGraph/API.php index ea4b88b392..6266bf9ed2 100644 --- a/plugins/ImageGraph/API.php +++ b/plugins/ImageGraph/API.php @@ -318,7 +318,7 @@ class API //@review this test will need to be updated after evaluating the @review comment in API/API.php if (!$processedReport) { - throw new Exception(Piwik_Translate('General_NoDataForGraph_js')); + throw new Exception(Piwik_Translate('General_NoDataForGraph')); } // restoring generic filter parameters @@ -456,7 +456,7 @@ class API } if (!$hasData || !$hasNonZeroValue) { - throw new Exception(Piwik_Translate('General_NoDataForGraph_js')); + throw new Exception(Piwik_Translate('General_NoDataForGraph')); } //Setup the graph diff --git a/plugins/MobileMessaging/Controller.php b/plugins/MobileMessaging/Controller.php index 517efb72f9..537a0fa3bc 100644 --- a/plugins/MobileMessaging/Controller.php +++ b/plugins/MobileMessaging/Controller.php @@ -47,7 +47,7 @@ class Controller extends \Piwik\Controller\Admin $view->delegatedManagement = $mobileMessagingAPI->getDelegatedManagement(); $view->credentialSupplied = $mobileMessagingAPI->areSMSAPICredentialProvided(); $view->accountManagedByCurrentUser = $view->isSuperUser || $view->delegatedManagement; - $view->strHelpAddPhone = Piwik_Translate('MobileMessaging_Settings_PhoneNumbers_HelpAdd', array(Piwik_Translate('General_SubmenuSettings'), Piwik_Translate('MobileMessaging_SettingsMenu'))); + $view->strHelpAddPhone = Piwik_Translate('MobileMessaging_Settings_PhoneNumbers_HelpAdd', array(Piwik_Translate('General_Settings'), Piwik_Translate('MobileMessaging_SettingsMenu'))); if ($view->credentialSupplied && $view->accountManagedByCurrentUser) { $view->provider = $mobileMessagingAPI->getSMSProvider(); $view->creditLeft = $mobileMessagingAPI->getCreditLeft(); diff --git a/plugins/Overlay/Overlay.php b/plugins/Overlay/Overlay.php index b0ba9a2c7b..6800faf262 100644 --- a/plugins/Overlay/Overlay.php +++ b/plugins/Overlay/Overlay.php @@ -28,7 +28,7 @@ class Overlay extends \Piwik\Plugin function getListHooksRegistered() { return array( - 'AssetManager.getJsFiles' => 'getJsFiles' + 'AssetManager.getJsFiles' => 'getJsFiles', ); } diff --git a/plugins/Overlay/templates/index.twig b/plugins/Overlay/templates/index.twig index edd2931954..9697f90024 100644 --- a/plugins/Overlay/templates/index.twig +++ b/plugins/Overlay/templates/index.twig @@ -44,7 +44,7 @@ <div id="Overlay_Location"> </div> - <div id="Overlay_Loading">{{ 'General_Loading_js'|translate }}</div> + <div id="Overlay_Loading">{{ 'General_Loading'|translate }}</div> <div id="Overlay_Sidebar"></div> diff --git a/plugins/UserCountry/UserCountry.php b/plugins/UserCountry/UserCountry.php index 1f9f31e062..a6a850542c 100644 --- a/plugins/UserCountry/UserCountry.php +++ b/plugins/UserCountry/UserCountry.php @@ -46,7 +46,7 @@ class UserCountry extends \Piwik\Plugin 'Goals.getReportsWithGoalMetrics' => 'getReportsWithGoalMetrics', 'API.getReportMetadata' => 'getReportMetadata', 'API.getSegmentsMetadata' => 'getSegmentsMetadata', - 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', + 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', 'AssetManager.getJsFiles' => 'getJsFiles', 'Tracker.getVisitorLocation' => 'getVisitorLocation', 'TaskScheduler.getScheduledTasks' => 'getScheduledTasks', diff --git a/plugins/UserCountry/templates/adminIndex.twig b/plugins/UserCountry/templates/adminIndex.twig index 5e872592f1..fd9d0cbe35 100755 --- a/plugins/UserCountry/templates/adminIndex.twig +++ b/plugins/UserCountry/templates/adminIndex.twig @@ -64,7 +64,7 @@ <div style="text-align:left;"> <br/> <span class="loadingPiwik" style="display:none;position:absolute;"> - <img src="./plugins/Zeitgeist/images/loading-blue.gif"/> {{ 'General_Loading_js'|translate }}</span> + <img src="./plugins/Zeitgeist/images/loading-blue.gif"/> {{ 'General_Loading'|translate }}</span> <span class="location"><strong><em>{{ provider.location }}</em></strong></span> </div> <div style="text-align:right;"> diff --git a/plugins/Widgetize/javascripts/widgetize.js b/plugins/Widgetize/javascripts/widgetize.js index a630380e5f..215e67c5a9 100644 --- a/plugins/Widgetize/javascripts/widgetize.js +++ b/plugins/Widgetize/javascripts/widgetize.js @@ -64,7 +64,7 @@ function widgetize() { '</span>' + '</div>' + '<div> <label for="embedThisWidgetDirectLink">› Direct Link</label>' + - '<span id="embedThisWidgetDirectLink"> ' + self.getInputFormWithHtml('directLinkEmbed', urlIframe) + ' - <a href="' + urlIframe + '" target="_blank">' + _pk_translate('General_OpenInNewWindow_js') + '</a></span>' + '<span id="embedThisWidgetDirectLink"> ' + self.getInputFormWithHtml('directLinkEmbed', urlIframe) + ' - <a href="' + urlIframe + '" target="_blank">' + _pk_translate('Widgetize_OpenInNewWindow') + '</a></span>' + '</div>' ); |