<!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>[12205] sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers: gp-translation-helpers: Update from Github</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/12205">12205</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/12205","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>akirk</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2022-11-04 11:01:38 +0000 (Fri, 04 Nov 2022)</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'>gp-translation-helpers: Update from Github

Changes: 
- Show dropdown of glossary words extracted from the original https://github.com/GlotPress/gp-translation-helpers/pull/118
- Show the feedback form open by default https://github.com/GlotPress/gp-translation-helpers/pull/133
- Fix email sending bug https://github.com/GlotPress/gp-translation-helpers/pull/139
- Add the status of the translation in the discussion https://github.com/GlotPress/gp-translation-helpers/pull/104
- Hide new comment form https://github.com/GlotPress/gp-translation-helpers/pull/112
- Remove locale-projects template override https://github.com/GlotPress/gp-translation-helpers/pull/115</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelperscssdiscussioncss">sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/css/discussion.css</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelpershelpershelpertranslationdiscussionphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/helpers/helper-translation-discussion.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelpershelpersassetstemplatestranslationdiscussioncommentsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/helpers-assets/templates/translation-discussion-comments.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelpersincludesclassgpnotificationsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/includes/class-gp-notifications.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelpersincludesclassgptranslationhelpersphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/includes/class-gp-translation-helpers.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelpersjsrejectfeedbackjs">sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/js/reject-feedback.js</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelperstemplatestranslationroweditormetafeedbackphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/templates/translation-row-editor-meta-feedback.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelperstemplatesgptemplatesoverrideslocaleprojectsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/templates/gp-templates-overrides/locale-projects.php</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelpers">sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<span class="cx" style="display: block; padding: 0 10px">Index: sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers
</span><span class="cx" style="display: block; padding: 0 10px">===================================================================
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers      2022-11-04 08:58:38 UTC (rev 12204)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers       2022-11-04 11:01:38 UTC (rev 12205)
</ins><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelpers"></a>
<div class="propset"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Property changes: sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnignore"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: svn:ignore</h4></div>
<span class="cx" style="display: block; padding: 0 10px"> tmp
</span><span class="cx" style="display: block; padding: 0 10px"> phpunit.xml.dist
</span><span class="cx" style="display: block; padding: 0 10px"> tests
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+bin
</ins><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelperscssdiscussioncss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/css/discussion.css</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/gp-translation-helpers/css/discussion.css        2022-11-04 08:58:38 UTC (rev 12204)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/css/discussion.css  2022-11-04 11:01:38 UTC (rev 12205)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -228,6 +228,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">        height: 110px;
</span><span class="cx" style="display: block; padding: 0 10px">        font-size: 1.1em;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.feedback-comment .note {
+       font-size: 0.8rem;
+       font-weight: normal;
+       display: inline-block;
+       margin-bottom: 1rem;
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> .status-actions details {
</span><span class="cx" style="display: block; padding: 0 10px">        margin-bottom: 5px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,3 +270,46 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .bulk-comment-item{
</span><span class="cx" style="display: block; padding: 0 10px">        font-size: .8em;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.hide-textarea {
+       border: #dfe3e3 thin solid;
+       border-radius: 5px;
+       width: fit-content;
+}
+.hide-textarea summary {
+       padding: 5px 10px;
+       background-color: var(--gp-color-btn-primary-bg);
+       border-color: var(--gp-color-btn-primary-border);
+       color: var(--gp-color-btn-primary-text);
+       border-radius: 2px;
+       width: max-content;
+       font-size: 14px;
+       line-height: 20px;
+       font-weight: 500;
+       cursor: pointer;
+}
+.hide-textarea summary:hover {
+       background-color: var(--gp-color-btn-primary-hover-bg);
+       border-color: var(--gp-color-btn-primary-hover-border);
+       color: var(--gp-color-btn-primary-hover-text);
+       box-shadow: 0 0 0 1px var(--gp-color-canvas-default),0 0 0 2px var(--gp-color-btn-primary-hover-border);
+}
+h5#reply-title {
+       padding-left: 13px;
+}
+ul#glossary-item-list {
+    list-style-type: none;
+       border: #bcc3c3 thin solid;
+    padding: 10px;
+    border-radius: 3px;
+    background: #f2f2f2;
+}
+ul#glossary-item-list h6 {
+       margin-top: 3px;
+    margin-bottom: 8px
+}
+ul#glossary-item-list li label {
+    margin-left: 5px;
+}
+#glossary-item-list li label input[type="checkbox"].glossary-word-item {
+    margin-right: 5px;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelpershelpershelpertranslationdiscussionphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/helpers/helper-translation-discussion.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/gp-translation-helpers/helpers/helper-translation-discussion.php 2022-11-04 08:58:38 UTC (rev 12204)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/helpers/helper-translation-discussion.php   2022-11-04 11:01:38 UTC (rev 12205)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -166,6 +166,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                register_meta(
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        'translation_status',
+                       array(
+                               'description'       => 'Translation status as at when the comment was made',
+                               'single'            => true,
+                               'show_in_rest'      => true,
+                               'sanitize_callback' => array( $this, 'sanitize_comment_translation_status' ),
+                               'rewrite'           => false,
+                       )
+               );
+
+               register_meta(
+                       'comment',
</ins><span class="cx" style="display: block; padding: 0 10px">                         'comment_topic',
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'description'       => 'Reason for the comment',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -549,8 +561,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                remove_action( 'comment_form_top', 'rosetta_comment_form_support_hint' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post = self::maybe_get_temporary_post( self::get_shadow_post_id( $this->data['original_id'] ) );
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post   = self::maybe_get_temporary_post( self::get_shadow_post_id( $this->data['original_id'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $output = gp_tmpl_get_output(
</span><span class="cx" style="display: block; padding: 0 10px">                        'translation-discussion-comments',
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -562,7 +573,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'original_id'          => $this->data['original_id'],
</span><span class="cx" style="display: block; padding: 0 10px">                                'project'              => $this->data['project'],
</span><span class="cx" style="display: block; padding: 0 10px">                                'translation_set_slug' => $this->data['translation_set_slug'],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px">                         ),
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->assets_dir . 'templates'
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -668,6 +678,26 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Sets the translation_status meta_key as "unknown" if is not in the accepted values.
+        *
+        * Used as sanitize callback in the register_meta for the "comment" object type,
+        * 'translation_status' meta_key
+        *
+        * @since 0.0.2
+        *
+        * @param string $translation_status The meta_value for the meta_key "translation_status".
+        *
+        * @return string
+        */
+       public function sanitize_translation_status( string $translation_status ): string {
+               if ( ! in_array( $translation_status, array( 'approved', 'rejected', 'waiting', 'current', 'fuzzy', 'changesrequested' ), true ) ) {
+                       $translation_status = 'unknown';
+               }
+               return $translation_status;
+
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * The comment reply link override.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param      string  $link     The link.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -863,6 +893,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $comment_reason = get_comment_meta( $comment->comment_ID, 'reject_reason', true );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        $_translation_status = get_comment_meta( $comment->comment_ID, 'translation_status', true );
+
</ins><span class="cx" style="display: block; padding: 0 10px">         $classes = array( 'comment-locale-' . $comment_locale );
</span><span class="cx" style="display: block; padding: 0 10px">        if ( ! empty( $comment_reason ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $classes[] = 'rejection-feedback';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -994,7 +1026,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( ! $is_linking_comment ) :
</span><span class="cx" style="display: block; padding: 0 10px">                                if ( $comment_translation_id && $comment_translation_id !== $current_translation_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        gth_print_translation( $comment_translation_id, $args, 'Translation: ' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 $translation_status = '';
+                                       if ( $_translation_status ) {
+                                               $translation_status = ' (' . $_translation_status . ')';
+                                       }
+                                       gth_print_translation( $comment_translation_id, $args, 'Translation' . $translation_status . ': ' );
</ins><span class="cx" style="display: block; padding: 0 10px">                                 }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                ?>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelpershelpersassetstemplatestranslationdiscussioncommentsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/helpers-assets/templates/translation-discussion-comments.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/gp-translation-helpers/helpers-assets/templates/translation-discussion-comments.php      2022-11-04 08:58:38 UTC (rev 12204)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/helpers-assets/templates/translation-discussion-comments.php        2022-11-04 11:01:38 UTC (rev 12205)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,6 +128,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $post_obj = $post->ID;
</span><span class="cx" style="display: block; padding: 0 10px">                        $_post_id = $post->ID;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                ?>
+
+               <?php if ( $comments ) : ?>
+               <details class="hide-textarea">
+                       <summary>Start a new conversation</summary>
+               <?php endif; ?>
+
+               <?php
</ins><span class="cx" style="display: block; padding: 0 10px">                 comment_form(
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'title_reply'         => __( 'Discuss this string' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -163,10 +171,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px">                echo '</div>';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                ?>
+               
+               <?php if ( $comments ) : ?>
+                       </details>
+               <?php endif; ?>
+               
+                       <?php
</ins><span class="cx" style="display: block; padding: 0 10px">         } else {
</span><span class="cx" style="display: block; padding: 0 10px">                /* translators: Log in URL. */
</span><span class="cx" style="display: block; padding: 0 10px">                echo sprintf( __( 'You have to be <a href="%s">logged in</a> to comment.' ), esc_html( wp_login_url() ) );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px">         ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </div><!-- .discussion-wrapper -->
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelpersincludesclassgpnotificationsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/includes/class-gp-notifications.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/gp-translation-helpers/includes/class-gp-notifications.php       2022-11-04 08:58:38 UTC (rev 12204)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/includes/class-gp-notifications.php 2022-11-04 11:01:38 UTC (rev 12205)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -118,7 +118,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                if ( false === $translator ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $translator = get_user_by( 'id', $translation->user_id_last_modified );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( false === $translator ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( $translator ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         self::send_emails( $comment, $comment_meta, array( $translator->user_email ) );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelpersincludesclassgptranslationhelpersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/includes/class-gp-translation-helpers.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/gp-translation-helpers/includes/class-gp-translation-helpers.php 2022-11-04 08:58:38 UTC (rev 12204)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/includes/class-gp-translation-helpers.php   2022-11-04 11:01:38 UTC (rev 12205)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -80,7 +80,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                add_filter(
</span><span class="cx" style="display: block; padding: 0 10px">                        'gp_tmpl_load_locations',
</span><span class="cx" style="display: block; padding: 0 10px">                        function( $locations, $template, $args, $template_path ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if ( 'translation-row-editor-meta-status' === $template || 'locale-projects' === $template ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         if ( 'translation-row-editor-meta-status' === $template ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                         array_unshift( $locations, dirname( dirname( __FILE__ ) ) . '/templates/gp-templates-overrides/' );
</span><span class="cx" style="display: block; padding: 0 10px">                                } else {
</span><span class="cx" style="display: block; padding: 0 10px">                                        $locations[] = dirname( dirname( __FILE__ ) ) . '/templates/';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -412,6 +412,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $helper_discussion    = new Helper_Translation_Discussion();
</span><span class="cx" style="display: block; padding: 0 10px">                $locale_slug          = $helper_discussion->sanitize_comment_locale( sanitize_text_field( $_POST['data']['locale_slug'] ) );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $translation_status   = $helper_discussion->sanitize_translation_status( sanitize_text_field( $_POST['data']['translation_status'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $translation_id_array = ! empty( $_POST['data']['translation_id'] ) ? array_map( array( $helper_discussion, 'sanitize_translation_id' ), $_POST['data']['translation_id'] ) : null;
</span><span class="cx" style="display: block; padding: 0 10px">                $original_id_array    = ! empty( $_POST['data']['original_id'] ) ? array_map( array( $helper_discussion, 'sanitize_original_id' ), $_POST['data']['original_id'] ) : null;
</span><span class="cx" style="display: block; padding: 0 10px">                $comment_reason       = ! empty( $_POST['data']['reason'] ) ? $_POST['data']['reason'] : array( 'other' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -442,13 +443,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $first_translation_id = array_shift( $translation_id_array );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Post comment on discussion page for the first string
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $first_comment_id = $this->insert_comment( $comment, $first_original_id, $comment_reason, $first_translation_id, $locale_slug, $_SERVER );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $first_comment_id = $this->insert_comment( $comment, $first_original_id, $comment_reason, $first_translation_id, $locale_slug, $_SERVER, $translation_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( ! empty( $original_id_array ) && ! empty( $translation_id_array ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        // For other strings post link to the comment.
</span><span class="cx" style="display: block; padding: 0 10px">                        $comment = get_comment_link( $first_comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">                        foreach ( $original_id_array as $index => $single_original_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $comment_id = $this->insert_comment( $comment, $single_original_id, $comment_reason, $translation_id_array[ $index ], $locale_slug, $_SERVER );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $comment_id = $this->insert_comment( $comment, $single_original_id, $comment_reason, $translation_id_array[ $index ], $locale_slug, $_SERVER, $translation_status );
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $comment    = get_comment( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">                                GP_Notifications::add_related_comment( $comment );
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -506,7 +507,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @return false|int
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 0.0.2
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        private function insert_comment( $comment, $original_id, $reason, $translation_id, $locale_slug, $server ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private function insert_comment( $comment, $original_id, $reason, $translation_id, $locale_slug, $server, $translation_status ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 $post_id = Helper_Translation_Discussion::get_or_create_shadow_post_id( $original_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $user    = wp_get_current_user();
</span><span class="cx" style="display: block; padding: 0 10px">                return wp_insert_comment(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -520,9 +521,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_agent'        => sanitize_text_field( $server['HTTP_USER_AGENT'] ),
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_id'              => $user->ID,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_meta'         => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        'reject_reason'  => $reason,
-                                       'translation_id' => $translation_id,
-                                       'locale'         => $locale_slug,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 'reject_reason'      => $reason,
+                                       'translation_id'     => $translation_id,
+                                       'locale'             => $locale_slug,
+                                       'translation_status' => $translation_status,
</ins><span class="cx" style="display: block; padding: 0 10px">                                 ),
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelpersjsrejectfeedbackjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/js/reject-feedback.js</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/gp-translation-helpers/js/reject-feedback.js     2022-11-04 08:58:38 UTC (rev 12204)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/js/reject-feedback.js       2022-11-04 11:01:38 UTC (rev 12205)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,13 +8,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        var modalFeedbackForm =
</span><span class="cx" style="display: block; padding: 0 10px">                        '<div id="reject-feedback-form" style="display:none;">' +
</span><span class="cx" style="display: block; padding: 0 10px">                        '<form>' +
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        '<h3>Reason</h3>' +
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 '<h3>Type (Optional)</h3>' +
</ins><span class="cx" style="display: block; padding: 0 10px">                         getReasonList() +
</span><span class="cx" style="display: block; padding: 0 10px">                        '<div class="modal-comment">' +
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        '<label>Comment </label>' +
-                                       '<textarea name="modal_feedback_comment"></textarea>' +
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 '<h3><label for="modal_feedback_comment">Comment (Optional)</label></h3>' +
+                                       '<textarea id="modal_feedback_comment" name="modal_feedback_comment"></textarea>' +
</ins><span class="cx" style="display: block; padding: 0 10px">                         '</div>' +
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        '<button id="modal-reject-btn" class="modal-btn gp-btn-style">Reject</button>' +
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 '<button id="modal-reject-btn" class="modal-btn gp-btn-style">Reject without Feedback</button>' +
</ins><span class="cx" style="display: block; padding: 0 10px">                         '<button id="modal-requestchanges-btn" class="modal-btn gp-btn-style" style="display: none;" class="modal-btn">Request changes</button>' +
</span><span class="cx" style="display: block; padding: 0 10px">                        '</form>' +
</span><span class="cx" style="display: block; padding: 0 10px">                        '</div>';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,38 +24,44 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        // Remove click event added to <summary> by wporg-gp-customizations plugin
</span><span class="cx" style="display: block; padding: 0 10px">                        $( $gp.editor.table ).off( 'click', 'summary' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $( '#bulk-actions-toolbar-top .button, #bulk-actions-toolbar-bottom .button' ).click( function( e ) {
-                               rowIds = $( 'input:checked', $( 'table#translations th.checkbox' ) ).map( function() {
-                                       var selectedRow = $( this ).parents( 'tr.preview' );
-                                       if ( ! selectedRow.hasClass( 'untranslated' ) ) {
-                                               return selectedRow.attr( 'row' );
-                                       }
-                                       $( this ).prop( 'checked', false );
-                                       return null;
-                               } ).get();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $( '#bulk-actions-toolbar-top .button, #bulk-actions-toolbar-bottom .button' ).click(
+                               function( e ) {
+                                       rowIds = $( 'input:checked', $( 'table#translations th.checkbox' ) ).map(
+                                               function() {
+                                                       var selectedRow = $( this ).parents( 'tr.preview' );
+                                                       if ( ! selectedRow.hasClass( 'untranslated' ) ) {
+                                                               return selectedRow.attr( 'row' );
+                                                       }
+                                                       $( this ).prop( 'checked', false );
+                                                       return null;
+                                               }
+                                       ).get();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                rowIds.forEach( function( rowId ) {
-                                       var originalId = $gp.editor.original_id_from_row_id( rowId );
-                                       var translationId = $gp.editor.translation_id_from_row_id( rowId );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 rowIds.forEach(
+                                               function( rowId ) {
+                                                       var originalId = $gp.editor.original_id_from_row_id( rowId );
+                                                       var translationId = $gp.editor.translation_id_from_row_id( rowId );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if ( originalId && translationId ) {
-                                               originalIds.push( originalId );
-                                               translationIds.push( translationId );
-                                       }
-                               } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                 if ( originalId && translationId ) {
+                                                               originalIds.push( originalId );
+                                                               translationIds.push( translationId );
+                                                       }
+                                               }
+                                       );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if ( $( 'select[name="bulk[action]"]' ).val() === 'reject' ) {
-                                       e.preventDefault();
-                                       e.stopImmediatePropagation();
-                                       if ( ! translationIds.length ) {
-                                               $( 'form.filters-toolbar.bulk-actions, form#bulk-actions-toolbar-top' ).submit();
-                                               return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if ( $( 'select[name="bulk[action]"]' ).val() === 'reject' ) {
+                                               e.preventDefault();
+                                               e.stopImmediatePropagation();
+                                               if ( ! translationIds.length ) {
+                                                       $( 'form.filters-toolbar.bulk-actions, form#bulk-actions-toolbar-top' ).submit();
+                                                       return;
+                                               }
+
+                                               // eslint-disable-next-line no-undef
+                                               tb_show( 'Reject with Feedback', '#TB_inline?inlineId=reject-feedback-form' );
</ins><span class="cx" style="display: block; padding: 0 10px">                                         }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-                                       // eslint-disable-next-line no-undef
-                                       tb_show( 'Reject with Feedback', '#TB_inline?inlineId=reject-feedback-form' );
</del><span class="cx" style="display: block; padding: 0 10px">                                 }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        /**
</span><span class="cx" style="display: block; padding: 0 10px">                         * Changes the value for the rejected status in the top toolbar to "changes requested"
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,41 +77,51 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $( 'body' ).on( 'click', '#modal-reject-btn, #modal-requestchanges-btn', function( e ) {
-                               var comment = '';
-                               var commentReason = [];
-                               var commentData = {};
-                               var form = $( this ).closest( 'form' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $( 'body' ).on(
+                               'click',
+                               '#modal-reject-btn, #modal-requestchanges-btn',
+                               function( e ) {
+                                       var comment = '';
+                                       var commentReason = [];
+                                       var commentData = {};
+                                       var form = $( this ).closest( 'form' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                form.find( 'input[name="modal_feedback_reason"]:checked' ).each(
-                                       function() {
-                                               commentReason.push( this.value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 form.find( 'input[name="modal_feedback_reason"]:checked' ).each(
+                                               function() {
+                                                       commentReason.push( this.value );
+                                               }
+                                       );
+
+                                       comment = form.find( 'textarea[name="modal_feedback_comment"]' ).val();
+                                       updateBulkRejectStatus( $( this ) );
+                                       if ( ( ! comment.trim().length && ! commentReason.length ) || ( ! translationIds.length || ! originalIds.length ) ) {
+                                               $( 'form.filters-toolbar.bulk-actions, form#bulk-actions-toolbar-top' ).submit();
</ins><span class="cx" style="display: block; padding: 0 10px">                                         }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                );
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                comment = form.find( 'textarea[name="modal_feedback_comment"]' ).val();
-                               updateBulkRejectStatus( $( this ) );
-                               if ( ( ! comment.trim().length && ! commentReason.length ) || ( ! translationIds.length || ! originalIds.length ) ) {
-                                       $( 'form.filters-toolbar.bulk-actions, form#bulk-actions-toolbar-top' ).submit();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 commentData.locale_slug = $gp_comment_feedback_settings.locale_slug;
+                                       commentData.reason = commentReason;
+                                       commentData.comment = comment;
+                                       commentData.original_id = originalIds;
+                                       commentData.translation_id = translationIds;
+                                       commentData.is_bulk_reject = true;
+                                       commentWithFeedback( commentData, false, 'rejected' );
+                                       e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px">                                 }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                commentData.locale_slug = $gp_comment_feedback_settings.locale_slug;
-                               commentData.reason = commentReason;
-                               commentData.comment = comment;
-                               commentData.original_id = originalIds;
-                               commentData.translation_id = translationIds;
-                               commentData.is_bulk_reject = true;
-                               commentWithFeedback( commentData, false, 'rejected' );
-                               e.preventDefault();
-                       } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $( '.feedback-reason-list' ).on(
+                               'click',
+                               function( e ) {
+                                       toggleButtons( $( this ), e );
+                               }
+                       );
+                       $( '.feedback-comment' ).on(
+                               'input',
+                               function( e ) {
+                                       toggleButtons( $( this ), e );
+                               }
+                       );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $( '.feedback-reason-list' ).on( 'click', function( e ) {
-                               toggleButtons( $( this ), e );
-                       } );
-                       $( '.feedback-comment' ).on( 'input', function( e ) {
-                               toggleButtons( $( this ), e );
-                       } );
-
</del><span class="cx" style="display: block; padding: 0 10px">                         /**
</span><span class="cx" style="display: block; padding: 0 10px">                         * Hide and show one of each two buttons in the individual rejection: "Reject" and "Request changes".
</span><span class="cx" style="display: block; padding: 0 10px">                         *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,12 +150,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                event.stopImmediatePropagation();
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $( '.modal-item' ).on( 'click', function( e ) {
-                               toggleModalButtons( $( this ), e );
-                       } );
-                       $( 'textarea[name="modal_feedback_comment"]' ).on( 'input', function( e ) {
-                               toggleModalButtons( $( this ), e );
-                       } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $( '.modal-item' ).on(
+                               'click',
+                               function( e ) {
+                                       toggleModalButtons( $( this ), e );
+                               }
+                       );
+                       $( 'textarea[name="modal_feedback_comment"]' ).on(
+                               'input',
+                               function( e ) {
+                                       toggleModalButtons( $( this ), e );
+                               }
+                       );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        /**
</span><span class="cx" style="display: block; padding: 0 10px">                         * Hide and show one of each two buttons in the reject modal: "Reject" and "Request changes".
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,9 +191,53 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                event.stopImmediatePropagation();
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $( '.tooltip' ).tooltip( {
-                               tooltipClass: 'hoverTooltip',
-                       } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $( '.tooltip' ).tooltip(
+                               {
+                                       tooltipClass: 'hoverTooltip',
+                               }
+                       );
+
+                       $( 'input[name="feedback_reason"][value="glossary"]' ).change(
+                               function() {
+                                       var glossaryWords = $( this ).closest( 'tr' ).find( '.original .glossary-word' ).get().map( function( word ) {
+                                               return word.innerText;
+                                       } );
+                                       if ( $( this ).is( ':checked' ) && glossaryWords.length ) {
+                                               // eslint-disable-next-line vars-on-top
+                                               var glossaryList = document.createElement( 'ul' );
+                                               glossaryList.innerHTML = '<h6>Glossary Words</h6>';
+                                               $( glossaryList ).attr( 'id', 'glossary-item-list' );
+                                               glossaryWords.forEach(
+                                                       function( item ) {
+                                                               var li = document.createElement( 'li' );
+                                                               var checkbox = $( '<input />', { type: 'checkbox', class: 'glossary-word-item', value: item } );
+                                                               $( '<label></label>' ).html( checkbox ).append( item ).appendTo( li );
+                                                               glossaryList.appendChild( li );
+                                                       }
+                                               );
+                                               $( this ).closest( 'ul' ).after( glossaryList );
+                                       } else {
+                                               $( '#glossary-item-list' ).remove();
+                                               $( this ).closest( '.feedback-reason-list' ).siblings( '.feedback-comment' ).find( 'textarea' ).val( '' );
+                                       }
+                               }
+                       );
+
+                       $( 'body' ).on(
+                               'change',
+                               'input.glossary-word-item', function( ) {
+                                       var textArea = $( this ).closest( 'ul' ).next().find( 'textarea' );
+                                       if ( $( this ).closest( 'ul' ).find( 'input:checked' ).length === 0 ) {
+                                               textArea.val( '' );
+                                               return;
+                                       }
+                                       // eslint-disable-next-line vars-on-top
+                                       var message = 'There is a problem with ' + ( $( this ).closest( 'ul' ).find( 'input:checked' ).length === 1 ? 'the glossary term' : 'the following glossary terms' ) + ': ' + $( this ).closest( 'ul' ).find( 'input:checked' ).get().map( function( word ) {
+                                               return word.defaultValue;
+                                       } ).join( ', ' );
+
+                                       textArea.val( message );
+                               } );
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px">        );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -216,6 +282,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                feedbackData.comment = comment;
</span><span class="cx" style="display: block; padding: 0 10px">                feedbackData.original_id = [ $gp.editor.current.original_id ];
</span><span class="cx" style="display: block; padding: 0 10px">                feedbackData.translation_id = [ $gp.editor.current.translation_id ];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                feedbackData.translation_status = status;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                commentWithFeedback( feedbackData, button, status );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelperstemplatesgptemplatesoverrideslocaleprojectsphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/templates/gp-templates-overrides/locale-projects.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/gp-translation-helpers/templates/gp-templates-overrides/locale-projects.php      2022-11-04 08:58:38 UTC (rev 12204)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/templates/gp-templates-overrides/locale-projects.php        2022-11-04 11:01:38 UTC (rev 12205)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,318 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-/**
- * This template overrides the default local-projects template so we can add a link to "Discussions" dashboard.
- *
- * Todo: Remove this template override and add customizations directly in wporg-gp-customizations plugin.
- */
-
-/* translators: %s: locale */
-gp_title( sprintf( __( 'Projects translated to %s &lt; GlotPress' ), esc_html( $locale->english_name ) ) );
-
-$breadcrumb   = array();
-$breadcrumb[] = gp_link_get( '/', __( 'Locales' ) );
-$breadcrumb[] = gp_link_get( gp_url_join( '/locale', $locale_slug, $set_slug ), esc_html( $locale->english_name ) );
-$breadcrumb[] = esc_html( $project->name );
-gp_breadcrumb( $breadcrumb );
-gp_tmpl_header();
-?>
-
-<div class="locale-header">
-       <p class="locale-intro">Translate WordPress, core projects, plugins, and themes into your language. Select your project below to get started.</p>
-
-       <div class="locale-box">
-               <ul class="name">
-                       <li class="english"><?php echo esc_html( $locale->english_name ); ?></li>
-                       <li class="native"><?php echo esc_html( $locale->native_name ); ?></li>
-                       <li class="code">
-                               <?php
-                               echo esc_html( $locale->wp_locale );
-
-                               if ( count( $variants ) > 1 ) {
-                                       ?>
-                                       <select id="variant-selector" name="variant">
-                                               <?php
-                                               foreach ( $variants as $variant ) {
-                                                       $selected =
-                                                       printf(
-                                                               '<option name="%s" data-project-url="%s"%s>%s</option>',
-                                                               $variant,
-                                                               esc_url( gp_url_join( '/locale', $locale_slug, $variant, $project->slug ) ),
-                                                               ( $set_slug == $variant ) ? ' selected="selected"' : '',
-                                                               esc_html( ucfirst( $variant ) )
-                                                       );
-                                               }
-                                               ?>
-                                       </select>
-                                       <?php
-                               }
-                               ?>
-                       </li>
-                       <?php if ( $locale_glossary ) : ?>
-                               <li class="locale-glossary">
-                                       <a href="<?php echo esc_url( gp_url_join( gp_url( '/locale' ), $locale_slug, $set_slug, 'glossary' ) ); ?>" class="glossary-link"><?php _e( 'Locale Glossary', 'glotpress' ); ?></a>
-                               </li>
-                       <?php elseif ( $can_create_locale_glossary ) : ?>
-                               <li class="locale-glossary">
-                                       <a href="<?php echo esc_url( gp_url_join( gp_url( '/locale' ), $locale_slug, $set_slug, 'glossary' ) ); ?>" class="glossary-link"><?php _e( 'Create Locale Glossary', 'glotpress' ); ?></a>
-                               </li>
-                       <?php endif; ?>
-               </ul>
-               <div class="contributors">
-                       <?php
-                       $contributors = sprintf(
-                               '<span class="dashicons dashicons-admin-users"></span><br />%s',
-                               isset( $contributors_count[ $locale->slug ] ) ? $contributors_count[ $locale->slug ] : 0
-                       );
-                       echo gp_link_get( 'https://make.wordpress.org/polyglots/teams/?locale=' . $locale->wp_locale, $contributors );
-                       ?>
-               </div>
-       </div>
-</div>
-
-<div class="filter-header">
-       <ul class="filter-header-links">
-               <?php
-               foreach ( $top_level_projects as $top_level_project ) {
-                       printf(
-                               '<li><a href="%s"%s>%s</a></li>',
-                               esc_url( gp_url_join( '/locale', $locale_slug, $set_slug, $top_level_project->slug ) ),
-                               ( $top_level_project->path == $project_path ) ? ' class="current"' : '',
-                               esc_html( $top_level_project->name )
-                       );
-               }
-               ?>
-               <li class="filter-header-link__sep" aria-hidden="true">|</li>
-               <li class="has-children">
-                       <a href="#">Stats</a>
-                       <ul>
-                               <li><a href="<?php echo esc_url( gp_url_join( '/locale', $locale_slug, $set_slug, 'stats', 'plugins' ) ); ?>">Plugins</a></li>
-                               <li><a href="<?php echo esc_url( gp_url_join( '/locale', $locale_slug, $set_slug, 'stats', 'themes' ) ); ?>">Themes</a></li>
-                       </ul>
-               </li>
-       <?php
-       /**
-        * Apply same logic that show the waiting tab to the discussions tab,
-        * so that this tab is only visible to global admins and GTEs/PTEs.
-        *
-        * Todo: Modify this logic mentioned above so that here can use something like $is_admin_or_gte?
-        */
-       if ( is_user_logged_in() && 'waiting' === $default_project_tab ) :
-               ?>
-               <li><a href="<?php echo esc_url( gp_url_join( '/locale', $locale_slug, $set_slug, 'discussions' ) ); ?>">Discussions</a></li>
-       <?php endif ?>
-               </ul>
-       <div class="search-form">
-               <form>
-                       <label class="screen-reader-text" for="projects-filter"><?php esc_attr_e( 'Search projects...' ); ?></label>
-                       <input placeholder="<?php esc_attr_e( 'Search projects...' ); ?>" type="search" id="projects-filter" name="s" value="
-                                                                                                 <?php
-                                                                                                       if ( ! empty( $search ) ) {
-                                                                                                               echo esc_attr( $search ); }
-                                                                                                       ?>
-                       " class="filter-search">
-                       <input type="submit" value="<?php esc_attr_e( 'Search' ); ?>" class="screen-reader-text" />
-               </form>
-       </div>
-</div>
-<div class="sort-bar">
-       <form id="sort-filter" action="" method="GET">
-               <input type="hidden" name="s" value="<?php echo esc_attr( $search ?? '' ); ?>"
-               <input type="hidden" name="page" value="1">
-
-               <?php
-               $filter_count = 0;
-
-               if ( 'waiting' === $project->slug && is_user_logged_in() ) {
-                       $filter_count++;
-                       ?>
-                       <input id="filter-without-editors" type="checkbox" name="without-editors" value="1"<?php checked( isset( $_GET['without-editors'] ) ); ?>>
-                       <label for="filter-without-editors">Limit to projects without editors</label>
-                       <span class="filter-sep" aria-hidden="true">|</span>
-                       <?php
-               }
-               ?>
-
-               <?php
-               $filter_count++;
-               ?>
-               <label for="filter">Filter:</label>
-               <select id="filter" name="filter">
-                       <?php
-                               $sorts = array();
-                       if ( is_user_logged_in() && in_array( $project->slug, array( 'waiting', 'wp-themes', 'wp-plugins' ) ) ) {
-                               $sorts['special']   = 'Untranslated Favorites, Remaining Strings (Most first)';
-                               $sorts['favorites'] = 'My Favorites';
-                       }
-                               $sorts['strings-remaining']                              = 'Remaining Strings (Most first)';
-                               $sorts['strings-remaining-asc']                          = 'Remaining Strings (Least first)';
-                               $sorts['strings-waiting-and-fuzzy']                      = 'Waiting + Fuzzy (Most first)';
-                               $sorts['strings-waiting-and-fuzzy-asc']                  = 'Waiting + Fuzzy (Least first)';
-                               $sorts['strings-waiting-and-fuzzy-by-modified-date']     = 'Waiting + Fuzzy (Newest first)';
-                               $sorts['strings-waiting-and-fuzzy-by-modified-date-asc'] = 'Waiting + Fuzzy (Oldest first)';
-                               $sorts['percent-completed']                              = 'Percent Completed (Most first)';
-                               $sorts['percent-completed-asc']                          = 'Percent Completed (Least first)';
-
-                               // Completed project filter, except on the 'waiting' project.
-                       if ( 'waiting' !== $project->slug ) {
-                               $sorts['completed-asc'] = '100% Translations';
-                       }
-
-                       foreach ( $sorts as $value => $text ) {
-                               printf( '<option value="%s" %s>%s</option>', esc_attr( $value ), ( $value == $filter ? 'selected="selected"' : '' ), esc_attr( $text ) );
-                       }
-                       ?>
-               </select>
-
-               <button type="submit"><?php echo ( 1 === $filter_count ? 'Apply Filter' : 'Apply Filters' ); ?></button>
-       </form>
-</div>
-<div id="projects" class="projects">
-       <?php
-       foreach ( $sub_projects as $sub_project ) {
-               $percent_complete = $waiting = $sub_projects_count = $fuzzy = $remaining = 0;
-               if ( isset( $project_status[ $sub_project->id ] ) ) {
-                       $status_of_project  = $project_status[ $sub_project->id ];
-                       $percent_complete   = $status_of_project->percent_complete;
-                       $waiting            = $status_of_project->waiting_count;
-                       $fuzzy              = $status_of_project->fuzzy_count;
-                       $remaining          = $status_of_project->all_count - $status_of_project->current_count;
-                       $sub_projects_count = $status_of_project->sub_projects_count;
-               }
-
-               // Link directly to the Waiting strings if we're in the Waiting view, otherwise link to the project overview
-               if ( 'waiting' == $project->slug ) {
-                       // TODO: Since we're matching parent projects, we can't link to them as they have no direct translation sets.
-                       // $project_url = gp_url_join( '/projects', $sub_project->path, $locale_slug, $set_slug ) . '?filters[status]=waiting_or_fuzzy';
-                       $project_url = gp_url_join( '/locale', $locale_slug, $set_slug, $sub_project->path );
-
-                       $project_name      = $sub_project->name;
-                       $parent_project_id = $sub_project->parent_project_id;
-                       while ( $parent_project_id ) {
-                               $parent_project    = GP::$project->get( $parent_project_id );
-                               $parent_project_id = $parent_project->parent_project_id;
-                               $project_name      = "{$parent_project->name} - {$project_name}";
-                       }
-               } else {
-                       $project_url  = gp_url_join( '/locale', $locale_slug, $set_slug, $sub_project->path );
-                       $project_name = $sub_project->name;
-               }
-
-               $project_icon = '';
-               if ( isset( $project_icons[ $sub_project->id ] ) ) {
-                       $project_icon = $project_icons[ $sub_project->id ];
-               }
-
-               $classes  = 'project-' . sanitize_title_with_dashes( str_replace( '/', '-', $project->path ) );
-               $classes .= ' project-' . sanitize_title_with_dashes( str_replace( '/', '-', $sub_project->path ) );
-               $classes .= ' percent-' . $percent_complete;
-               ?>
-               <div class="project <?php echo esc_attr( $classes ); ?>">
-                       <div class="project-top">
-                               <div class="project-icon">
-                                       <?php echo gp_link_get( $project_url, $project_icon ); ?>
-                               </div>
-
-                               <div class="project-name">
-                                       <h4>
-                                               <?php echo gp_link_get( $project_url, $project_name ); ?>
-                                       </h4>
-                               </div>
-                               <div class="project-description">
-                                       <p>
-                                       <?php
-                                               $description = wp_strip_all_tags( $sub_project->description );
-                                               $description = str_replace( array( 'WordPress.org Plugin Page', 'WordPress.org Theme Page' ), '', $description );
-                                               echo esc_html( wp_trim_words( $description, 30 ) );
-                                       ?>
-                                       </p>
-                               </div>
-                       </div>
-
-                       <div class="project-status">
-                               <div class="project-status-sub-projects">
-                                       <span class="project-status-title">Projects</span>
-                                       <span class="project-status-value"><?php echo number_format_i18n( $sub_projects_count ); ?></span>
-                               </div>
-                               <div class="project-status-waiting">
-                                       <span class="project-status-title">Waiting/Fuzzy</span>
-                                       <span class="project-status-value"><?php echo number_format_i18n( $waiting + $fuzzy ); ?></span>
-                               </div>
-                               <div class="project-status-remaining">
-                                       <span class="project-status-title">Remaining</span>
-                                       <span class="project-status-value"><?php echo number_format_i18n( $remaining ); ?></span>
-                               </div>
-                               <div class="project-status-progress">
-                                       <span class="project-status-title">Progress</span>
-                                       <span class="project-status-value"><?php echo number_format_i18n( $percent_complete ); ?>%</span>
-                               </div>
-                       </div>
-
-                       <div class="percent">
-                               <div class="percent-complete" style="width:<?php echo esc_attr( $percent_complete ); ?>%;"></div>
-                       </div>
-
-                       <div class="project-bottom">
-                               <?php echo gp_link_get( $project_url, 'Translate Project', array( 'class' => 'button contribute-button' ) ); ?>
-                       </div>
-               </div>
-               <?php
-       }
-       if ( ! $sub_projects ) {
-               if ( 'waiting' === $project->slug ) {
-                       echo '<div class="no-projects-found">No projects with strings awaiting approval!</div>';
-               } else {
-                       echo '<div class="no-projects-found">No projects found.</div>';
-               }
-       }
-       ?>
-</div>
-<?php
-if ( isset( $pages ) && $pages['pages'] > 1 ) {
-       echo gp_pagination( $pages['page'], $pages['per_page'], $pages['results'] );
-}
-?>
-
-<script>
-       jQuery( document ).ready( function( $ ) {
-               // Don't filter if there's an existing search term, or if we're paginated
-               // Fall back to a full page reload for those cases.
-               var live_filtering_enabled = ( ! $( '#projects-filter' ).val() && ! $( '.paging' ).length );
-               $rows = $( '#projects' ).find( '.project' );
-               $( '#projects-filter' ).on( 'input keyup', function() {
-                       if ( ! live_filtering_enabled ) {
-                               return;
-                       }
-
-                       var words = this.value.toLowerCase().split( ' ' );
-
-                       if ( '' === this.value.trim() ) {
-                               $rows.show();
-                       } else {
-                               $rows.hide();
-                               $rows.filter( function( i, v ) {
-                                       var $t = $(this).find( '.project-top' );
-                                       for ( var d = 0; d < words.length; ++d ) {
-                                               if ( $t.text().toLowerCase().indexOf( words[d] ) != -1 ) {
-                                                       return true;
-                                               }
-                                       }
-                                       return false;
-                               }).show();
-                       }
-               });
-
-               $( '#variant-selector' ).on( 'change', function( event ) {
-                       event.preventDefault();
-
-                       var $optionSelected = $( 'option:selected', this ),
-                               projectUrl = $optionSelected.data( 'projectUrl' );
-
-                       if ( projectUrl.length ) {
-                               window.location = projectUrl;
-                       }
-               });
-       });
-</script>
-
-<?php
-gp_tmpl_footer();
</del></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsgptranslationhelperstemplatestranslationroweditormetafeedbackphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/templates/translation-row-editor-meta-feedback.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/gp-translation-helpers/templates/translation-row-editor-meta-feedback.php        2022-11-04 08:58:38 UTC (rev 12204)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/templates/translation-row-editor-meta-feedback.php  2022-11-04 11:01:38 UTC (rev 12205)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,7 +1,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( ! $can_approve_translation || ! $translation->translation_status ) {
</span><span class="cx" style="display: block; padding: 0 10px">        return;
</span><span class="cx" style="display: block; padding: 0 10px"> }  ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<details>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<details open>
</ins><span class="cx" style="display: block; padding: 0 10px">         <summary class="feedback-summary"><?php esc_html_e( 'Give feedback', 'glotpress' ); ?></summary>
</span><span class="cx" style="display: block; padding: 0 10px">        <div id="feedback-form">
</span><span class="cx" style="display: block; padding: 0 10px">                <form>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,6 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                <label><?php esc_html_e( 'Comment (Optional)', 'glotpress' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px">                                        <textarea name="feedback_comment"></textarea>
</span><span class="cx" style="display: block; padding: 0 10px">                                </label>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                <label class="note">Please note that all feedback is visible to the public.</label>
</ins><span class="cx" style="display: block; padding: 0 10px">                         </div>
</span><span class="cx" style="display: block; padding: 0 10px">                </form>
</span><span class="cx" style="display: block; padding: 0 10px">        </div>
</span></span></pre>
</div>
</div>

</body>
</html>