Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Last active August 29, 2015 14:14
Show Gist options
  • Save hellofromtonya/cd95c06e5a3624b1031e to your computer and use it in GitHub Desktop.
Save hellofromtonya/cd95c06e5a3624b1031e to your computer and use it in GitHub Desktop.
spa_integration_language_form() Debug & Temp Change to get language fr_FR to work
function spa_integration_language_form() {
include_once SF_PLUGIN_DIR.'/admin/library/sp-languages.php';
global $siteLang, $locale;
# Get user language setting
$siteLang = $locale;
//* var_dump($locale); // Result = 'fr_FR'
//* var_dump($siteLang); // Result = 'fr_FR'
if(!empty($siteLang)) {
$siteLang = substr($siteLang, 6);
//* var_dump($siteLang); // Result = false
foreach($langSets as $lKey => $lName) {
if(strpos($siteLang, $lKey) != 0) {
$siteLang = $lKey;
break;
}
}
}
//* ADDED by TONYA 01.23.2015
if ('fr_FR' == $locale) $siteLang = 'fr';
if(empty($siteLang) || $siteLang=='en_US' || $siteLang=='en-US' || $siteLang=='en') {
echo '<br /><div class="sfoptionerror">';
spa_etext('Your site language setting is English/US and therefore no translation files are required for Simple:Press');
echo '</div>';
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment