* @license GPL-2.0+ * @link http://stehle-internet.de * @copyright 2013 Martin Stehle */ // check if file is called in an object context // else use non-object context if ( isset($this->plugin_slug ) ) { $text_domain = $this->plugin_slug; } else { $text_domain = self::$plugin_slug; } // get and set locale code for paypal button // source: https://developer.paypal.com/docs/classic/archive/buttons/ // source: http://wpcentral.io/internationalization/ $paypal_locale = get_locale(); // if locale is not in registered locale code try to find the nearest match if ( ! in_array( $paypal_locale, array( 'en_US', 'en_AU', 'es_ES', 'fr_FR', 'de_DE', 'ja_JP', 'it_IT', 'pt_PT', 'pt_BR', 'pl_PL', 'ru_RU', 'sv_SE', 'tr_TR', 'nl_NL', 'zh_CN', 'zh_HK', 'he_IL' ) ) ) { if ( 'ja' == $paypal_locale ) { // japanese language $paypal_locale = 'ja_JP'; } else { $language_codes = explode( '_', $paypal_locale ); // test the language switch ( $language_codes[ 0 ] ) { case 'en': $paypal_locale = 'en_US'; break; case 'nl': $paypal_locale = 'nl_NL'; break; case 'es': $paypal_locale = 'es_ES'; break; case 'de': $paypal_locale = 'de_DE'; break; default: $paypal_locale = 'en_US'; } // switch() } // if ('ja') } // if !in_array() ?>