summaryrefslogtreecommitdiff
path: root/app/Statistics
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-11-03 20:41:02 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-11-03 20:41:02 +0000
commit56eca4e80d712be68f18137a5e9ca739aeac4f73 (patch)
treefa5a6232af60758d16cb0de7e673c59e9a9c4c7f /app/Statistics
parent8e24c0d47c9a13da775b27afad0982c4a5d62d73 (diff)
downloadwebtrees-56eca4e80d712be68f18137a5e9ca739aeac4f73.tar.gz
webtrees-56eca4e80d712be68f18137a5e9ca739aeac4f73.tar.bz2
webtrees-56eca4e80d712be68f18137a5e9ca739aeac4f73.zip
Fix: #2736 - distribution charts always in chinese
Diffstat (limited to 'app/Statistics')
-rw-r--r--app/Statistics/Google/ChartDistribution.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Statistics/Google/ChartDistribution.php b/app/Statistics/Google/ChartDistribution.php
index 33746d92c9..15454d3a22 100644
--- a/app/Statistics/Google/ChartDistribution.php
+++ b/app/Statistics/Google/ChartDistribution.php
@@ -95,20 +95,24 @@ class ChartDistribution
*/
private function getIso3166Countries(): array
{
- $countries = $this->country_service->getAllCountries();
-
// Get the country names for each language
$country_to_iso3166 = [];
+ $current_language = I18N::languageTag();
+
foreach (I18N::activeLocales() as $locale) {
I18N::init($locale->languageTag());
+ $countries = $this->country_service->getAllCountries();
+
foreach ($this->country_service->iso3166() as $three => $two) {
$country_to_iso3166[$three] = $two;
$country_to_iso3166[$countries[$three]] = $two;
}
}
+ I18N::init($current_language);
+
return $country_to_iso3166;
}