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


PHP SitePress::get_display_language_name方法代码示例

本文整理汇总了PHP中SitePress::get_display_language_name方法的典型用法代码示例。如果您正苦于以下问题:PHP SitePress::get_display_language_name方法的具体用法?PHP SitePress::get_display_language_name怎么用?PHP SitePress::get_display_language_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SitePress的用法示例。


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

示例1: sprintf

    function translation_queue_after_display()
    {
        $export_label = esc_html__('Export all jobs:', 'wpml-translation-management');
        if (isset($_SESSION['translation_ujobs_filter'])) {
            if (!empty($_SESSION['translation_ujobs_filter']['type'])) {
                $post_slug = preg_replace('/^post_/', '', $_SESSION['translation_ujobs_filter']['type'], 1);
                $post_type = get_post_type_object($post_slug);
                $type = $post_type->label;
            } else {
                $type = __('All types', 'wpml-translation-management');
            }
            $from = !empty($_SESSION['translation_ujobs_filter']['from']) ? $this->sitepress->get_display_language_name($_SESSION['translation_ujobs_filter']['from']) : __('Any language', 'wpml-translation-management');
            $to = !empty($_SESSION['translation_ujobs_filter']['to']) ? $this->sitepress->get_display_language_name($_SESSION['translation_ujobs_filter']['to']) : __('Any language', 'wpml-translation-management');
            $status = !empty($_SESSION['translation_ujobs_filter']['status']) && (int) $_SESSION['translation_ujobs_filter']['status'] !== ICL_TM_WAITING_FOR_TRANSLATOR ? TranslationManagement::status2text($_SESSION['translation_ujobs_filter']['status']) : (!empty($_SESSION['translation_ujobs_filter']['status']) ? __('Available to translate', 'wpml-translation-management') : 'All statuses');
            $export_label = sprintf(esc_html__('Export all filtered jobs of %1$s from %2$s to %3$s in %4$s:', 'wpml-translation-management'), '<b>' . $type . '</b>', '<b>' . $from . '</b>', '<b>' . $to . '</b>', '<b>' . $status . '</b>');
        }
        ?>

		<br />
		<table class="widefat">
			<thead><tr><th><?php 
        esc_html_e('Import / Export XLIFF', 'wpml-translation-management');
        ?>
</th></tr></thead>
			<tbody><tr><td>
				<form method="post" id="translation-xliff-export-all-filtered" action="">
					<label for="wpml_xliff_export_all_filtered"><?php 
        echo $export_label;
        ?>
</label>
					<select name="xliff_version" class="select"><?php 
        echo $this->get_xliff_version_select_options();
        ?>
</select>
					<input type="submit" value="<?php 
        esc_attr_e('Export', 'wpml-translation-management');
        ?>
" name="wpml_xliff_export_all_filtered" id="xliff_download" class="button-secondary action" />
					<input type="hidden" value="<?php 
        echo wp_create_nonce('xliff-export-all-filtered');
        ?>
" name="nonce">
				</form>
				<hr>
				<form enctype="multipart/form-data" method="post" id="translation-xliff-upload" action="">
					<label for="upload-xliff-file"><?php 
        _e('Select the xliff file or zip file to upload from your computer:&nbsp;', 'wpml-translation-management');
        ?>
</label>
					<input type="file" id="upload-xliff-file" name="import" /><input type="submit" value="<?php 
        _e('Upload', 'wpml-translation-management');
        ?>
" name="xliff_upload" id="xliff_upload" class="button-secondary action" />
				</form>
			</td></tr></tbody>
		</table>
		<?php 
    }
开发者ID:studiopengpeng,项目名称:ASCOMETAL,代码行数:58,代码来源:class-wpml-tm-xliff-frontend.php


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