<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[8386] sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates: Translate: Add templates to start customizing default translation rows.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/8386">8386</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/8386","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>ocean90</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-03-03 16:38:21 +0000 (Sun, 03 Mar 2019)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Translate: Add templates to start customizing default translation rows.</pre>

<h3>Added Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplatestranslationroweditorphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-editor.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplatestranslationrowpreviewphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-preview.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplatestranslationrowphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplatestranslationroweditorphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-editor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-editor.php                             (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-editor.php       2019-03-03 16:38:21 UTC (rev 8386)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,183 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Template for a single translation row editor in a translation set display.
+ */
+
+$user = wp_get_current_user();
+$can_reject_self = ( isset( $t->user->user_login ) && $user->user_login === $t->user->user_login && 'waiting' === $t->translation_status );
+
+$more_links = array();
+if ( $t->translation_status ) {
+       $translation_permalink = gp_url_project_locale( $project, $locale->slug, $translation_set->slug, array( 'filters[status]' => 'either', 'filters[original_id]' => $t->original_id, 'filters[translation_id]' => $t->id ) );
+       $more_links['translation-permalink'] = '<a tabindex="-1" href="' . esc_url( $translation_permalink ) . '">' . __( 'Permalink to this translation', 'glotpress' ) . '</a>';
+} else {
+       $original_permalink = gp_url_project_locale( $project, $locale->slug, $translation_set->slug, array( 'filters[original_id]' => $t->original_id ) );
+       $more_links['original-permalink'] = '<a tabindex="-1" href="' . esc_url( $original_permalink ) . '">' . __( 'Permalink to this original', 'glotpress' ) . '</a>';
+}
+
+$original_history = gp_url_project_locale( $project, $locale->slug, $translation_set->slug, array( 'filters[status]' => 'either', 'filters[original_id]' => $t->original_id, 'sort[by]' => 'translation_date_added', 'sort[how]' => 'asc' ) );
+$more_links['history'] = '<a tabindex="-1" href="' . esc_url( $original_history ) . '">' . __( 'All translations of this original', 'glotpress' ) . '</a>';
+
+/**
+ * Allows to modify the more links in the translation editor.
+ *
+ * @since 2.3.0
+ *
+ * @param array              $more_links      The links to be output.
+ * @param GP_Project         $project         Project object.
+ * @param GP_Locale          $locale          Locale object.
+ * @param GP_Translation_Set $translation_set Translation Set object.
+ * @param GP_Translation     $t               Translation object.
+ */
+$more_links = apply_filters( 'gp_translation_row_template_more_links', $more_links, $project, $locale, $translation_set, $t );
+?>
+<tr class="editor <?php echo gp_translation_row_classes( $t ); ?>" id="editor-<?php echo esc_attr( $t->row_id ); ?>" row="<?php echo esc_attr( $t->row_id ); ?>">
+       <td colspan="<?php echo $can_approve ? 5 : 4 ?>">
+               <div class="strings">
+               <?php
+                       $singular = isset( $t->singular_glossary_markup ) ? $t->singular_glossary_markup : esc_translation( $t->singular );
+                       $plural   = isset( $t->plural_glossary_markup ) ? $t->plural_glossary_markup : esc_translation( $t->plural );
+               ?>
+
+               <?php if ( ! $t->plural ): ?>
+               <p class="original"><?php echo prepare_original( $singular ); ?></p>
+               <?php textareas( $t, array( $can_edit, $can_approve_translation ) ); ?>
+               <?php else: ?>
+                       <?php if ( $locale->nplurals == 2 && $locale->plural_expression == 'n != 1'): ?>
+                               <p><?php printf(__( 'Singular: %s', 'glotpress' ), '<span class="original">'. $singular .'</span>'); ?></p>
+                               <?php textareas( $t, array( $can_edit, $can_approve ), 0 ); ?>
+                               <p class="clear">
+                                       <?php printf(__( 'Plural: %s', 'glotpress' ), '<span class="original">'. $plural .'</span>'); ?>
+                               </p>
+                               <?php textareas( $t, array( $can_edit, $can_approve ), 1 ); ?>
+                       <?php else: ?>
+                               <!--
+                               TODO: labels for each plural textarea and a sample number
+                               -->
+                               <p><?php printf(__( 'Singular: %s', 'glotpress' ), '<span class="original">'. $singular .'</span>'); ?></p>
+                               <p class="clear">
+                                       <?php printf(__( 'Plural: %s', 'glotpress' ), '<span class="original">'. $plural .'</span>'); ?>
+                               </p>
+                               <?php foreach( range( 0, $locale->nplurals - 1 ) as $plural_index ): ?>
+                                       <?php if ( $locale->nplurals > 1 ): ?>
+                                       <p class="plural-numbers"><?php printf(__( 'This plural form is used for numbers like: %s', 'glotpress' ),
+                                                       '<span class="numbers">'.implode(', ', $locale->numbers_for_index( $plural_index ) ).'</span>' ); ?></p>
+                                       <?php endif; ?>
+                                       <?php textareas( $t, array( $can_edit, $can_approve ), $plural_index ); ?>
+                               <?php endforeach; ?>
+                       <?php endif; ?>
+               <?php endif; ?>
+               </div>
+
+               <div class="meta">
+                       <h3><?php _e( 'Meta', 'glotpress' ); ?></h3>
+                       <dl>
+                               <dt><?php _e( 'Status:', 'glotpress' ); ?></dt>
+                               <dd>
+                                       <?php echo display_status( $t->translation_status ); ?>
+                                       <?php if ( $t->translation_status ): ?>
+                                               <?php if ( $can_approve_translation ) : ?>
+                                                       <?php if ( 'current' !== $t->translation_status ) : ?>
+                                                       <button class="approve" tabindex="-1" data-nonce="<?php echo esc_attr( wp_create_nonce( 'update-translation-status-current_' . $t->id ) ); ?>"><strong>+</strong> <?php _e( 'Approve', 'glotpress' ); ?></button>
+                                                       <?php endif; ?>
+                                                       <?php if ( 'rejected' !== $t->translation_status ) : ?>
+                                                       <button class="reject" tabindex="-1" data-nonce="<?php echo esc_attr( wp_create_nonce( 'update-translation-status-rejected_' . $t->id ) ); ?>"><strong>&minus;</strong> <?php _e( 'Reject', 'glotpress' ); ?></button>
+                                                       <?php endif; ?>
+                                                       <?php if ( 'fuzzy' !== $t->translation_status ) : ?>
+                                                       <button class="fuzzy" tabindex="-1" data-nonce="<?php echo esc_attr( wp_create_nonce( 'update-translation-status-fuzzy_' . $t->id ) ); ?>"><strong>~</strong> <?php _e( 'Fuzzy', 'glotpress' ); ?></button>
+                                                       <?php endif; ?>
+                                               <?php elseif ( $can_reject_self ): ?>
+                                                       <button class="reject" tabindex="-1" data-nonce="<?php echo esc_attr( wp_create_nonce( 'update-translation-status-rejected_' . $t->id ) ); ?>"><strong>&minus;</strong> <?php _e( 'Reject Suggestion', 'glotpress' ); ?></button>
+                                                       <button class="fuzzy" tabindex="-1" data-nonce="<?php echo esc_attr( wp_create_nonce( 'update-translation-status-fuzzy_' . $t->id ) ); ?>"><strong>~</strong> <?php _e( 'Fuzzy', 'glotpress' ); ?></button>
+                                               <?php endif; ?>
+                                       <?php endif; ?>
+                               </dd>
+                       </dl>
+                       <!--
+                       <dl>
+                               <dt><?php _e( 'Priority:', 'glotpress' ); ?></dt>
+                               <dd><?php echo esc_html($t->priority); ?></dd>
+                       </dl>
+                       -->
+
+                       <?php if ( $t->context ): ?>
+                       <dl>
+                               <dt><?php _e( 'Context:', 'glotpress' ); ?></dt>
+                               <dd><span class="context bubble"><?php echo esc_translation($t->context); ?></span></dd>
+                       </dl>
+                       <?php endif; ?>
+                       <?php if ( $t->extracted_comments ): ?>
+                       <dl>
+                               <dt><?php _e( 'Comment:', 'glotpress' ); ?></dt>
+                               <dd><?php echo make_clickable( esc_translation($t->extracted_comments) ); ?></dd>
+                       </dl>
+                       <?php endif; ?>
+                       <?php if ( $t->translation_added && $t->translation_added != '0000-00-00 00:00:00' ): ?>
+                       <dl>
+                               <dt><?php _e( 'Date added:', 'glotpress' ); ?></dt>
+                               <dd><?php echo $t->translation_added; ?> GMT</dd>
+                       </dl>
+                       <?php endif; ?>
+                       <?php if ( $t->user ) : ?>
+                       <dl>
+                               <dt><?php _e( 'Translated by:', 'glotpress' ); ?></dt>
+                               <dd><?php gp_link_user( $t->user ); ?></dd>
+                       </dl>
+                       <?php endif; ?>
+                       <?php if ( $t->user_last_modified && ( ! $t->user || $t->user->ID !== $t->user_last_modified->ID ) ) : ?>
+                               <dl>
+                                       <dt><?php
+                                               if ( 'current' === $t->translation_status ) {
+                                                       _e( 'Approved by:', 'glotpress' );
+                                               } elseif ( 'rejected' === $t->translation_status ) {
+                                                       _e( 'Rejected by:', 'glotpress' );
+                                               } else {
+                                                       _e( 'Last updated by:', 'glotpress' );
+                                               }
+                                               ?>
+                                       </dt>
+                                       <dd><?php gp_link_user( $t->user_last_modified ); ?></dd>
+                               </dl>
+                       <?php endif; ?>
+                       <?php references( $project, $t ); ?>
+
+                       <dl>
+                           <dt><?php _e( 'Priority of the original:', 'glotpress' ); ?></dt>
+                       <?php if ( $can_write ): ?>
+                               <dd><?php
+                                       echo gp_select(
+                                               'priority-' . $t->original_id,
+                                               GP::$original->get_static( 'priorities' ),
+                                               $t->priority,
+                                               array(
+                                                       'class'      => 'priority',
+                                                       'tabindex'   => '-1',
+                                                       'data-nonce' => wp_create_nonce( 'set-priority_' . $t->original_id ),
+                                               )
+                                       );
+                                       ?></dd>
+                       <?php else : ?>
+                               <dd><?php echo gp_array_get( GP::$original->get_static( 'priorities' ), $t->priority, 'unknown' ); // WPCS: XSS ok. ?></dd>
+                       <?php endif; ?>
+                       </dl>
+
+                       <dl>
+                           <dt><?php _e( 'More links:', 'glotpress' ); ?>
+                               <ul>
+                                       <?php foreach ( $more_links as $link ) : ?>
+                                               <li><?php echo $link; // WPCS: XSS ok. ?></li>
+                                       <?php endforeach; ?>
+                               </ul>
+                               </dt>
+                       </dl>
+               </div>
+               <div class="actions">
+               <?php if ( $can_edit ): ?>
+                       <button class="ok" data-nonce="<?php echo esc_attr( wp_create_nonce( 'add-translation_' . $t->original_id ) ); ?>">
+                               <?php echo $can_approve_translation ? __( 'Add translation &rarr;', 'glotpress' ) : __( 'Suggest new translation &rarr;', 'glotpress' ); ?>
+                       </button>
+               <?php endif; ?>
+                       <?php _e( 'or', 'glotpress' ); ?> <a href="#" class="close"><?php _e( 'Cancel', 'glotpress' ); ?></a>
+               </div>
+       </td>
+</tr>
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplatestranslationrowpreviewphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-preview.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-preview.php                            (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-preview.php      2019-03-03 16:38:21 UTC (rev 8386)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,64 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Template for a single translation row preview in a translation set display
+ */
+
+$priority_char = array(
+    '-2' => array('&times;', 'transparent', '#ccc'),
+    '-1' => array('&darr;', 'transparent', 'blue'),
+    '0' => array('', 'transparent', 'white'),
+    '1' => array('&uarr;', 'transparent', 'green'),
+);
+?>
+
+<tr class="preview <?php gp_translation_row_classes( $t ); ?>" id="preview-<?php echo esc_attr( $t->row_id ) ?>" row="<?php echo esc_attr( $t->row_id ); ?>">
+       <?php if ( $can_approve_translation ) : ?>
+               <th scope="row" class="checkbox"><input type="checkbox" name="selected-row[]" /></th>
+       <?php elseif ( $can_approve ) : ?>
+               <th scope="row"></th>
+       <?php endif; ?>
+       <td class="priority" title="<?php echo esc_attr( sprintf( __( 'Priority: %s', 'glotpress' ), gp_array_get( GP::$original->get_static( 'priorities' ), $t->priority ) ) ); ?>">
+          <?php echo $priority_char[$t->priority][0] ?>
+       </td>
+       <td class="original">
+               <?php echo prepare_original( esc_translation( $t->singular ) ); ?>
+               <?php if ( $t->context ): ?>
+               <span class="context bubble" title="<?php printf( __( 'Context: %s', 'glotpress' ), esc_html($t->context) ); ?>"><?php echo esc_html($t->context); ?></span>
+               <?php endif; ?>
+
+       </td>
+       <td class="translation foreign-text">
+       <?php
+               if ( $can_edit ) {
+                       $edit_text = __( 'Double-click to add', 'glotpress' );
+               }
+               elseif ( is_user_logged_in() ) {
+                       $edit_text = __( 'You are not allowed to add a translation.', 'glotpress' );
+               }
+               else {
+                       $edit_text = sprintf( __( 'You <a href="%s">have to log in</a> to add a translation.', 'glotpress' ), esc_url( wp_login_url( gp_url_current() ) ) );
+               }
+
+               $missing_text = "<span class='missing'>$edit_text</span>";
+               if ( ! count( array_filter( $t->translations, 'gp_is_not_null' ) ) ) :
+                       echo $missing_text;
+               elseif ( ! $t->plural ) :
+                       echo esc_translation( $t->translations[0] );
+               else: ?>
+               <ul>
+                       <?php
+                               foreach( $t->translations as $translation ):
+                       ?>
+                               <li><?php echo gp_is_empty_string( $translation ) ? $missing_text : esc_translation( $translation ); ?></li>
+                       <?php
+                               endforeach;
+                       ?>
+               </ul>
+       <?php
+               endif;
+       ?>
+       </td>
+       <td class="actions">
+               <a href="#" row="<?php echo $t->row_id; ?>" class="action edit"><?php _e( 'Details', 'glotpress' ); ?></a>
+       </td>
+</tr>
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplatestranslationrowphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row.php                            (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row.php      2019-03-03 16:38:21 UTC (rev 8386)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,7 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Template for a single translation row in a translation set display.
+ */
+
+gp_tmpl_load( 'translation-row-preview', get_defined_vars() );
+gp_tmpl_load( 'translation-row-editor', get_defined_vars() );
</ins></span></pre>
</div>
</div>

</body>
</html>