本文整理汇总了PHP中pll__函数的典型用法代码示例。如果您正苦于以下问题:PHP pll__函数的具体用法?PHP pll__怎么用?PHP pll__使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pll__函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wpmtst_l10n_polylang
/**
* Polylang
*
* @param $string
* @param $context
* @param $name
*
* @return bool|string|void
*/
function wpmtst_l10n_polylang($string, $context, $name)
{
if (function_exists('pll__')) {
return pll__($string);
}
return $string;
}
开发者ID:serker72,项目名称:T3S,代码行数:16,代码来源:l10n.php
示例2: translate_strings
public function translate_strings($form)
{
if (function_exists('pll__')) {
$this->iterate_form($form, function (&$value, $key) {
$value = pll__($value);
});
}
return $form;
}
开发者ID:pdme,项目名称:gravity-forms-polylang,代码行数:9,代码来源:class_GF_PLL.php
示例3: email_instructions
/**
* Add content to the WC emails.
*
* Note: The difference from WC_Gateway_BACS is that we use __() before
* passing the string through wptexturize() and wpautop().
*
* @param WC_Order $order
* @param bool $sent_to_admin
* @param bool $plain_text
*/
public function email_instructions($order, $sent_to_admin, $plain_text = false)
{
if (!$sent_to_admin && 'bacs' === $order->payment_method && $order->has_status('on-hold')) {
if ($this->instructions) {
echo wpautop(wptexturize(function_exists('pll__') ? pll__($this->instructions) : __($this->instructions, 'woocommerce'))) . PHP_EOL;
}
$this->bank_details($order->id);
}
}
开发者ID:hyyan,项目名称:woo-poly-integration,代码行数:19,代码来源:GatewayBACS.php
示例4: translate_string
public function translate_string($string)
{
if (function_exists('pll__')) {
return pll__($string);
} else {
return $string;
// Don't kill anything.
}
}
开发者ID:anttiviljami,项目名称:wp-libre-form,代码行数:9,代码来源:class-wplf-polylang.php
示例5: trans
/**
* Get translations by their strings.
*
* @param string $key
* @param string|null $lang
*
* @throws \BadFunctionCallException
*
* @return string
*/
function trans($key, $lang = null)
{
if (!function_exists('pll__')) {
throw new BadFunctionCallException('Please active the Polylang plugin.');
}
if ($lang) {
return pll_translate_string($key, $lang);
}
return pll__($key);
}
开发者ID:wordplate,项目名称:translator,代码行数:20,代码来源:helpers.php
示例6: get_string
/**
* Get multilanguage string
*
* @since 1.0.0
*
* @param string $plugin_name_human_format The Plugin name
* @param string $string_name The name of the string
* @param string $value The value
*/
function get_string($plugin_name_human_format, $string_name, $value)
{
if (function_exists('icl_t')) {
return icl_t($plugin_name_human_format, $string_name, $value);
} elseif (has_filter('cml_my_translations')) {
return CMLTranslations::get(CMLLanguage::get_current_id(), $string_name, str_replace(' ', '-', $plugin_name_human_format));
} elseif (function_exists('pll__')) {
return pll__($string_name);
} else {
return $value;
}
}
开发者ID:Bqd,项目名称:WordPress-Plugin-Boilerplate-Powered,代码行数:21,代码来源:language.php
示例7: ci_get_string_translation
/**
* Retrieves the translation for a string, if available. Needs a supported translation plugin active.
* Parameters should be identical to respective call of ci_register_string_translation()
*
* @param string $name A description of the value, e.g. 'Booking - Button Text'
* @param string $value The text to be registered for translation, e.g. 'Book Now'
* @param string $context A context for grouping and disambiguation of the value, e.g. 'Widgets'
* @return string A translation of $value if available, else $value.
*/
function ci_get_string_translation($name, $value, $context)
{
$translation = $value;
// WPML support
if (function_exists('icl_t')) {
$translation = icl_t($context, $name . ' - ' . md5($value), $value);
} elseif (function_exists('pll__')) {
// Doesn't work before the 'wp' action.
$translation = pll__($value);
}
// qTranslate seems to be working out of the box.
return $translation;
}
开发者ID:nickolasnikolic,项目名称:wordpress-heroku-php,代码行数:22,代码来源:localization.php
示例8: populateDropdownOptions
function populateDropdownOptions()
{
foreach ($this->fields as $key => $val) {
if ($val['metaType'] == 'taxonomy') {
$this->fields[$key]['dropdownOptions'] = $this->getDropdownOptionsFromTaxonomy($val['taxonomySlug']);
}
}
$this->fields['country']['dropdownOptions'] = $this->countryList;
$this->fields['country']['dropdownOptions'][0] = pll__('Pasirinkite');
$this->fields['license_territory']['dropdownOptions'] = $this->countryList;
$this->fields['license_territory']['dropdownOptions'][0] = pll__('Pasirinkite');
$this->fields['film_original_language']['dropdownOptions'] = $this->countryList22;
$this->fields['film_original_language']['dropdownOptions'][0] = pll__('Pasirinkite');
$this->fields['film_subtitle_language']['dropdownOptions'] = $this->countryList22;
$this->fields['film_subtitle_language']['dropdownOptions'][0] = pll__('Pasirinkite');
}
开发者ID:uoyknaht,项目名称:kc,代码行数:16,代码来源:film-register-data.class.php
示例9: perth_header_text
/**
* Header text
*/
function perth_header_text()
{
if (!function_exists('pll_register_string')) {
$header_text = get_theme_mod('header_text', 'Welcome to Perth');
$button_left = get_theme_mod('button_left', 'Start here');
$button_right = get_theme_mod('button_right', 'Read more');
} else {
$header_text = pll__(get_theme_mod('header_text', 'Welcome to Perth'));
$button_left = pll__(get_theme_mod('button_left', 'Start here'));
$button_right = pll__(get_theme_mod('button_right', 'Read more'));
}
$button_left_url = get_theme_mod('button_left_url', '#primary');
$button_right_url = get_theme_mod('button_right_url', '#primary');
echo '<div class="header-info">
<h3 class="header-text">' . esc_html($header_text) . '</h3>
<div class="header-buttons">';
if ($button_left_url) {
echo '<a class="button header-button left-button" href="' . esc_url($button_left_url) . '">' . esc_html($button_left) . '</a>';
}
if ($button_right_url) {
echo '<a class="button header-button right-button" href="' . esc_url($button_right_url) . '">' . esc_html($button_right) . '</a>';
}
echo '</div>';
echo '</div>';
}
开发者ID:c-o-l-o-r,项目名称:ESUC-Website,代码行数:28,代码来源:functions.php
示例10: get_translation_string
/**
* Add translation strings to translatable strings
*
* @param array $parameter ["domain" => "wpsolr facel label", "name" => "categories", "text" => "my categories"]
*/
function get_translation_string($string, $parameter)
{
if (empty($parameter['language'])) {
// Translate with current language
$result = pll__($parameter['name']);
} else {
// Translate with parameter language
$result = pll_translate_string($parameter['name'], $parameter['language']);
}
return $result;
}
开发者ID:silvestrelosada,项目名称:wpsolr-search-engine,代码行数:16,代码来源:plugin-polylang.php
示例11: icl_translate
function icl_translate($context, $name, $string, $bool = false)
{
PLL_WPML_Compat::instance()->register_string($context, $name, $string);
return pll__($string);
}
开发者ID:spielhoelle,项目名称:amnesty,代码行数:5,代码来源:wpml-compat.php
示例12: pll_translate_string
function pll_translate_string($string, $lang)
{
if (pll_current_language() == $lang) {
return pll__($string);
}
static $cache;
// cache object to avoid loading the same translations object several times
if (empty($cache)) {
$cache = new PLL_Cache();
}
if (false === ($mo = $cache->get($lang))) {
$mo = new PLL_MO();
$mo->import_from_db(PLL()->model->get_language($lang));
$cache->set($lang, $mo);
}
return $mo->translate($string);
}
开发者ID:iq007,项目名称:MadScape,代码行数:17,代码来源:api.php
示例13: translate_strings_recursive
protected function translate_strings_recursive($strings, $values)
{
foreach ($values as $name => $value) {
if (isset($strings[$name])) {
if (is_string($value) && $strings[$name] == 1) {
$values[$name] = pll__($value);
} elseif (is_array($value) && is_array($strings[$name])) {
$values[$name] = $this->translate_strings_recursive($strings[$name], $value);
}
}
}
return $values;
}
开发者ID:MaryMaffka,项目名称:dpm,代码行数:13,代码来源:wpml-compat.php
示例14: addEndpoints
/**
* Add endpoints
*
* Add all endpoints translation in the current langauge
*/
public function addEndpoints()
{
foreach ($this->endpoints as $endpoint) {
add_rewrite_endpoint(pll__($endpoint), EP_ROOT | EP_PAGES);
}
}
开发者ID:decarvalhoaa,项目名称:woopoly,代码行数:11,代码来源:Endpoints.php
示例15: get_header
<?php
get_header();
?>
<section class="content">
<?php
echo do_shortcode('[sh-latest-posts cat="news" label="' . pll__('Новини') . '"]');
?>
<div class="separator"></div>
<div class="col-right sponsors sponsors-frontpage">
<?php
echo do_shortcode('[sponsors]');
?>
<?php
echo do_shortcode('[partners]');
?>
</div>
<div class="separator"></div>
</section>
<?php
echo do_shortcode('[transport]');
?>
<?php
get_footer();
开发者ID:qweqq,项目名称:initfest,代码行数:26,代码来源:front-page.php
示例16: translateAttrLable
/**
* Translate the attribute label
*
* @param string $label original attribute label
*
* @return string translated attribute label
*/
public function translateAttrLable($label)
{
return pll__($label);
}
开发者ID:Frost-Bite,项目名称:woo-poly-integration,代码行数:11,代码来源:Attributes.php
示例17: translateOrderShippingMethod
/**
* Translate shipping method title in My Account page, Order Emails and Paypal requests.
*
* @param string $implode Comma separated string of shipping methods used in order
* @param WC_Order $instance Order instance
*
* @return string Comma separated string of translated shipping methods' titles
*/
public function translateOrderShippingMethod($implode, $instance)
{
// Convert the imploded array again to an array that is easy to manipulate
$shipping_methods = explode(', ', $implode);
// Array with translated shipping methods
$translated = array();
foreach ($shipping_methods as $shipping) {
if (function_exists('pll__')) {
$translated[] = pll__($shipping);
} else {
$translated[] = __($shipping, 'woocommerce');
}
}
// Implode array to string again
$translated_implode = implode(', ', $translated);
return $translated_implode;
}
开发者ID:hyyan,项目名称:woo-poly-integration,代码行数:25,代码来源:Shipping.php
示例18: translate_strings_recursive
protected function translate_strings_recursive($strings, $values)
{
foreach ($values as $name => $value) {
if (isset($strings[$name])) {
// allow numeric values to be translated
// https://wordpress.org/support/topic/wpml-configxml-strings-skipped-when-numbers-ids
if ((is_numeric($value) || is_string($value)) && $strings[$name] == 1) {
$values[$name] = pll__($value);
} elseif (is_array($value) && is_array($strings[$name])) {
$values[$name] = $this->translate_strings_recursive($strings[$name], $value);
}
}
}
return $values;
}
开发者ID:joostrijneveld,项目名称:cscircles-wp-content,代码行数:15,代码来源:wpml-config.php
示例19: 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;
}
}
开发者ID:johnmanlove,项目名称:Bridgeland,代码行数:32,代码来源:events-manager.php
示例20: west_header_text
/**
* Header text
*/
function west_header_text()
{
if (!function_exists('pll_register_string')) {
$header_text = get_theme_mod('header_text', 'TIME TO GO WEST');
$button_left = get_theme_mod('button_left', 'Explore');
$button_right = get_theme_mod('button_right', 'Browse');
} else {
$header_text = pll__(get_theme_mod('header_text', 'TIME TO GO WEST'));
$button_left = pll__(get_theme_mod('button_left', 'Explore'));
$button_right = pll__(get_theme_mod('button_right', 'Browse'));
}
$button_left_url = get_theme_mod('button_left_url', '#primary');
$button_right_url = get_theme_mod('button_right_url', '#primary');
echo '<div class="header-info">
<div class="header-info-inner">
<h3 class="header-text">' . wp_kses_post($header_text) . '</h3>
<div class="header-buttons">';
if ($button_left_url) {
echo '<a class="button header-button left-button" href="' . esc_url($button_left_url) . '">' . esc_html($button_left) . '</a>';
}
if ($button_right_url) {
echo '<a class="button header-button right-button" href="' . esc_url($button_right_url) . '">' . esc_html($button_right) . '</a>';
}
echo '</div>';
echo '</div>';
echo '</div>';
}
开发者ID:neruub,项目名称:onetonclub,代码行数:30,代码来源:functions.php
注:本文中的pll__函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论