本文整理汇总了PHP中qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage函数的典型用法代码示例。如果您正苦于以下问题:PHP qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage函数的具体用法?PHP qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage怎么用?PHP qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: translate
public function translate($text)
{
if (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
return qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
} else {
return qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
}
}
示例2: qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage
function qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($content)
{
return qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($content);
}
示例3: internationalize
/**
* @param $in
*
* @return mixed|void
*/
function internationalize($in)
{
if (function_exists('langswitch_filter_langs_with_message')) {
$in = langswitch_filter_langs_with_message($in);
}
if (function_exists('polyglot_filter')) {
$in = polyglot_filter($in);
}
if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
$in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);
} elseif (function_exists('ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
$in = ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);
} elseif (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
$in = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);
}
return apply_filters('localization', $in);
}
示例4: qtranxf_convertFormat
function qtranxf_convertFormat($format, $default_format)
{
global $q_config;
// if one of special language-neutral formats are requested, don't replace it
switch ($format) {
case 'Z':
case 'c':
case 'r':
case 'U':
return qtranxf_convertDateFormatToStrftimeFormat($format);
default:
break;
}
// check for multilang formats
$format = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($format);
$default_format = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($default_format);
switch ($q_config['use_strftime']) {
case QTX_DATE:
if ($format == '') {
$format = $default_format;
}
return qtranxf_convertDateFormatToStrftimeFormat($format);
case QTX_DATE_OVERRIDE:
return qtranxf_convertDateFormatToStrftimeFormat($default_format);
case QTX_STRFTIME:
return $format;
case QTX_STRFTIME_OVERRIDE:
default:
return $default_format;
}
}
示例5: putCreativeLayer
//.........这里部分代码省略.........
if ($layer_selectable !== "default") {
if ($layer_selectable == 'on') {
$outputClass = trim($outputClass) . ' tp-layer-selectable ';
}
} else {
if ($slider_selectable == 'on') {
$outputClass = trim($outputClass) . ' tp-layer-selectable ';
}
}
//if($type == 'button') $outputClass .= ' ';
//$speed = RevSliderFunctions::getVal($layer, "speed",300);
$time = RevSliderFunctions::getVal($layer, 'time', 0);
$easing = RevSliderFunctions::getVal($layer, 'easing', 'easeOutExpo');
$randomRotate = RevSliderFunctions::getVal($layer, 'random_rotation', 'false');
$randomRotate = RevSliderFunctions::boolToStr($randomRotate);
$splitin = RevSliderFunctions::getVal($layer, 'split', 'none');
$splitout = RevSliderFunctions::getVal($layer, 'endsplit', 'none');
$elementdelay = intval(RevSliderFunctions::getVal($layer, 'splitdelay', 0));
$endelementdelay = intval(RevSliderFunctions::getVal($layer, 'endsplitdelay', 0));
$basealign = RevSliderFunctions::getVal($layer, 'basealign', 'grid');
if ($elementdelay > 0) {
$elementdelay /= 100;
}
if ($endelementdelay > 0) {
$endelementdelay /= 100;
}
$text = RevSliderFunctions::getVal($layer, 'text');
if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
//use qTranslate
$text = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
} elseif (function_exists('ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
//use qTranslate plus
$text = ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
} elseif (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
//use qTranslate X
$text = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
}
$text_toggle = RevSliderFunctions::getVal($layer, 'texttoggle');
if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
//use qTranslate
$text_toggle = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text_toggle);
} elseif (function_exists('ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
//use qTranslate plus
$text_toggle = ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text_toggle);
} elseif (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
//use qTranslate X
$text_toggle = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($text_toggle);
}
$htmlVideoAutoplay = '';
$htmlVideoAutoplayOnlyFirstTime = '';
$htmlVideoNextSlide = '';
$htmlVideoThumbnail = '';
$htmlMute = '';
$htmlCover = '';
$htmlDotted = '';
$htmlRatio = '';
$htmlRewind = '';
$htmlStartAt = '';
$htmlEndAt = '';
$htmlCoverPause = '';
$htmlDisableOnMobile = '';
$ids = RevSliderFunctions::getVal($layer, 'attrID');
$classes = RevSliderFunctions::getVal($layer, 'attrClasses');
$title = RevSliderFunctions::getVal($layer, 'attrTitle');
$rel = RevSliderFunctions::getVal($layer, 'attrRel');
if (trim($ids) == '') {
示例6: qtranxf_admin_the_title
function qtranxf_admin_the_title($title)
{
global $pagenow;
switch ($pagenow) {
//case 'edit-tags.php':
case 'nav-menus.php':
return $title;
default:
return qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($title);
}
}
示例7: qtranxf_format_time
function qtranxf_format_time($format, $mysq_time, $default, $before = '', $after = '')
{
global $q_config;
$ts = mysql2date('U', $mysq_time);
if ($format == 'U') {
return $ts;
}
$format = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($format);
if (!empty($format) && $q_config['use_strftime'] == QTX_STRFTIME) {
$format = qtranxf_convertDateFormatToStrftimeFormat($format);
}
return qtranxf_strftime(qtranxf_convertTimeFormat($format), $ts, $default, $before, $after);
}
示例8: eme_translate
function eme_translate($value, $lang = '')
{
//if (empty($lang))
// $lang=eme_detect_lang();
if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage') && function_exists('qtrans_use')) {
if (empty($lang)) {
return qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($value);
} else {
return qtrans_use($lang, $value);
}
} elseif (function_exists('ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage') && function_exists('ppqtrans_use')) {
if (empty($lang)) {
return ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($value);
} else {
return ppqtrans_use($lang, $value);
}
} elseif (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage') && function_exists('qtranxf_use')) {
if (empty($lang)) {
return qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($value);
} else {
return qtranxf_use($lang, $value);
}
} elseif (function_exists('pll_translate_string') && function_exists('pll__')) {
if (empty($lang)) {
return pll__($value);
} else {
return pll_translate_string($value, $lang);
}
} else {
return $value;
}
}
示例9: qtranslation
/**
* Translate with a qTranslate compatible plugin.
*
* @since 2.0.0
* @param string $text The original text
* @return string $translation The translated text
*/
public function qtranslation($text)
{
if (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
$translation = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
} else {
$translation = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
}
return $translation;
}
示例10: alo_em_qtranxf_alo_em___
function alo_em_qtranxf_alo_em___($text)
{
if (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
$text = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
}
return $text;
}
示例11: qts_service
//.........这里部分代码省略.........
if ($translate_from_name) {
$permalink = qtranxf_convertURL($translate_from_name, $permalink);
}
$post_title_html = '<a href="' . $permalink . '" target="_blank">' . $post_title_html . '</a>';
}
if (!empty($translate_from) && !empty($translate_to)) {
$title = sprintf('Translate "%1$s" from %2$s to %3$s', $post_title_html, $translate_from_name, $translate_to_name);
} elseif (!empty($translate_from)) {
$title = sprintf('Translate "%1$s" from %2$s', $post_title_html, $translate_from_name);
} else {
$title = sprintf('Translate "%1$s"', $post_title_html);
}
// Check data
if (isset($_POST['service_id'])) {
$service_id = intval($_POST['service_id']);
$default_service = $service_id;
update_option('qts_default_service', $service_id);
$order_key = substr(md5(time() . AUTH_KEY), 0, 20);
$request = array('order_service_id' => $service_id, 'order_url' => get_option('home'), 'order_key' => $order_key, 'order_title' => $post_title, 'order_text' => $post_content, 'order_excerpt' => $post_excerpt, 'order_source_language' => $translate_from, 'order_source_locale' => $q_config['locale'][$translate_from], 'order_target_language' => $translate_to, 'order_target_locale' => $q_config['locale'][$translate_to]);
// check for additional fields
if (isset($service_settings[$service_id]) && is_array($service_settings[$service_id])) {
$request['order_required_field'] = array();
foreach ($service_settings[$service_id] as $setting => $value) {
$request['order_required_field'][$setting] = $value;
}
}
if (isset($_POST['token'])) {
$request['order_token'] = $_POST['token'];
}
$answer = qts_queryQS(QTS_INIT_TRANSLATION, $request);
if (isset($answer['error'])) {
$error = sprintf(__('An error occured: %s', 'qtranslate'), $qts_error_messages[$answer['error']]);
if ($answer['message'] != '') {
$error .= '<br/>' . sprintf(__('Additional information: %s', 'qtranslate'), qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($answer['message']));
}
}
if (isset($answer['order_id'])) {
$orders = get_option('qts_orders');
if (!is_array($orders)) {
$orders = array();
}
$orders[] = array('post_id' => $post_id, 'service_id' => $service_id, 'source_language' => $translate_from, 'target_language' => $translate_to, 'order' => array('order_key' => $order_key, 'order_id' => $answer['order_id']));
update_option('qts_orders', $orders);
if (empty($answer['message'])) {
$order_completed_message = '';
} else {
$order_completed_message = htmlspecialchars($answer['message']);
}
qts_UpdateOrder($answer['order_id']);
}
}
if (isset($error)) {
?>
<div class="wrap">
<h2><?php
_e('qTranslate Services', 'qtranslate');
?>
</h2>
<div id="message" class="error fade"><p><?php
echo $error;
?>
</p></div>
<p><?php
printf(__('An serious error occured and qTranslate Services cannot proceed. For help, please visit the <a href="%s">Support Forum</a>', 'qtranslate'), 'http://www.qianqin.de/qtranslate/forum/');
?>
</p>
示例12: qtranxf_admin_the_title
function qtranxf_admin_the_title($title)
{
global $pagenow;
//todo this filter should not be used in admin area at all?
if (defined('DOING_AJAX') && DOING_AJAX) {
//nav-menus.php#752
return $title;
}
global $pagenow;
switch ($pagenow) {
//case 'term.php':
//case 'edit-tags.php':
case 'nav-menus.php':
return $title;
default:
return qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($title);
}
}