woocommerce_load_alt_locale

This commit is contained in:
Mike Jolley 2013-05-24 12:47:56 +01:00
parent 948945c7ea
commit 18023b8420
6 changed files with 8 additions and 16 deletions

View File

@ -14,14 +14,6 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce;
$localisation_setting = defined( 'WPLANG' ) && file_exists( $woocommerce->plugin_path() . '/i18n/languages/informal/woocommerce-' . WPLANG . '.mo' ) ? array(
'title' => __( 'Localisation', 'woocommerce' ),
'desc' => sprintf( __( 'Use informal localisation for %s', 'woocommerce' ), WPLANG ),
'id' => 'woocommerce_informal_localisation_type',
'type' => 'checkbox',
'default' => 'no',
) : array();
$currency_code_options = get_woocommerce_currencies();
foreach ( $currency_code_options as $code => $name ) {
@ -78,8 +70,6 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
'type' => 'multi_select_countries'
),
$localisation_setting,
array(
'title' => __( 'Store Notice', 'woocommerce' ),
'desc' => __( 'Enable site-wide store notice text', 'woocommerce' ),

View File

@ -563,18 +563,20 @@ class Woocommerce {
*/
public function load_plugin_textdomain() {
$locale = apply_filters( 'plugin_locale', get_locale(), 'woocommerce' );
$formal = 'yes' == get_option( 'woocommerce_informal_localisation_type' ) ? 'informal' : 'formal';
load_textdomain( 'woocommerce', WP_LANG_DIR . "/woocommerce/woocommerce-$locale.mo" );
// Load admin specific MO files
// Admin Locale
if ( is_admin() ) {
load_textdomain( 'woocommerce', WP_LANG_DIR . "/woocommerce/woocommerce-admin-$locale.mo" );
load_textdomain( 'woocommerce', $this->plugin_path() . "/i18n/languages/woocommerce-admin-$locale.mo" );
}
load_plugin_textdomain( 'woocommerce', false, dirname( plugin_basename( __FILE__ ) ) . "/i18n/languages/$formal" );
load_plugin_textdomain( 'woocommerce', false, dirname( plugin_basename( __FILE__ ) ) . "/i18n/languages" );
// Frontend Locale
load_textdomain( 'woocommerce', WP_LANG_DIR . "/woocommerce/woocommerce-$locale.mo" );
if ( apply_filters( 'woocommerce_load_alt_locale', false ) )
load_plugin_textdomain( 'woocommerce', false, dirname( plugin_basename( __FILE__ ) ) . "/i18n/languages/alt" );
else
load_plugin_textdomain( 'woocommerce', false, dirname( plugin_basename( __FILE__ ) ) . "/i18n/languages" );
}