diff options
author | Stefan Giehl <stefan@matomo.org> | 2022-02-09 05:52:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-09 05:52:45 +0300 |
commit | 01ab2224dc5993a881a65ef21b676490e0050357 (patch) | |
tree | 4b006e1ed80e27d451a5b9ccdf43794288fe58af /plugins | |
parent | b78406dc327eab70b2a58bc56466e607033e0571 (diff) |
Fix translation for unlocated visits in visitor map (#18759)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/UserCountryMap/UserCountryMap.php | 1 | ||||
-rw-r--r-- | plugins/UserCountryMap/javascripts/visitor-map.js | 9 | ||||
-rw-r--r-- | plugins/UserCountryMap/lang/en.json | 2 | ||||
-rw-r--r-- | plugins/UserCountryMap/templates/visitorMap.twig | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/plugins/UserCountryMap/UserCountryMap.php b/plugins/UserCountryMap/UserCountryMap.php index 3946e69bc8..5f06470d26 100644 --- a/plugins/UserCountryMap/UserCountryMap.php +++ b/plugins/UserCountryMap/UserCountryMap.php @@ -61,6 +61,7 @@ class UserCountryMap extends \Piwik\Plugin public function getClientSideTranslationKeys(&$translationKeys) { + $translationKeys[] = 'UserCountryMap_Unlocated'; $translationKeys[] = 'UserCountryMap_WithUnknownRegion'; $translationKeys[] = 'UserCountryMap_WithUnknownCity'; $translationKeys[] = 'General_UserId'; diff --git a/plugins/UserCountryMap/javascripts/visitor-map.js b/plugins/UserCountryMap/javascripts/visitor-map.js index 34ae214925..ffbbc236d7 100644 --- a/plugins/UserCountryMap/javascripts/visitor-map.js +++ b/plugins/UserCountryMap/javascripts/visitor-map.js @@ -705,10 +705,11 @@ } $('.unlocated-stats').html( - $('.unlocated-stats').data('tpl') - .replace('%s', unlocated) - .replace('%p', '(' + formatPercentage(unlocated / total) + ')') - .replace('%c', UserCountryMap.countriesByIso[self.lastSelected].name) + _pk_translate('UserCountryMap_Unlocated', [ + unlocated, + '(' + formatPercentage(unlocated / total) + ')', + UserCountryMap.countriesByIso[self.lastSelected].name + ]) ); $('.UserCountryMap-info-btn').show(); diff --git a/plugins/UserCountryMap/lang/en.json b/plugins/UserCountryMap/lang/en.json index ad7a8253e0..eb0f34091b 100644 --- a/plugins/UserCountryMap/lang/en.json +++ b/plugins/UserCountryMap/lang/en.json @@ -18,7 +18,7 @@ "Searches": "%s searches", "SecondsAgo": "%s seconds ago", "ShowingVisits": "Geo-located visits of last", - "Unlocated": "<b>%1$s</b> %2$p of the visits from %3$c couldn't be geo located.", + "Unlocated": "<b>%1$s</b> %2$s of the visits from %3$s couldn't be geo located.", "VisitorMap": "Visitor Map", "WithUnknownCity": "%s with unknown city", "WithUnknownRegion": "%s with unknown region", diff --git a/plugins/UserCountryMap/templates/visitorMap.twig b/plugins/UserCountryMap/templates/visitorMap.twig index f87a2df356..44eeae5f6f 100644 --- a/plugins/UserCountryMap/templates/visitorMap.twig +++ b/plugins/UserCountryMap/templates/visitorMap.twig @@ -13,7 +13,7 @@ </div> </div> <div class="UserCountryMap-tooltip UserCountryMap-info"> - <div class="content unlocated-stats" data-tpl="{{ 'UserCountryMap_Unlocated'|translate }}"> + <div class="content unlocated-stats"> </div> </div> <div class="UserCountryMap-info-btn" data-tooltip-target=".UserCountryMap-tooltip"></div> |