<!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>[8937] sites/trunk/wordpress.org/public_html/wp-content/plugins: Translate: Send approved translations to translation memory.</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/8937">8937</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/8937","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-06-10 14:45:10 +0000 (Mon, 10 Jun 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: Send approved translations to translation memory.

Props yoavf, ocean90.
See <a href="http://meta.trac.wordpress.org/ticket/4430">#4430</a>.</pre>

<h3>Modified 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_htmlwpcontentpluginswporggpplugindirectoryinccliclasssyncplugintranslationsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/cli/class-sync-plugin-translations.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationsuggestionsincclasspluginphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/inc/class-plugin.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationsuggestionsincclasstranslationmemoryclientphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/inc/class-translation-memory-client.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationsuggestionsjstranslationsuggestionsjs">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/js/translation-suggestions.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplatestranslationroweditorphp"></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/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     2019-06-07 17:33:11 UTC (rev 8936)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-editor.php       2019-06-10 14:45:10 UTC (rev 8937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                </button>
</span><span class="cx" style="display: block; padding: 0 10px">                                                <div class="button-menu">
</span><span class="cx" style="display: block; padding: 0 10px">                                                        <button type="button" class="button-menu__toggle with-tooltip" aria-label="Show contextual links">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                                <span class="screen-reader-text">Links</span><span aria-hidden="true" class="dashicons dashicons-paperclip"></span>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                         <span class="screen-reader-text">Links</span><span aria-hidden="true" class="dashicons dashicons-menu-alt"></span>
</ins><span class="cx" style="display: block; padding: 0 10px">                                                         </button>
</span><span class="cx" style="display: block; padding: 0 10px">                                                        <ul class="button-menu__dropdown">
</span><span class="cx" style="display: block; padding: 0 10px">                                                                <?php foreach ( $more_links as $link ) : ?>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpplugindirectoryinccliclasssyncplugintranslationsphp"></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/wporg-gp-plugin-directory/inc/cli/class-sync-plugin-translations.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-plugin-directory/inc/cli/class-sync-plugin-translations.php     2019-06-07 17:33:11 UTC (rev 8936)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/cli/class-sync-plugin-translations.php       2019-06-10 14:45:10 UTC (rev 8937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Sync_Plugin_Translations extends WP_CLI_Command {
</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">-         * Delete a plugin project and its translations.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * Sync plugin translations.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * ## OPTIONS
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationsuggestionsincclasspluginphp"></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/wporg-gp-translation-suggestions/inc/class-plugin.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-translation-suggestions/inc/class-plugin.php    2019-06-07 17:33:11 UTC (rev 8936)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/inc/class-plugin.php      2019-06-10 14:45:10 UTC (rev 8937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,15 +4,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> use GP;
</span><span class="cx" style="display: block; padding: 0 10px"> use GP_Locales;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-use Text_Diff;
-use WP_Error;
-use WP_Http;
-use WP_Text_Diff_Renderer_inline;
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-require_once ABSPATH . '/wp-includes/wp-diff.php' ;
-
</del><span class="cx" style="display: block; padding: 0 10px"> class Plugin {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        const TM_UPDATE_EVENT = 'wporg_translate_tm_update';
+
</ins><span class="cx" style="display: block; padding: 0 10px">         /**
</span><span class="cx" style="display: block; padding: 0 10px">         * @var Plugin The singleton instance.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,6 +15,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">        private static $instance;
</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">+         * @var array
+        */
+       private $queue = [];
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Returns always the same instance of this plugin.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @return Plugin
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,9 +45,47 @@
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'template_redirect', [ $this, 'register_routes' ], 5 );
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'gp_pre_tmpl_load', [ $this, 'pre_tmpl_load' ], 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'wporg_translate_suggestions', [ $this, 'extend_translation_suggestions' ] );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+               if ( 'cli' !== PHP_SAPI ) {
+                       add_action( 'gp_translation_created', [ $this, 'translation_updated' ], 3 );
+                       add_action( 'gp_translation_saved', [ $this, 'translation_updated' ], 3 );
+
+                       // DB Writes are delayed until shutdown to bulk-update the stats during imports.
+                       add_action( 'shutdown', [ $this, 'schedule_tm_update' ], 3 );
+               }
+
+               add_action( self::TM_UPDATE_EVENT, [ Translation_Memory_Client::class, 'update' ] );
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Adds a translation in queue when a translation was created
+        * or updated.
+        *
+        * @param \GP_Translation $translation Created/updated translation.
+        */
+       public function translation_updated( $translation ) {
+               if ( ! $translation->user_id || 'current' !== $translation->status ) {
+                       return;
+               }
+
+               $this->queue[ $translation->original_id ] = $translation->id;
+       }
+
+       /**
+        * Schedules a single event to update translation memory for new translations.
+        */
+       public function schedule_tm_update() {
+               remove_action( 'gp_translation_created', [ $this, 'translation_updated' ], 3 );
+               remove_action( 'gp_translation_saved', [ $this, 'translation_updated' ], 3 );
+
+               if ( ! $this->queue ) {
+                       return;
+               }
+
+               wp_schedule_single_event( time() + 60, self::TM_UPDATE_EVENT, [ 'translations' => $this->queue ] );
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Registers custom routes.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function register_routes() {
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationsuggestionsincclasstranslationmemoryclientphp"></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/wporg-gp-translation-suggestions/inc/class-translation-memory-client.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-translation-suggestions/inc/class-translation-memory-client.php 2019-06-07 17:33:11 UTC (rev 8936)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/inc/class-translation-memory-client.php   2019-06-10 14:45:10 UTC (rev 8937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2,18 +2,93 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> namespace WordPressdotorg\GlotPress\TranslationSuggestions;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use GP;
</ins><span class="cx" style="display: block; padding: 0 10px"> use Text_Diff;
</span><span class="cx" style="display: block; padding: 0 10px"> use WP_Error;
</span><span class="cx" style="display: block; padding: 0 10px"> use WP_Http;
</span><span class="cx" style="display: block; padding: 0 10px"> use WP_Text_Diff_Renderer_inline;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-require_once ABSPATH . '/wp-includes/wp-diff.php' ;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+require_once ABSPATH . '/wp-includes/wp-diff.php';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> class Translation_Memory_Client {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        const API_ENDPOINT = 'https://translate.wordpress.com/api/tm/';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        const API_BULK_ENDPOINT = 'https://translate.wordpress.com/api/tm/-bulk';
</ins><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">+         * Updates translation memory with new strings.
+        *
+        * @param array $translations  List of translation IDs, keyed by original ID.
+        * @return true|\WP_Error True on success, WP_Error on failure.
+        */
+       public static function update( array $translations ) {
+               $requests = [];
+
+               foreach ( $translations as $original_id => $translation_id ) {
+                       $translation = GP::$translation->get( $translation_id );
+
+                       // Check again in case the translation was changed.
+                       if ( 'current' !== $translation->status ) {
+                               continue;
+                       }
+
+                       $original        = GP::$original->get( $original_id );
+                       $translation_set = GP::$translation_set->get( $translation->translation_set_id );
+
+                       $locale = $translation_set->locale;
+                       if ( 'default' !== $translation_set->slug ) {
+                               $locale .= '_' . $translation_set->slug;
+                       }
+
+                       $requests[] = [
+                               'source'       => $original->fields(),
+                               'translations' => [
+                                       [
+                                               'singular' => $translation->translation_0,
+                                               'plural'   => $translation->translation_1,
+                                               'locale'   => $locale,
+                                       ],
+                               ],
+                       ];
+               }
+
+               if ( ! $requests ) {
+                       return new WP_Error( 'no_translations' );
+               }
+
+               $body = wp_json_encode( [
+                       'token'    => WPCOM_TM_TOKEN,
+                       'requests' => $requests,
+               ] );
+
+               $request = wp_remote_post(
+                       self::API_BULK_ENDPOINT,
+                       [
+                               'timeout'    => 10,
+                               'user-agent' => 'WordPress.org Translate',
+                               'body'       => $body,
+                       ]
+               );
+
+               if ( is_wp_error( $request ) ) {
+                       return $request;
+               }
+
+               if ( WP_Http::OK !== wp_remote_retrieve_response_code( $request ) ) {
+                       return new WP_Error( 'response_code_not_ok' );
+               }
+
+               $body   = wp_remote_retrieve_body( $request );
+               $result = json_decode( $body, true );
+
+               if ( JSON_ERROR_NONE !== json_last_error() ) {
+                       return new WP_Error( 'json_parse_error' );
+               }
+
+               return $result ?: new WP_Error( 'unknown_error' );
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Queries translation memory for a string.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param string $text          Text to search translations for.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,7 +96,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @return array|\WP_Error      List of suggestions on success, WP_Error on failure.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public static function query( string $text, string $target_locale ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( ! defined ( 'WPCOM_TM_TOKEN' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! defined( 'WPCOM_TM_TOKEN' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         return new WP_Error( 'no_token' );
</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">@@ -29,13 +104,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'text'   => $text,
</span><span class="cx" style="display: block; padding: 0 10px">                        'target' => $target_locale,
</span><span class="cx" style="display: block; padding: 0 10px">                        'token'  => WPCOM_TM_TOKEN,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                ] ) , self::API_ENDPOINT );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'ts'     => time(),
+               ] ), self::API_ENDPOINT );
</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">                 $request = wp_remote_get(
</span><span class="cx" style="display: block; padding: 0 10px">                        $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">-                                'timeout'     => 2,
-                               'user-agent'  => 'WordPress.org Translate',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         'timeout'    => 2,
+                               'user-agent' => 'WordPress.org Translate',
</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">@@ -81,6 +158,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        protected static function diff( $previous_text, $text ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $diff     = new  Text_Diff( 'auto', [ [ $previous_text ], [ $text ] ] );
</span><span class="cx" style="display: block; padding: 0 10px">                $renderer = new WP_Text_Diff_Renderer_inline();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px">                 return $renderer->render( $diff );
</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_htmlwpcontentpluginswporggptranslationsuggestionsjstranslationsuggestionsjs"></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/wporg-gp-translation-suggestions/js/translation-suggestions.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/wporg-gp-translation-suggestions/js/translation-suggestions.js   2019-06-07 17:33:11 UTC (rev 8936)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/js/translation-suggestions.js     2019-06-10 14:45:10 UTC (rev 8937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,7 +6,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'original': originalId,
</span><span class="cx" style="display: block; padding: 0 10px">                                'nonce': nonce
</span><span class="cx" style="display: block; padding: 0 10px">                        },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        dataType: 'json'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 dataType: 'json',
+                       cache: false,
</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">                xhr.done( function( response ) {
</span></span></pre>
</div>
</div>

</body>
</html>