示例#1
0
 function test_gp_parity_factory()
 {
     $gen = gp_parity_factory();
     $concurrent = gp_parity_factory();
     $this->assertEquals("even", $gen());
     $this->assertEquals("even", $concurrent());
     $this->assertEquals("odd", $gen());
     $this->assertEquals("even", $gen());
     $this->assertEquals("odd", $concurrent());
     $this->assertEquals("even", $concurrent());
     $this->assertEquals("odd", $gen());
     $this->assertEquals("odd", $concurrent());
 }
示例#2
0
<?php

gp_title(sprintf(__('Translations &lt; %s &lt; %s &lt; GlotPress'), $translation_set->name, $project->name));
gp_breadcrumb(array(gp_project_links_from_root($project), gp_link_get($url, $translation_set->name)));
wp_enqueue_script('jquery-ui');
wp_enqueue_script('editor');
wp_enqueue_script('translations-page');
wp_localize_script('translations-page', '$gp_translations_options', array('sort' => __('Sort'), 'filter' => __('Filter')));
// localizer adds var in front of the variable name, so we can't use $gp.editor.options
$editor_options = compact('can_approve', 'can_write', 'url', 'discard_warning_url', 'set_priority_url', 'set_status_url');
wp_localize_script('editor', '$gp_editor_options', $editor_options);
$parity = gp_parity_factory();
add_action('gp_head', function () use($locale) {
    return gp_preferred_sans_serif_style_tag($locale);
});
gp_tmpl_header();
$i = 0;
?>
<h2>
	<?php 
printf(__("Translation of %s"), esc_html($project->name));
?>
: <?php 
echo esc_html($translation_set->name);
?>
	<?php 
gp_link_set_edit($translation_set, $project, __('(edit)'));
?>
	<?php 
if ($glossary) {
    ?>