function IIRS_0_language_is_supported() { return in_array(IIRS_0_locale(), IIRS_0_available_languages()); }
// JavaScript Widget mode: need to work out where the widget is being hosted and the location / language of that server // the HTTP Referer will contain the domain that the JavaScript is running on // cache the results in the DB // WordPress / Drupal Plugin mode: need to get the location / langauge of this server (where this code is running) // WordPress / Drupal Plugin settings should be used to allow overriding // TIs will register in that country // we have the host domain, but not the public IP // we can lookup the public IP for its location // Note that $_SERVER['REMOTE_ADDR'] contains the public IP of the *users* laptop // their location is not useful to us because it does not indicate the language of the user // use $_SERVER['HTTP_ACCEPT_LANGUAGE'] for information on the user's laptop language preferences //language lists (code from Drupal 8.0) global $lang_list, $lang_code, $available_languages; $lang_list = IIRS_0_getStandardLanguageList(); //FULL list of language codes $available_languages = IIRS_0_available_languages(); //e.g. [en, hu, sp] only translations that are available on this server $lang_code = ''; $lang_code_warning = NULL; //e.g. the specified language is not available $debug_environment .= "availableLanguages: [" . implode(',', $available_languages) . "]\n"; $debug_environment .= "langList count: [" . count($lang_list) . "]\n"; //------- 1) widget forced lang-code if (empty($lang_code)) { $lang_code = IIRS_0_input('lang_code'); //?lang_code=es if (!empty($lang_code)) { if (!in_array($lang_code, $available_languages)) { $lang_code_warning = "the language you requested [{$lang_code}] is not available (1)"; $lang_code = ''; }
<?php } else { ?> This plugin is not in your language: contact <?php print IIRS_EMAIL_TEAM_LINK; ?> and we will work with you to translate. <?php print IIRS_0_framework_name(); ?> framework installed in <strong><?php print IIRS_0_locale(); ?> </strong>. Current available IIRS Plugin languages are <strong>[<?php print implode(', ', IIRS_0_available_languages()); ?> ]</strong>. See below in the <a href="#translation">translation help section</a> for framework help with translation. <?php } } ?> </p> <?php // http://en.wikipedia.org/wiki/Top-level_domain // http://en.wikipedia.org/wiki/Generic_top-level_domain // com, org, net, info // aero, biz, coop, info, museum, name, and pro if (trim(IIRS_0_setting('region_bias')) == FALSE) {