当前位置: 首页>>代码示例>>PHP>>正文


PHP i18n_merge函数代码示例

本文整理汇总了PHP中i18n_merge函数的典型用法代码示例。如果您正苦于以下问题:PHP i18n_merge函数的具体用法?PHP i18n_merge怎么用?PHP i18n_merge使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了i18n_merge函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: load_languages

function load_languages()
{
    global $LANG;
    if (basename($_SERVER['PHP_SELF']) != 'index.php') {
        i18n_merge('calendar', substr($LANG, 0, 2)) || i18n_merge('calendar', 'en');
    }
}
开发者ID:Vin985,项目名称:clqweb,代码行数:7,代码来源:hooks.php

示例2: outputGallery

 public static function outputGallery($gallery, $ignoreQuery = false)
 {
     global $LANG, $i18n_gallery_pic_used;
     include_once GSPLUGINPATH . 'i18n_gallery/helper.php';
     if (function_exists('i18n_load_texts')) {
         i18n_load_texts('i18n_gallery');
     } else {
         i18n_merge('i18n_gallery', substr($LANG, 0, 2)) || i18n_merge('i18n_gallery', 'en');
     }
     $pic = @$gallery['pic'];
     if (!$ignoreQuery && isset($_GET['pic']) && !$i18n_gallery_pic_used) {
         if (strpos($_GET['pic'], ':') === false) {
             $pic = intval($_GET['pic']);
             $i18n_gallery_pic_used = true;
         } else {
             if (substr($_GET['pic'], 0, strrpos($_GET['pic'], ':')) == $gallery['name']) {
                 $pic = intval(substr($_GET['pic'], strrpos($_GET['pic'], ':') + 1));
                 $i18n_gallery_pic_used = true;
             }
         }
     }
     $plugins = i18n_gallery_plugins();
     $plugin = @$plugins[$gallery['type']];
     if ($plugin) {
         call_user_func_array($plugin['content'], array($gallery, $pic));
     }
 }
开发者ID:Vin985,项目名称:clqweb,代码行数:27,代码来源:frontend.class.php

示例3: jQuery_migrate_init

function jQuery_migrate_init()
{
    global $thisfile_GSJQM, $SITEURL;
    i18n_merge($thisfile_GSJQM) || i18n_merge($thisfile_GSJQM, GSDEFAULTLANG);
    # register plugin
    register_plugin($thisfile_GSJQM, i18n_r($thisfile_GSJQM . '/GSJQMigrate_TITLE'), '1.0', 'GetSimpleCMS', 'http://get-simple.info', i18n_r($thisfile_GSJQM . '/GSJQMigrate_DESC'), '', '');
    $asset = isDebug() ? 'jquery-migrate-1.2.1.js' : 'jquery-migrate-1.2.1.min.js';
    // when debug is on, migrate will output to console with deprecated notices.
    $url = $SITEURL . 'plugins/' . $thisfile_GSJQM . '/assets/js/' . $asset;
    register_script('jquerymigrate', $url, '', FALSE);
    queue_script('jquerymigrate', GSBACK);
}
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:12,代码来源:GSJQueryMigrate.php

示例4: gs_plugin_installer_init

/**
 * Function responsible for initializing the plugin
 */
function gs_plugin_installer_init()
{
    /**
     *  Import localization files, default to english
     **********************************************************************/
    i18n_merge('gs_plugin_installer') || i18n_merge('gs_plugin_installer', "en_US");
    /**
     * Initialize our PluginInstaller object
     **********************************************************************/
    $Installer = new PluginInstaller(dirname(__FILE__) . "/gs_plugin_installer/plugin_cache.json");
    /**
     * Run our plugin
     **********************************************************************/
    gs_plugin_installer_main($Installer);
}
开发者ID:HelgeSverre,项目名称:gs-plugin-installer,代码行数:18,代码来源:gs_plugin_installer.php

示例5: displayEvents

 public static function displayEvents($admin = false)
 {
     global $LANG;
     if (function_exists('i18n_load_texts')) {
         i18n_load_texts('calendar');
     } else {
         i18n_merge('calendar', substr($LANG, 0, 2)) || i18n_merge('my_plugin', 'en');
     }
     require_once GSPLUGINPATH . 'calendar/calendar.class.php';
     $text = '<div class="schedule">';
     $text .= '<div class="cal_title">' . i18n_r('calendar/EVENTS_LIST') . '</div>';
     $text .= '<div class="spacer"></div>';
     $calendar = new Calendar();
     $schedule = $calendar->getSchedule();
     $n = 0;
     foreach ($schedule->dates as $date) {
         $odd = $n % 2 == 0;
         $text .= self::addDate($date, $admin, $odd);
         $n++;
     }
     $text .= '</div>';
     echo $text;
 }
开发者ID:Vin985,项目名称:clqweb,代码行数:23,代码来源:frontend.class.php

示例6: satb_automerge

function satb_automerge($array)
{
    global $LANG;
    // loop plugins for i18n text {}
    // index unique for single merge
    // merge plugin lang files in string for posible lang combinations ( which is inefficient )
    $i18n_merges = array();
    foreach ($array as $menu) {
        # satb_debugLog($menu);
        foreach ($menu as $item) {
            # satb_debugLog($item);
            if (preg_match('/^\\{(.*)\\/(.*)\\}$/', $item['title'], $matches)) {
                # satb_debugLog($item);
                if (isset($matches[1]) and isset($matches[2])) {
                    $i18n_merges[] = trim($matches[1]);
                }
            }
        }
    }
    $i18n_merges = array_unique($i18n_merges);
    foreach ($i18n_merges as $merge) {
        satb_debugLog('satb_automerge_custom', $merge);
        i18n_merge($merge, $LANG);
        i18n_merge($merge, substr($LANG, 0, 2));
        # i18n_merge($matches[1],'en_US');
    }
}
开发者ID:hatasu,项目名称:appdroid,代码行数:27,代码来源:sa_toolbar.php

示例7: cookie_check

<?php

/**
 * Basic Page Browser for I18N Custom Fields
 *
 * Displays and selects file link to insert
 */
include '../../../admin/inc/common.php';
$loggedin = cookie_check();
if (!$loggedin) {
    die;
}
include '../../../admin/inc/theme_functions.php';
i18n_merge('i18n_customfields') || i18n_merge('i18n_customfields', 'en_US');
$func = preg_replace('/[^\\w]/', '', @$_GET['func']);
global $SITEURL;
$path_parts = pathinfo($_SERVER['PHP_SELF']);
$sitepath = $SITEURL;
$isI18N = @$_GET['i18n'];
$pages = array();
$dir_handle = @opendir(GSDATAPAGESPATH) or die("Unable to open pages directory");
while ($filename = readdir($dir_handle)) {
    if (strrpos($filename, '.xml') === strlen($filename) - 4 && !is_dir(GSDATAPAGESPATH . $filename)) {
        $data = getXML(GSDATAPAGESPATH . $filename);
        if (!$isI18N || strpos($filename, '_') === false) {
            $url = '' . $data->url;
            if (!isset($pages[$url])) {
                $pages[$url] = array('url' => $url, 'variants' => array());
            }
            $pages[$url]['exists'] = true;
            $pages[$url]['parent'] = (string) $data->parent;
开发者ID:hatasu,项目名称:appdroid,代码行数:31,代码来源:pagebrowser.php

示例8: basename

Version: 1.0
Author: Chris Cagle
Author URI: http://www.cagintranet.com/
*/
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");
# register plugin
register_plugin($thisfile, 'Books Manager', '1.0', 'Abdellah Ait Hadji', 'http://www.abdelaithadji.com/', 'Finds email addresses in content and components and "hides" them', 'pages', 'bm_admin');
# hooks
add_filter('content', 'bm_show');
# add a link in the admin tab 'theme'
add_action('pages-sidebar', 'createSideMenu', array($thisfile, 'Books Manager'));
# includes
require_once 'books_manager/inc/common.php';
# language
i18n_merge('books_manager') || i18n_merge('books_manager', 'en_US');
# functions
function bm_admin()
{
    if (nm_env_check()) {
        # book management
        if (isset($_GET['edit'])) {
            bm_edit_book($_GET['edit']);
        } elseif (isset($_POST['book'])) {
            bm_save_book();
            bm_admin_panel();
        } elseif (isset($_GET['delete'])) {
            bm_delete_book($_GET['delete']);
            bm_admin_panel();
        } elseif (isset($_GET['restore'])) {
            bm_restore_book($_GET['restore']);
开发者ID:abdelaithadji,项目名称:books_manager,代码行数:31,代码来源:books_manager.php

示例9: basename

        // fallback to first lang found
        $LANG = basename($filenames[0], ".php");
    }
}
i18n_merge(null);
// load $LANG file into $i18n
// Merge in default lang to avoid empty lang tokens
// if GSMERGELANG is undefined or false merge en_US else merge custom
if (getDef('GSMERGELANG', true) !== false and !getDef('GSMERGELANG', true)) {
    if ($LANG != 'en_US') {
        i18n_merge(null, "en_US");
    }
} else {
    // merge GSMERGELANG defined lang if not the same as $LANG
    if ($LANG != getDef('GSMERGELANG')) {
        i18n_merge(null, getDef('GSMERGELANG'));
    }
}
/** 
 * Init Editor globals
 * @uses $EDHEIGHT
 * @uses $EDLANG
 * @uses $EDTOOL js array string | php array | 'none' | ck toolbar_ name
 * @uses $EDOPTIONS js obj param strings, comma delimited
 */
if (defined('GSEDITORHEIGHT')) {
    $EDHEIGHT = GSEDITORHEIGHT . 'px';
} else {
    $EDHEIGHT = '500px';
}
if (defined('GSEDITORLANG')) {
开发者ID:Kevinf63,项目名称:KevPortfolio,代码行数:31,代码来源:common.php

示例10: basename

<?php

/* Custom Menu */
# thisfile
$thisfile = basename(__FILE__, '.php');
# language
i18n_merge($thisfile) || i18n_merge($thisfile, 'en_US');
# requires
require_once GSPLUGINPATH . $thisfile . '/php/class.php';
# class instantiation
$custommenu = new customMenu();
# register plugin
register_plugin($custommenu->info('id'), $custommenu->info('name'), $custommenu->info('version'), $custommenu->info('author'), $custommenu->info('url'), $custommenu->info('description'), $custommenu->info('page'), array($custommenu, 'admin'));
# activate actions/filters
# front-end
add_action('theme-header', array($custommenu, 'themeHeader'));
# back-end
if (isset($_GET['id']) && $_GET['id'] == customMenu::FILE) {
    add_action('header', array($custommenu, 'header'));
}
add_action($custommenu->info('page') . '-sidebar', 'createSideMenu', array($custommenu->info('id'), $custommenu->info('sidebar')));
// sidebar link
add_filter('content', array($custommenu, 'content'));
# functions
function get_custom_menu($name, $classes = array())
{
    $menu = new CustomMenuDisplay($name, $classes);
}
开发者ID:sevenns,项目名称:alpremstroy,代码行数:28,代码来源:custom_menu.php

示例11: basename

Author URI: http://profileyourcity.com
Modified Version Of Mvlcek's Plugin
*/
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");
if (file_exists('ITEMSFILE')) {
    $item_manager_file = getXML(GSDATAOTHERPATH . 'item_manager.xml');
    global $item_title;
    $item_title = $item_manager_file->item->title;
} else {
    global $item_title;
    $item_title = "Item";
}
# register plugin
register_plugin($thisfile, 'Custom Fields For Items', '1.0', 'PYC', 'http://profileyourcity.com/', 'Manages Custom Fields For The Items Manager - Modified Version of Mvlcek\'s Plugin', 'pages', 'items_customfields_configure');
i18n_merge('items') || i18n_merge('items', 'en_US');
add_action('header', 'items_customfields_header');
// add hook to create styles for custom field editor.
require_once GSPLUGINPATH . 'items/common.php';
$im_customfield_def = null;
function items_customfields_header()
{
    if (!file_exists(GSDATAOTHERPATH . 'plugincustomfields.xml')) {
        $xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><channel></channel>');
        $xml->asXML(GSDATAOTHERPATH . 'plugincustomfields.xml');
        return true;
    }
    ?>
  <style type="text/css">
    form #metadata_window table.formtable td .cke_editor td:first-child { padding: 0; }
    form #metadata_window table.formtable .cke_editor td.cke_top { border-bottom: 1px solid #AAAAAA; }
开发者ID:nelsonr,项目名称:Items-Manager,代码行数:31,代码来源:plugins_customfields.php

示例12: basename

<?php

/*
DISCLAIMER - When I initially created this plugin I had very little knowledge of php and was a programming noob. I know it is in need of a rewrite and I will get around to it at some point --

Plugin Name: Multi User
Description: Adds Multi-User Management Section'
Version: 1.8.2
Author: Mike Henken
Author URI: http://michaelhenken.com/
*/
// get correct id for plugin
$thisfile = basename(__FILE__, ".php");
# add in this plugin's language file
i18n_merge('user-managment') || i18n_merge('user-managment', 'en_US');
// register plugin
register_plugin($thisfile, 'Multi User', '1.8.2', 'Mike Henken', 'http://www.michaelhenken.com/', i18n_r('user-managment/PLUGIN_DESCRIPTION'), 'settings', 'mm_admin');
// activate hooks //
//Add Sidebar Item In Settings Page
add_action('settings-sidebar', 'createSideMenu', array($thisfile, i18n_r('user-managment/SIDEBAR')));
//Make the multiuser_perm() function run before each admin page loads
add_action('header', 'mm_permissions');
add_action('settings-user', 'mm_gs_settings_pg');
add_action('settings-user-extras', 'settings_form_data');
define('MULTIUSERPLUGINFOLDER', GSPLUGINPATH . 'user-managment/');
class MultiUser
{
    public function __construct()
    {
        $old_add_file = GSPLUGINPATH . 'user-managment-add.php';
        if (file_exists($old_add_file)) {
开发者ID:hatasu,项目名称:appdroid,代码行数:31,代码来源:user-managment.php

示例13: extract

 * @global  (str) $LANG       language for auth user
 */
// grab cookie user data from userid.xml
global $datau, $USR, $HTMLEDITOR, $USRTIMEZONE, $USRLANG;
extract(getUserData(true));
/**
 * Global Language Data
 *
 * @global  (array) $i18n i18n token keyed translation array
 * @global  (str) $LANG  IETF langcode (w/underscore delim) [tag]_[subtag]
 */
global $i18n, $LANG;
// load language
$LANG = getDefaultLang();
// set global language from config heirarchy
i18n_merge(null);
// load $LANG file into $i18n
i18n_mergeDefault();
// load GSDEFAULTLANG or GSMERGELANG lang into $i18n to override ugly missing {} tokens if set
//save php locale
setOldLocale();
/**
 * Globals for salt and authentication data
 *
 * @global (obj) $dataa,       authorization xml raw obj from GSDATAOTHERPATH.GSAUTHFILE
 * @global (str) $SALT,        salt from gsconfig else authorization file
 * @global (str) $SESSIONHASH  used for stateless session confirmation, or as non-expiring nonce for certain operations
 */
global $dataa, $SALT, $SESSIONHASH;
// grab authorization and security data fatal fail if salt is not set
$SALT = getDefaultSalt();
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:31,代码来源:common.php

示例14: basename

<?php

/*
 Plugin Name: GetSimple Contact
 Description: Simple contact form plugin for GetSimple
 Version: 1.3.0
 Author: Kolyok
 Author URI: http://get-simple.info/forums/member.php?action=profile&uid=7989
*/
$thisfile_sc = basename(__FILE__, ".php");
i18n_merge($thisfile_sc) || i18n_merge($thisfile_sc, 'en_US');
$sc_language = sc_language();
register_plugin($thisfile_sc, sc_i18n($thisfile_sc, $sc_language, 'SC_TITLE'), '1.3.0', 'Kolyok', 'http://get-simple.info/forums/member.php?action=profile&uid=7989', sc_i18n($thisfile_sc, $sc_language, 'SC_DESC'), 'plugins', 'sc_backend');
add_action('plugins-sidebar', 'createSideMenu', array($thisfile_sc, sc_i18n($thisfile_sc, $sc_language, 'SC_TITLE_ADMIN')));
add_action('index-pretemplate', 'sc_generate_token');
add_filter('content', 'sc_frontend');
define('SC_SMTPSALT', 'AfwoZCSlrcdyN_RzzC');
define('SC_SMTPPEPPER', 'Zh%7Qyar-WZH-i8%%w');
$settings_file = GSDATAOTHERPATH . 'getsimple_contact_settings.xml';
$settings_update = array('CAPTCHA_TYPE' => array('captcha_type' => 0), 'RECAPTCHA_STATUS' => array('recaptcha_status' => 0), 'SUPERADMIN_NAME' => array('superadmin_name' => 'Superadmin Name'), 'SUPERADMIN_EMAIL' => array('superadmin_email' => 'superadmin@name.com'), 'WYSIHTML5_EDITOR' => array('wysihtml5_editor' => 1), 'CC_STATUS' => array('cc_status' => 0), 'ATTACHMENTS_STATUS' => array('attachments_status' => 0), 'SMTP_STATUS' => array('smtp_status' => 0), 'SMTP_HOST' => array('smtp_host' => 'localhost'), 'SMTP_PORT' => array('smtp_port' => 25), 'SMTP_AUTH' => array('smtp_auth' => 0), 'SMTP_USERNAME' => array('smtp_username' => ''), 'SMTP_PASSWORD' => array('smtp_password' => ''));
sc_be_update_settings($settings_update);
function sc_backend()
{
    if (isset($_POST) && $_POST) {
        sc_save_settings($_POST);
        echo sc_be_content();
    } else {
        echo sc_be_content();
    }
}
function sc_frontend($content)
开发者ID:elephantcode,项目名称:elephantcode,代码行数:31,代码来源:getsimple_contact.php

示例15: basename

<?php

/*
Plugin Name: Innovation Theme Settings
Description: Settings for the default GetSimple Theme: Innovation
Version: 1.2
Author: Chris Cagle
Author URI: http://chriscagle.me
*/
# get correct id for plugin
$thisfile_innov = basename(__FILE__, ".php");
$innovation_file = GSDATAOTHERPATH . 'InnovationSettings.xml';
# add in this plugin's language file
i18n_merge($thisfile_innov) || i18n_merge($thisfile_innov, GSDEFAULTLANG);
# register plugin
register_plugin($thisfile_innov, i18n_r($thisfile_innov . '/INNOVATION_TITLE'), '1.2', 'Chris Cagle', 'http://chriscagle.me', i18n_r($thisfile_innov . '/INNOVATION_DESC'), 'theme', 'innovation_show');
$hidemenu = true;
# hooks
# enable side menu is theme is innovation or on theme page and enabling innovation, handle plugin exec before global is set
if (!$hidemenu || ($TEMPLATE == "Innovation" || get_filename_id() == 'theme' && isset($_POST['template']) && $_POST['template'] == 'Innovation') && !($TEMPLATE == "Innovation" && get_filename_id() == 'theme' && isset($_POST['template']) && $_POST['template'] != 'Innovation')) {
    add_action('theme-sidebar', 'createSideMenu', array($thisfile_innov, i18n_r($thisfile_innov . '/INNOVATION_TITLE')));
}
$services = array('facebook', 'googleplus', 'twitter', 'linkedin', 'tumblr', 'instagram', 'youtube', 'vimeo', 'github');
# get XML data
if (file_exists($innovation_file)) {
    $innovation_data = getXML($innovation_file);
}
function innovation_show()
{
    global $services, $innovation_file, $innovation_data, $thisfile_innov;
    $success = $error = null;
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:31,代码来源:InnovationPlugin.php


注:本文中的i18n_merge函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。