本文整理汇总了PHP中load_textdomain函数的典型用法代码示例。如果您正苦于以下问题:PHP load_textdomain函数的具体用法?PHP load_textdomain怎么用?PHP load_textdomain使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load_textdomain函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wpcf_embedded_init
/**
* Main init hook.
*/
function wpcf_embedded_init()
{
$locale = get_locale();
load_textdomain('wpcf', WPCF_EMBEDDED_ABSPATH . '/locale/types-' . $locale . '.mo');
if (!defined('WPV_VERSION')) {
load_textdomain('wpv-views', WPCF_EMBEDDED_ABSPATH . '/locale/locale-views/views-' . $locale . '.mo');
}
// Define necessary constants if plugin is not present
if (!defined('WPCF_VERSION')) {
define('WPCF_VERSION', '1.0.4');
define('WPCF_META_PREFIX', 'wpcf-');
define('WPCF_EMBEDDED_RELPATH', icl_get_file_relpath(__FILE__));
} else {
define('WPCF_EMBEDDED_RELPATH', WPCF_RELPATH . '/embedded');
}
define('WPCF_EMBEDDED_INC_RELPATH', WPCF_EMBEDDED_RELPATH . '/includes');
define('WPCF_EMBEDDED_RES_RELPATH', WPCF_EMBEDDED_RELPATH . '/resources');
if (is_admin()) {
require_once WPCF_EMBEDDED_ABSPATH . '/admin.php';
wpcf_embedded_admin_init_hook();
} else {
require_once WPCF_EMBEDDED_ABSPATH . '/frontend.php';
}
wpcf_init_custom_types_taxonomies();
if (defined('DOING_AJAX')) {
require_once WPCF_EMBEDDED_ABSPATH . '/frontend.php';
}
wpcf_embedded_check_import();
}
示例2: Initialize
/**
* Set global variables & check version
*
* @param array $pluginInfo array of plugin information
* @param array $pluginDefaultOptions array of plugin default options
*/
function Initialize($pluginInfo, $pluginDefaultOptions)
{
// Set global variable
$this->g_info = $pluginInfo;
// Check WP version and display warning if not compatible
$this->WarningIfPluginNotCompatible();
// Initialize the base64 icons
$this->IniBase64Icons();
// Plugin default options
$this->g_opt_default = $pluginDefaultOptions;
// Initialize plugin options
$this->IniOrUpdateOptions();
// Language file
// Doesn't work properly prior to WP2.7; Let's make it like in plugin 'Google Sitemap', thanks to Arne Brachhold :-)
global $wp_version;
if (version_compare($wp_version, '2.7', '>=')) {
// >= WordPress 2.7
load_plugin_textdomain($this->g_info['ShortName'], false, trailingslashit(dirname($this->GetPluginBasename())) . 'languages');
} else {
// < WordPress 2.7
$currentLocale = get_locale();
if (!empty($currentLocale)) {
$moFile = dirname($this->g_info['PluginFile']) . '/languages/' . $this->g_info['ShortName'] . '-' . $currentLocale . '.mo';
if (@file_exists($moFile) && is_readable($moFile)) {
load_textdomain($this->g_info['ShortName'], $moFile);
}
}
}
// Register plugin options page
if (method_exists($this, 'PluginOptionsPage')) {
$this->RegisterPluginOptionsPage();
}
}
示例3: load_textdomain
/**
* Load textdomain
*/
function load_textdomain()
{
$domain = 'wp_jwt_auth';
$locale = apply_filters('plugin_locale', get_locale(), $domain);
load_textdomain($domain, WP_LANG_DIR . '/wp-jwt-authentication/' . $domain . '-' . $locale . '.mo');
load_plugin_textdomain($domain, FALSE, dirname(plugin_basename(__FILE__)) . '/languages/');
}
示例4: i18n
/**
* Internationalization setup
*
* @return void
*/
public function i18n()
{
$domain = 'better-blockquotes';
$locale = apply_filters('plugin_locale', get_locale(), $domain);
load_textdomain($domain, WP_LANG_DIR . "/tinymce-email-button/{$domain}-{$locale}.mo");
load_plugin_textdomain($domain, false, dirname(plugin_basename(__FILE__)) . '/languages/');
}
示例5: machouinard_adds_init
/**
* Default initialization for the plugin:
* - Registers the default textdomain.
*/
function machouinard_adds_init()
{
$locale = apply_filters('plugin_locale', get_locale(), 'machouinard_adds');
load_textdomain('machouinard_adds', WP_LANG_DIR . '/machouinard_adds/machouinard_adds-' . $locale . '.mo');
load_plugin_textdomain('machouinard_adds', false, dirname(plugin_basename(__FILE__)) . '/languages/');
// add_action( 'admin_menu', 'machouinard_adds_admin_settings' );
}
示例6: load_plugin_textdomain
public function load_plugin_textdomain()
{
$domain = 'ut_portfolio_lang';
$locale = apply_filters('plugin_locale', get_locale(), $domain);
load_textdomain($domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo');
load_plugin_textdomain($domain, FALSE, dirname(plugin_basename($this->file)) . '/lang/');
}
示例7: plugin_textdomain
public function plugin_textdomain()
{
$domain = 'pixcodes_txtd';
$locale = apply_filters('plugin_locale', get_locale(), $domain);
load_textdomain($domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo');
load_plugin_textdomain($domain, false, dirname(plugin_basename(__FILE__)) . '/lang/');
}
示例8: load_plugin_textdomain
/**
* Load the plugin text domain for translation.
*/
public function load_plugin_textdomain()
{
$domain = 'lrw-so-widgets-bundle';
$locale = apply_filters('plugin_locale', get_locale(), $domain);
load_textdomain($domain, trailingslashit(WP_LANG_DIR) . 'lrw-so-widgets-bundle/lrw-so-widgets-bundle-' . $locale . '.mo');
load_plugin_textdomain('lrw-so-widgets-bundle', false, dirname(plugin_basename(__FILE__)) . '/languages/');
}
示例9: saml_load_translations
function saml_load_translations()
{
$domain = 'onelogin-saml-sso';
$mo_file = plugin_dir_path(dirname(__FILE__)) . 'lang/' . get_locale() . '/' . $domain . '.mo';
load_textdomain($domain, $mo_file);
load_plugin_textdomain($domain, false, dirname(plugin_basename(__FILE__)) . '/lang/' . get_locale() . '/');
}
示例10: load_plugin_textdomain
public function load_plugin_textdomain()
{
$locale = apply_filters('plugin_locale', get_locale(), 'wpdance');
$mofile = WP_PLUGIN_DIR . '/' . plugin_basename(dirname(__FILE__)) . '/lang/' . $this->plugin_domain . '-' . $locale . '.mo';
load_textdomain($this->plugin_domain, $mofile);
load_plugin_textdomain('wpdance', false, plugin_basename(dirname(__FILE__)) . "/lang");
}
示例11: addLanguage
public function addLanguage($data)
{
load_textdomain('bbcode-toolbar', dirname(__FILE__) . '/lang/' . $this->feather->user->language . '/bbeditor.mo');
$lang_bbeditor = array('btnBold' => __('btnBold', 'bbcode-toolbar'), 'btnItalic' => __('btnItalic', 'bbcode-toolbar'), 'btnUnderline' => __('btnUnderline', 'bbcode-toolbar'), 'btnColor' => __('btnColor', 'bbcode-toolbar'), 'btnLeft' => __('btnLeft', 'bbcode-toolbar'), 'btnRight' => __('btnRight', 'bbcode-toolbar'), 'btnJustify' => __('btnJustify', 'bbcode-toolbar'), 'btnCenter' => __('btnCenter', 'bbcode-toolbar'), 'btnLink' => __('btnLink', 'bbcode-toolbar'), 'btnPicture' => __('btnPicture', 'bbcode-toolbar'), 'btnList' => __('btnList', 'bbcode-toolbar'), 'btnQuote' => __('btnQuote', 'bbcode-toolbar'), 'btnCode' => __('btnCode', 'bbcode-toolbar'), 'promptImage' => __('promptImage', 'bbcode-toolbar'), 'promptUrl' => __('promptUrl', 'bbcode-toolbar'), 'promptQuote' => __('promptQuote', 'bbcode-toolbar'));
$data['jsVars']['bbcodeToolbar'] = json_encode($lang_bbeditor);
return $data;
}
示例12: __construct
public function __construct($args = array())
{
// Load our helper function
require_once 'icit-helpers.php';
// notification helper
require_once 'icit-notices.php';
// Makes it easier to set default options on get_option.
require_once 'icit-defaults.php';
if (isset($args['dir'])) {
$this->dir = $args['dir'];
}
if (isset($args['url'])) {
$this->url = $args['url'];
}
// Set the folder for the core
$this->dir === null && ($this->dir = dirname(__FILE__));
// Load the translation stuff..
$locale = get_locale();
if (file_exists($this->dir . '/lang/' . self::DOM . '-' . $locale . '.mo')) {
load_textdomain(self::DOM, $this->dir . '/lang/' . self::DOM . '-' . $locale . '.mo');
}
// add core class autoloaders
spl_autoload_register(array($this, '__autoload'));
//spl_autoload_register( array( $this, '__autoload_psr0' ) );
spl_autoload_register(array($this, '__autoload_wp'));
if (did_action('init') && !(isset($_GET['action']) && $_GET['action'] == 'activate' && isset($_GET['plugin']))) {
_doing_it_wrong('icit_core', __('icit_core should be included at the top of your theme or plug-in file and should load before the init action.', self::DOM), 'icit_core:1.0');
} else {
if (!did_action('plugins_loaded') && !did_action('setup_theme') && $this->is_plugin == null) {
$this->is_plugin = true;
} elseif (did_action('plugins_loaded') && !did_action('setup_theme') && $this->is_plugin === null) {
$this->is_plugin = false;
}
}
}
示例13: dtheme_startup
function dtheme_startup()
{
global $dt_revealData, $krypton_Scripts, $krypton_config;
$dt_revealData = array();
$krypton_Scripts = array();
$theme_name = get_template();
$locale = get_locale();
$localelanguage = get_template_directory() . '/languages';
if (is_child_theme() && !load_textdomain('Krypton', untrailingslashit(get_stylesheet_directory()) . "/{$locale}.mo") || !is_child_theme() && !load_theme_textdomain('Krypton', get_template_directory())) {
$aaa = load_theme_textdomain('Krypton', $localelanguage);
}
// Add post thumbnail supports. http://codex.wordpress.org/Post_Thumbnails
add_theme_support('post-thumbnails');
add_theme_support('automatic-feed-links');
add_theme_support('menus');
add_theme_support('woocommerce');
add_theme_support('title-tag');
register_nav_menus(array('primary' => __('Top Navigation', 'Krypton'), 'footer_navigation' => __('Footer Navigation', 'Krypton')));
// sidebar widget
register_sidebar(array('name' => 'Sidebar', 'id' => 'krypton-sidebar', 'description' => __('Sidebar Widget Area', 'Krypton'), 'before_widget' => '<div class="widget %s %s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'));
register_sidebar(array('name' => 'Bottom Widget', 'id' => 'krypton-bottom', 'description' => __('Bottom Widget Area. Recomended 3 widgets', 'Krypton'), 'before_widget' => '<div class="col-lg-4 col-md-4 col-sm-4 clearfix"><div class="widget %s %s">', 'after_widget' => '</div></div>', 'before_title' => '<div class="row"><div class="section-head"><header class="col col-sm-12 centered"><h2>', 'after_title' => '</h2><hr></header></div></div>'));
register_sidebar(array('name' => 'Contact Page Sidebar', 'id' => 'krypton-contact-sidebar', 'description' => __('Widget area for contact page', 'Krypton'), 'before_widget' => '<div class="widget %s %s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
if (is_plugin_active('woocommerce/woocommerce.php')) {
register_sidebar(array('name' => 'Shop Sidebar', 'id' => 'shop-sidebar', 'description' => __('Sidebar Widget Area', 'Krypton'), 'before_widget' => '<div class="widget %s %s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'));
register_sidebar(array('name' => 'Shop Bottom ', 'id' => 'shop-bottom', 'description' => __('Shop Bottom Widget Area. Displayed at shop pages', 'Krypton'), 'before_widget' => '<div class="col-md-3 col-sm-6"><div class="widget %s %s">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'));
}
add_action('wp_enqueue_scripts', 'dt_enqueue_color_scheme');
add_action('wp_enqueue_scripts', 'dtheme_scripts', 999);
add_action('wp_print_scripts', 'dtheme_register_var', 998);
add_action('wp_print_scripts', 'detheme_print_inline_style');
add_action('wp_footer', 'dtheme_register_mainmenu', 997);
add_action('wp_enqueue_scripts', 'dtheme_css_style', 999);
add_action('wp_footer', create_function('', 'global $krypton_Scripts;if(count($krypton_Scripts)) print "<script type=\\"text/javascript\\">\\n".@implode("\\n",$krypton_Scripts)."\\n</script>\\n";'), 99998);
}
示例14: bjgk_genesis_enews_load_translations
/**
* Load the textdomain / translations for the plugin.
*
* @since 0.1.4
*/
function bjgk_genesis_enews_load_translations()
{
$domain = 'genesis-enews-extended';
$locale = apply_filters('plugin_locale', get_locale(), $domain);
load_textdomain($domain, trailingslashit(WP_LANG_DIR) . $domain . '/' . $domain . '-' . $locale . '.mo');
load_plugin_textdomain($domain, false, basename(dirname(__FILE__)) . '/languages');
}
示例15: __construct
function __construct()
{
// helpers
add_filter('acf/helpers/get_path', array($this, 'helpers_get_path'), 1, 1);
add_filter('acf/helpers/get_dir', array($this, 'helpers_get_dir'), 1, 1);
// vars
$this->settings = array('path' => apply_filters('acf/helpers/get_path', __FILE__), 'dir' => apply_filters('acf/helpers/get_dir', __FILE__), 'hook' => basename(dirname(__FILE__)) . '/' . basename(__FILE__), 'version' => '4.2.2', 'upgrade_version' => '3.4.1');
// set text domain
load_textdomain('acf', $this->settings['path'] . 'lang/acf-' . get_locale() . '.mo');
// actions
add_action('init', array($this, 'init'), 1);
add_action('acf/save_post', array($this, 'save_post'), 10);
add_action('acf/pre_save_post', array($this, 'save_post_lock'), 0);
add_action('acf/pre_save_post', array($this, 'save_post_unlock'), 999);
add_action('acf/save_post', array($this, 'save_post_lock'), 0);
add_action('acf/save_post', array($this, 'save_post_unlock'), 999);
// filters
add_filter('acf/get_info', array($this, 'get_info'), 1, 1);
add_filter('acf/parse_types', array($this, 'parse_types'), 1, 1);
add_filter('acf/get_post_types', array($this, 'get_post_types'), 1, 3);
add_filter('acf/get_taxonomies_for_select', array($this, 'get_taxonomies_for_select'), 1, 2);
add_filter('acf/get_image_sizes', array($this, 'get_image_sizes'), 1, 1);
add_action('acf/create_fields', array($this, 'create_fields'), 1, 2);
add_action('acf/get_post_id', array($this, 'get_post_id'), 1, 1);
// admin only
if (is_admin() && !ACF_LITE) {
add_action('admin_menu', array($this, 'admin_menu'));
add_action('admin_head', array($this, 'admin_head'));
add_filter('post_updated_messages', array($this, 'post_updated_messages'));
}
return true;
}