Skip to content

Commit

Permalink
Make some menus translatable (matomo-org#12885)
Browse files Browse the repository at this point in the history
* Make some menus translatable

* Update changelog
  • Loading branch information
c960657 authored and InfinityVoid committed Oct 11, 2018
1 parent 407cb30 commit 372f3b4
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The Product Changelog at **[matomo.org/changelog](https://matomo.org/changelog)*

* Added new event `API.addGlossaryItems` which lets you add items to the glossary.

### Breaking Changes

* Changed some menu items to use translation keys instead (see [PR #12885](https://github.com/matomo-org/matomo/pull/12885)).

## Matomo 3.5.1

### New APIs
Expand Down
2 changes: 1 addition & 1 deletion core/Plugin/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private function getModule()
*
* Example:
* ```
* $menu->addItem('UI Framework', '', $this->urlForDefaultAction(), $orderId = 30);
* $menu->addItem('MyPlugin_MyPlugin', '', $this->urlForDefaultAction(), $orderId = 30);
* // will add a menu item that leads to the default action of the plugin controller when a user clicks on it.
* // The default action is usually the `index` action - meaning the `index()` method the controller -
* // but the default action can be customized within a controller
Expand Down
1 change: 1 addition & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@
"LoginCredentials": "Credentials",
"LoginToPiwikToChangeSettings": "Login to your Matomo server to create and update websites, users or to change General Settings like \"Report to load by default\".",
"LoginUseHttps": "Use https",
"MatomoMobile": "Matomo Mobile App",
"MultiChartLabel": "Display sparklines",
"NavigationBack": "Back",
"NetworkError": "Network Error",
Expand Down
2 changes: 1 addition & 1 deletion plugins/API/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private function addTopMenuMobileApp(MenuTop $menu)
$url = $this->urlForModuleAction('Proxy', 'redirect', array('url' => 'https://matomo.org/mobile/'));

if ($url) {
$menu->addItem('Piwik Mobile App', null, $url, 4);
$menu->addItem('Mobile_MatomoMobile', null, $url, 4);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions plugins/CoreAdminHome/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"TrackingCodeIntro": "Matomo offers you various ways to embed the tracking code for your website, mobile app, and even for any device or application.",
"TrustedHostConfirm": "Are you sure you want to change the trusted Matomo hostname?",
"TrustedHostSettings": "Trusted Matomo Hostname",
"UiDemo": "UI Demo",
"UpdateSettings": "Update settings",
"UseCustomLogo": "Use a custom logo",
"ValidPiwikHostname": "Valid Matomo Hostname",
Expand Down
2 changes: 1 addition & 1 deletion plugins/CustomVariables/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function configureAdminMenu(MenuAdmin $menu)
$idSite = Common::getRequestVar('idSite', $default, 'int');

if (Piwik::isUserHasAdminAccess($idSite)) {
$menu->addDiagnosticItem('Custom Variables', $this->urlForAction('manage'), $orderId = 20);
$menu->addDiagnosticItem('CustomVariables_CustomVariables', $this->urlForAction('manage'), $orderId = 20);
}
}
}
8 changes: 4 additions & 4 deletions plugins/ExamplePlugin/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ class Menu extends \Piwik\Plugin\Menu

public function configureTopMenu(MenuTop $menu)
{
// $menu->addItem('My Top Item', null, $this->urlForDefaultAction(), $orderId = 30);
// $menu->addItem('ExamplePlugin_MyTopItem', null, $this->urlForDefaultAction(), $orderId = 30);
}

public function configureAdminMenu(MenuAdmin $menu)
{
// reuse an existing category. Execute the showList() method within the controller when menu item was clicked
// $menu->addManageItem('My User Item', $this->urlForAction('showList'), $orderId = 30);
// $menu->addPlatformItem('My User Item', $this->urlForDefaultAction(), $orderId = 30);
// $menu->addManageItem('ExamplePlugin_MyUserItem', $this->urlForAction('showList'), $orderId = 30);
// $menu->addPlatformItem('ExamplePlugin_MyUserItem', $this->urlForDefaultAction(), $orderId = 30);

// or create a custom category
// $menu->addItem('CoreAdminHome_MenuManage', 'My User Item', $this->urlForDefaultAction(), $orderId = 30);
// $menu->addItem('CoreAdminHome_MenuManage', 'ExamplePlugin_MyUserItem', $this->urlForDefaultAction(), $orderId = 30);
}
}
2 changes: 1 addition & 1 deletion plugins/ExampleUI/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ class Menu extends \Piwik\Plugin\Menu
{
public function configureAdminMenu(MenuAdmin $menu)
{
$menu->addPlatformItem('UI Notifications', $this->urlForAction('notifications'), $order = 10);
$menu->addPlatformItem('ExampleUI_UiNotifications', $this->urlForAction('notifications'), $order = 10);
}
}
3 changes: 2 additions & 1 deletion plugins/ExampleUI/lang/en.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"ExampleUI": {
"UiFramework": "UI Framework",
"UiNotifications": "UI Notifications",
"GetTemperaturesDataTable": "Data tables",
"GetTemperaturesEvolution": "Temperatures evolution over time",
"TemperaturesEvolution": "Evolution of server temperatures over the last few days"
}
}
}
2 changes: 1 addition & 1 deletion plugins/Morpheus/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function configureAdminMenu(MenuAdmin $menu)
$menu->registerMenuIcon('MobileAppMeasurable_MobileApps', $manageMeasurablesIcon);

if (Development::isEnabled() && Piwik::isUserHasSomeAdminAccess()) {
$menu->addDevelopmentItem('UI Demo', $this->urlForAction('demo'));
$menu->addDevelopmentItem('CoreAdminHome_UiDemo', $this->urlForAction('demo'));
}
}
}
8 changes: 4 additions & 4 deletions plugins/PrivacyManager/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public function configureAdminMenu(MenuAdmin $menu)
$menu->addItem($category, 'PrivacyManager_AnonymizeData', $this->urlForAction('privacySettings'), 5);
}

$menu->addItem($category, 'Users opt-out', $this->urlForAction('usersOptOut'), 10);
$menu->addItem($category, 'Asking for consent', $this->urlForAction('consent'), 15);
$menu->addItem($category, 'GDPR Overview', $this->urlForAction('gdprOverview'), 20);
$menu->addItem($category, 'GDPR Tools', $this->urlForAction('gdprTools'), 25);
$menu->addItem($category, 'PrivacyManager_UsersOptOut', $this->urlForAction('usersOptOut'), 10);
$menu->addItem($category, 'PrivacyManager_AskingForConsent', $this->urlForAction('consent'), 15);
$menu->addItem($category, 'PrivacyManager_GdprOverview', $this->urlForAction('gdprOverview'), 20);
$menu->addItem($category, 'PrivacyManager_GdprTools', $this->urlForAction('gdprTools'), 25);
}
}
}
6 changes: 5 additions & 1 deletion plugins/PrivacyManager/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"AnonymizeIpExtendedHelp": "When users visit your website, Matomo will not use the full IP address (such as %1$s) but instead Matomo will anonymise it first (to %2$s). IP address anonymisation is one of the requirements set by the privacy laws in some countries such as Germany.",
"AnonymizeIpMaskLengtDescription": "Select how many bytes of the visitors' IPs should be masked.",
"AnonymizeIpMaskLength": "%1$s byte(s) - e.g. %2$s",
"AskingForConsent": "Asking for consent",
"CannotLockSoDeleteLogActions": "The log_action table will not be purged: please grant the LOCK TABLES privilege to the '%s' MySQL user.",
"ClickHereSettings": "Click here to access the %s settings.",
"CurrentDBSize": "Current database size",
Expand Down Expand Up @@ -43,6 +44,8 @@
"GeolocationAnonymizeIpNote": "Note: Geolocation will have approximately the same results with 1 byte anonymized. With 2 bytes or more, Geolocation will be inaccurate.",
"GDPR": "GDPR",
"GdprManager": "GDPR Manager",
"GdprOverview": "GDPR Overview",
"GdprTools": "GDPR Tools",
"GetPurgeEstimate": "Get purge estimate",
"KeepBasicMetrics": "Keep basic metrics (visits, page views, bounce rate, goal conversions, ecommerce conversions, etc.)",
"KeepDataFor": "Keep all data for",
Expand Down Expand Up @@ -73,6 +76,7 @@
"PseudonymizeUserId": "Replace User ID with a pseudonym",
"UseAnonymizeOrderId": "Anonymize Order ID",
"UseDeleteLog": "Regularly delete old visitor logs from the database",
"UseDeleteReports": "Regularly delete old reports from the database"
"UseDeleteReports": "Regularly delete old reports from the database",
"UsersOptOut": "Users opt-out"
}
}

0 comments on commit 372f3b4

Please sign in to comment.