Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Commit

Permalink
Add support for language packs
Browse files Browse the repository at this point in the history
Add support for language packs
  • Loading branch information
juanfra authored and coreymckrill committed Jan 17, 2017
1 parent bc97c63 commit bf5448f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion camptix.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* Plugin URI: http://wordcamp.org
* Description: Simple and flexible event ticketing for WordPress.
* Version: 1.5.1
* Text Domain: camptix
* Domain Path: /languages/
*
* Author: Automattic
* Author URI: http://wordcamp.org
* License: GPLv2
Expand Down Expand Up @@ -77,7 +80,7 @@ function __construct() {
add_action( 'shutdown', array( $this, 'shutdown' ) );

// Load a text domain
load_plugin_textdomain( 'camptix', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
}

/**
Expand Down Expand Up @@ -184,6 +187,18 @@ function schedule_events() {
wp_schedule_event( time(), 'daily', 'tix_scheduled_daily' );
}

/**
* Load Textdomain
*/
function load_textdomain() {

$locale = apply_filters( 'plugin_locale', get_locale(), 'camptix' );

load_textdomain( 'camptix', WP_LANG_DIR . '/camptix/camptix-' . $locale . '.mo' );
load_plugin_textdomain( 'camptix', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );

}

/**
* Filters cron_schedules
*/
Expand Down

0 comments on commit bf5448f

Please sign in to comment.