From 0bf871e8e85dbc7abed4bcddc701ee248aba4062 Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Sun, 13 Mar 2016 00:16:06 +0100 Subject: [PATCH] better language tooltips --- actions/qvitter.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/actions/qvitter.php b/actions/qvitter.php index 4e7cda0..09d3e01 100644 --- a/actions/qvitter.php +++ b/actions/qvitter.php @@ -397,11 +397,12 @@ class QvitterAction extends ApiAction } // also make an array with all language names, to use for generating menu - $languagecodesandnames[$lancode]['english_name'] = Locale::getDisplayLanguage($lancode, 'en'); - $languagecodesandnames[$lancode]['name'] = Locale::getDisplayLanguage($lancode, $lancode); - if(Locale::getDisplayRegion($lancode, $lancode)) { - $languagecodesandnames[$lancode]['name'] .= ' ('.Locale::getDisplayRegion($lancode, $lancode).')'.$rtl_or_ltr_special_char; - } + $languagecodesandnames[$lancode]['english_name'] = Locale::getDisplayName($lancode, 'en'); + $languagecodesandnames[$lancode]['name'] = Locale::getDisplayName($lancode, $lancode); + $languagecodesandnames[$lancode]['tooltip'] = $languagecodesandnames[$lancode]['name'].' – '.$languagecodesandnames[$lancode]['english_name']; + if($languagecodesandnames[$lancode]['name'] == $languagecodesandnames[$lancode]['english_name']) { + $languagecodesandnames[$lancode]['tooltip'] = $languagecodesandnames[$lancode]['english_name']; + } // ahorita meme only on quitter.es if($lancode == 'es_ahorita') { @@ -496,7 +497,7 @@ class QvitterAction extends ApiAction // languages foreach($languagecodesandnames as $lancode=>$lan) { - print '
  • '.$lan['name'].'
  • '; + print '
  • '.$lan['name'].'
  • '; } ?> @@ -530,7 +531,7 @@ class QvitterAction extends ApiAction // languages foreach($languagecodesandnames as $lancode=>$lan) { - print '
  • '.$lan['name'].'
  • '; + print '
  • '.$lan['name'].'
  • '; } ?>