本文整理汇总了PHP中load_textdomain函数的典型用法代码示例。如果您正苦于以下问题:PHP load_textdomain函数的具体用法?PHP load_textdomain怎么用?PHP load_textdomain使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load_textdomain函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:par-orillonsoft,项目名称:Wishmagnet,代码行数:32,代码来源:types.php
示例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();
}
}
开发者ID:nvvetal,项目名称:water,代码行数:39,代码来源:inc.swg-plugin-framework.php
示例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/');
}
开发者ID:YanikPei,项目名称:wp-jwt-authentication,代码行数:10,代码来源:wp-authentication-kit.php
示例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/');
}
开发者ID:andershal,项目名称:better-blockquotes,代码行数:12,代码来源:better-blockquotes.php
示例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' );
}
开发者ID:umairakhtar123,项目名称:hova,代码行数:11,代码来源:aviation-weather-from-noaa.php
示例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/');
}
开发者ID:amptdesign,项目名称:ampt-2016,代码行数:7,代码来源:class-ut-portfolio-template.php
示例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/');
}
开发者ID:qhuit,项目名称:Tournesol,代码行数:7,代码来源:pixcodes.php
示例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/');
}
开发者ID:luizrw,项目名称:lrw-so-widgets-bundle,代码行数:10,代码来源:lrw-so-widgets-bundle.php
示例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() . '/');
}
开发者ID:Craxic,项目名称:onelogin-saml-sso,代码行数:7,代码来源:functions.php
示例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");
}
开发者ID:proj-2014,项目名称:vlan247-test-wp2,代码行数:7,代码来源:wd_shortcode.php
示例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;
}
开发者ID:beaver-dev,项目名称:plugins,代码行数:7,代码来源:BbcodeToolbar.php
示例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;
}
}
}
开发者ID:datalynk,项目名称:quizzlestick,代码行数:35,代码来源:core.php
示例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);
}
开发者ID:estrategasdigitales,项目名称:Dagutorio,代码行数:34,代码来源:functions.php
示例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');
}
开发者ID:jonpetersen,项目名称:PHTC,代码行数:12,代码来源:plugin.php
示例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;
}
开发者ID:adrian-sowinski,项目名称:fotos,代码行数:32,代码来源:acf.php
示例16: uf_load
/**
* Includes core files and adds the init action.
*
* This function is executed on after_setup_theme, so you can add all the hooks you need
* in functions.php, which is included before the after_setup_theme action is performed.
*/
function uf_load()
{
global $ultimatefields;
# Register plugin textdomain
$mofile = UF_DIR . "/languages/uf-" . get_locale() . ".mo";
if (file_exists($mofile)) {
load_textdomain('uf', $mofile);
}
# Most classes will somehow be saved to $ultimatefields
$ultimatefields = new stdClass();
# Common functionality that's used accross the framework
include_once 'common/common.php';
# Include classes and functions
include_once 'includes.php';
# Register additional fields, templates, etc.
do_action('uf_extend');
# Buffer certain exceptions, which are not fatal.
UF_Exceptions::buffer('non_existing_field');
# Add UF options pages which provide admin interface for fields
include_once 'settings/settings.php';
# Indicate that the plugin is present so themes could check it.
define('UF', true);
# Fields are set up on init, but only in the admin, with priority 12
add_action('init', 'uf_init', 12);
}
开发者ID:shesser,项目名称:selenenw,代码行数:31,代码来源:ultimate-fields.php
示例17: load_sslp_textdomain
function load_sslp_textdomain()
{
$domain = 'simple-staff-list';
$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/');
}
开发者ID:humancopy,项目名称:Staff-List-Plugin,代码行数:7,代码来源:simple-staff-list.php
示例18: load_plugin_textdomain
/**
* Load the plugin text domain for translation.
*/
public function load_plugin_textdomain()
{
$domain = $this->plugin_slug;
$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(plugin_dir_path(dirname(__FILE__))) . '/languages/');
}
开发者ID:habibmasuro,项目名称:wordpress-hashcash,代码行数:10,代码来源:class-wp-hashcash.php
示例19: register_plugin
function register_plugin($name, $base)
{
$this->plugin_name = $name;
$this->plugin_base = rtrim(dirname($base), DS);
$this->enqueue_scripts();
$this->enqueue_styles();
$this->initialize_classes();
$this->initialize_options();
if (function_exists('load_plugin_textdomain')) {
$currentlocale = get_locale();
if (!empty($currentlocale)) {
$moFile = dirname(__FILE__) . DS . "languages" . DS . $this->plugin_name . "-" . $currentlocale . ".mo";
if (@file_exists($moFile) && is_readable($moFile)) {
load_textdomain($this->plugin_name, $moFile);
}
}
}
if ($this->debugging == true) {
global $wpdb;
$wpdb->show_errors();
error_reporting(E_ALL);
@ini_set('display_errors', 1);
}
return true;
}
开发者ID:jhersonn20,项目名称:myportal,代码行数:25,代码来源:slideshow-gallery-plugin.php
示例20: load_plugin_textdomain
/**
* Localisation
*/
public function load_plugin_textdomain()
{
$locale = apply_filters('plugin_locale', get_locale(), PLUGINNAME_DOMAIN);
$dir = trailingslashit(WP_LANG_DIR);
load_textdomain(PLUGINNAME_DOMAIN, $dir . PLUGINNAME_DOMAIN . DIRECTORY_SEPARATOR . PLUGINNAME_DOMAIN . '-' . $locale . '.mo');
load_plugin_textdomain(PLUGINNAME_DOMAIN, false, dirname(plugin_basename(__FILE__)) . DIRECTORY_SEPARATOR . 'languages');
}
开发者ID:vunnu,项目名称:wordpress_plugin_framework,代码行数:10,代码来源:PluginName.class.php
注:本文中的load_textdomain函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论