2014-05-03 22:28:23 +03:00
|
|
|
<?php
|
|
|
|
|
2014-05-05 07:17:23 +03:00
|
|
|
/**
|
|
|
|
* Define a short description for what this class does (no period)
|
|
|
|
*
|
|
|
|
* @package Plugin_Name
|
|
|
|
* @subpackage Plugin_Name/includes
|
|
|
|
* @author Your Name <email@example.com>
|
|
|
|
* @license GPL-2.0+
|
|
|
|
* @link http://example.com
|
|
|
|
* @copyright 2014 Your Name or Company Name
|
|
|
|
* @since 1.0.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define a short description for what this class does.
|
|
|
|
*
|
|
|
|
* Define a longer description for the purpose of this class.
|
|
|
|
*
|
|
|
|
* @package Plugin_Name
|
|
|
|
* @subpackage Plugin_Name/includes
|
|
|
|
* @author Your Name <email@example.com>
|
|
|
|
*/
|
2014-05-09 01:10:22 +03:00
|
|
|
class Plugin_Name_i18n {
|
|
|
|
|
2014-06-26 23:19:57 +03:00
|
|
|
/**
|
|
|
|
* Short description. (use period)
|
|
|
|
*
|
|
|
|
* @since 1.0.0
|
|
|
|
* @access private
|
|
|
|
* @var type $domain Description.
|
|
|
|
*/
|
2014-05-09 01:10:22 +03:00
|
|
|
private $domain;
|
2014-05-05 07:17:23 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Load the plugin text domain for translation.
|
|
|
|
*
|
|
|
|
* @since 1.0.0
|
|
|
|
*/
|
|
|
|
public function load_plugin_textdomain() {
|
|
|
|
|
2014-05-09 01:10:22 +03:00
|
|
|
$locale = apply_filters( 'plugin_locale', get_locale(), $this->domain );
|
|
|
|
|
|
|
|
load_textdomain( $this->domain, trailingslashit( WP_LANG_DIR ) . $this->domain . '/' . $this->domain . '-' . $locale . '.mo' );
|
|
|
|
load_plugin_textdomain( $this->domain, FALSE, basename( plugin_dir_path( dirname( __FILE__ ) ) ) . '/languages/' );
|
2014-05-05 07:17:23 +03:00
|
|
|
|
2014-05-09 01:10:22 +03:00
|
|
|
}
|
2014-05-05 07:17:23 +03:00
|
|
|
|
2014-05-09 06:34:29 +03:00
|
|
|
/**
|
2014-06-26 23:19:57 +03:00
|
|
|
* Short description. (use period)
|
|
|
|
*
|
|
|
|
* Long description.
|
|
|
|
*
|
|
|
|
* @since 1.0.0
|
|
|
|
* @param float $domain TODO
|
2014-05-09 06:34:29 +03:00
|
|
|
*/
|
2014-05-09 01:10:22 +03:00
|
|
|
public function set_domain( $domain ) {
|
|
|
|
$this->domain = $domain;
|
2014-05-05 07:17:23 +03:00
|
|
|
}
|
|
|
|
|
2014-05-09 01:10:22 +03:00
|
|
|
}
|