Skip to content
Snippets Groups Projects
Commit a779c175 authored by johnv's avatar johnv Committed by podarok
Browse files

Issue #1970056 by johnv: Some Drupal languages not supported by Google API v3: Hebrew, Norwegian.

parent 211e0679
No related branches found
No related tags found
No related merge requests found
......@@ -237,18 +237,30 @@ function _gmap_base_js() {
$ret = array();
$path = drupal_get_path('module', 'gmap');
// Convert some language codes.
// For Google Maps API v3, the drupal language code is not always the same as the google language code.
// @see https://developers.google.com/maps/documentation/javascript/basics#Localization
global $language;
switch ($language->language) {
case 'zh-hans':
case 'zh-hans': // 'Chinese, Simplified'
$langcode = 'zh-CN';
break;
case 'zh-hant':
case 'zh-hant': // 'Chinese, Traditional'
$langcode = 'zh-TW';
break;
case 'he': // Hebrew
$langcode = 'iw';
break;
case 'nb': // 'Norwegian Bokml', 'Bokml'
case 'nn': // 'Norwegian Nynorsk', 'Nynorsk'
$langcode = 'no'; // 'Norwegian'
break;
default:
$langcode = $language->language;
break;
}
$query = array(
'v' => variable_get('gmap_api_version', GMAP_API_VERSION),
'language' => $langcode,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment