summaryrefslogtreecommitdiff
path: root/includes/classes
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2010-10-17 14:06:21 +0000
committerfisharebest <fisharebest@gmail.com>2010-10-17 14:06:21 +0000
commite03ec73233b4907b83fea0998a2b7dc38e6027d3 (patch)
treea7809c1ab1b82535fd310a21bb56462a7f52ae94 /includes/classes
parent0722097bcba1b9e381584ca16d72f9bf4c793660 (diff)
downloadwebtrees-e03ec73233b4907b83fea0998a2b7dc38e6027d3.tar.gz
webtrees-e03ec73233b4907b83fea0998a2b7dc38e6027d3.tar.bz2
webtrees-e03ec73233b4907b83fea0998a2b7dc38e6027d3.zip
Allow translation of country names into multiple languages
Diffstat (limited to 'includes/classes')
-rw-r--r--includes/classes/class_stats.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/includes/classes/class_stats.php b/includes/classes/class_stats.php
index f810952d96..abcc92bc4b 100644
--- a/includes/classes/class_stats.php
+++ b/includes/classes/class_stats.php
@@ -1049,18 +1049,23 @@ class stats {
}
function chartDistribution($chart_shows='world', $chart_type='', $surname='') {
- global $iso3166, $countries;
- global $WT_STATS_CHART_COLOR1, $WT_STATS_CHART_COLOR2, $WT_STATS_CHART_COLOR3, $WT_STATS_MAP_X, $WT_STATS_MAP_Y;
+ global $iso3166, $WT_STATS_CHART_COLOR1, $WT_STATS_CHART_COLOR2, $WT_STATS_CHART_COLOR3, $WT_STATS_MAP_X, $WT_STATS_MAP_Y;
- if ($this->totalPlaces()==0) return '';
+ if ($this->totalPlaces()==0) {
+ return '';
+ }
- // TODO: add translations from *ALL* languages, not just the current one.
- // TODO (longer term): use a proper geographic database!
+ // Get the country names for each language
$country_to_iso3166=array();
- foreach ($iso3166 as $three=>$two) {
- $country_to_iso3166[$three]=$two;
- $country_to_iso3166[$countries[$three]]=$two;
+ foreach (i18n::installed_languages() as $code=>$lang) {
+ i18n::init($code);
+ $countries=get_all_countries();
+ foreach ($iso3166 as $three=>$two) {
+ $country_to_iso3166[$three]=$two;
+ $country_to_iso3166[$countries[$three]]=$two;
+ }
}
+ i18n::init(WT_LOCALE);
switch ($chart_type) {
case 'surname_distribution_chart':
if ($surname=="") $surname = $this->getCommonSurname();