<!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>[49151] trunk: I18N: Use `wp.i18n` for translatable strings in `wp-admin/js/dashboard.js`.</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="https://core.trac.wordpress.org/changeset/49151">49151</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/49151","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>2020-10-14 21:11:09 +0000 (Wed, 14 Oct 2020)</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'>I18N: Use `wp.i18n` for translatable strings in `wp-admin/js/dashboard.js`.
* Deprecate the `l10n` property on `communityEventsData`.
* Introduce `version` parameter for `deprecateL10nObject` and backfill the version for deprecated objects in 5.5.0.
* Add a noop version of `deprecateL10nObject` for QUnit testing.
Fixes <a href="https://core.trac.wordpress.org/ticket/51498">#51498</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcjs_enqueuesadmincommonjs">trunk/src/js/_enqueues/admin/common.js</a></li>
<li><a href="#trunksrcjs_enqueuesadminwidgetsjs">trunk/src/js/_enqueues/admin/widgets.js</a></li>
<li><a href="#trunksrcjs_enqueueswpdashboardjs">trunk/src/js/_enqueues/wp/dashboard.js</a></li>
<li><a href="#trunksrcjs_enqueueswpthemeplugineditorjs">trunk/src/js/_enqueues/wp/theme-plugin-editor.js</a></li>
<li><a href="#trunksrcjs_enqueueswpupdatesjs">trunk/src/js/_enqueues/wp/updates.js</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
<li><a href="#trunktestsqunitindexhtml">trunk/tests/qunit/index.html</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunktestsqunitfixturescommonjs">trunk/tests/qunit/fixtures/common.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcjs_enqueuesadmincommonjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/admin/common.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/admin/common.js 2020-10-14 20:25:17 UTC (rev 49150)
+++ trunk/src/js/_enqueues/admin/common.js 2020-10-14 21:11:09 UTC (rev 49151)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,13 +55,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Deprecate all properties on an object.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.5.1
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 5.6.0 Added the `version` parameter.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {string} name The name of the object, i.e. commonL10n.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {object} l10nObject The object to deprecate the properties on.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param {string} version The version of WordPress that deprecated the property.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return {object} The object with all its properties deprecated.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function deprecateL10nObject( name, l10nObject ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function deprecateL10nObject( name, l10nObject, version ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var deprecatedObject = {};
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> Object.keys( l10nObject ).forEach( function( key ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,12 +72,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'object' === typeof prop ) {
</span><span class="cx" style="display: block; padding: 0 10px"> Object.defineProperty( deprecatedObject, key, { get: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- deprecatedProperty( propName, '5.5.0', prop.alternative );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ deprecatedProperty( propName, version, prop.alternative );
</ins><span class="cx" style="display: block; padding: 0 10px"> return prop.func();
</span><span class="cx" style="display: block; padding: 0 10px"> } } );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> Object.defineProperty( deprecatedObject, key, { get: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- deprecatedProperty( propName, '5.5.0', 'wp.i18n' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ deprecatedProperty( propName, version, 'wp.i18n' );
</ins><span class="cx" style="display: block; padding: 0 10px"> return prop;
</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">@@ -99,7 +101,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> expandMenu: ''
</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">-window.commonL10n = deprecateL10nObject( 'commonL10n', window.commonL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.commonL10n = deprecateL10nObject( 'commonL10n', window.commonL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,7 +113,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> dismiss: ''
</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">-window.wpPointerL10n = deprecateL10nObject( 'wpPointerL10n', window.wpPointerL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.wpPointerL10n = deprecateL10nObject( 'wpPointerL10n', window.wpPointerL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,7 +131,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ariaHide: ''
</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">-window.userProfileL10n = deprecateL10nObject( 'userProfileL10n', window.userProfileL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.userProfileL10n = deprecateL10nObject( 'userProfileL10n', window.userProfileL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,7 +150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> exportError: ''
</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">-window.privacyToolsL10n = deprecateL10nObject( 'privacyToolsL10n', window.privacyToolsL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.privacyToolsL10n = deprecateL10nObject( 'privacyToolsL10n', window.privacyToolsL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,7 +162,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> beforeunload: ''
</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">-window.authcheckL10n = window.authcheckL10n || deprecateL10nObject( 'authcheckL10n', window.authcheckL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.authcheckL10n = window.authcheckL10n || deprecateL10nObject( 'authcheckL10n', window.authcheckL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -173,7 +175,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> broken: ''
</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">-window.tagsl10n = window.tagsl10n || deprecateL10nObject( 'tagsl10n', window.tagsl10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.tagsl10n = window.tagsl10n || deprecateL10nObject( 'tagsl10n', window.tagsl10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,7 +200,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> docTitleCommentsCount: ''
</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">-window.adminCommentsL10n = deprecateL10nObject( 'adminCommentsL10n', window.adminCommentsL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.adminCommentsL10n = deprecateL10nObject( 'adminCommentsL10n', window.adminCommentsL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -214,7 +216,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> termRemoved: ''
</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">-window.tagsSuggestL10n = deprecateL10nObject( 'tagsSuggestL10n', window.tagsSuggestL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.tagsSuggestL10n = deprecateL10nObject( 'tagsSuggestL10n', window.tagsSuggestL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -231,7 +233,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> defaultLabel: ''
</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">-window.wpColorPickerL10n = deprecateL10nObject( 'wpColorPickerL10n', window.wpColorPickerL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.wpColorPickerL10n = deprecateL10nObject( 'wpColorPickerL10n', window.wpColorPickerL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,7 +245,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> error: ''
</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">-window.attachMediaBoxL10n = deprecateL10nObject( 'attachMediaBoxL10n', window.attachMediaBoxL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.attachMediaBoxL10n = deprecateL10nObject( 'attachMediaBoxL10n', window.attachMediaBoxL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -276,7 +278,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> permalinkSaved: ''
</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">-window.postL10n = deprecateL10nObject( 'postL10n', window.postL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.postL10n = deprecateL10nObject( 'postL10n', window.postL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,7 +294,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> saved: ''
</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">-window.inlineEditL10n = deprecateL10nObject( 'inlineEditL10n', window.inlineEditL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.inlineEditL10n = deprecateL10nObject( 'inlineEditL10n', window.inlineEditL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -306,7 +308,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ays: ''
</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">-window.plugininstallL10n = deprecateL10nObject( 'plugininstallL10n', window.plugininstallL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.plugininstallL10n = deprecateL10nObject( 'plugininstallL10n', window.plugininstallL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -321,7 +323,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> untitled: ''
</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">-window.navMenuL10n = deprecateL10nObject( 'navMenuL10n', window.navMenuL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.navMenuL10n = deprecateL10nObject( 'navMenuL10n', window.navMenuL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -334,7 +336,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> dateFormat: ''
</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">-window.commentL10n = deprecateL10nObject( 'commentL10n', window.commentL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.commentL10n = deprecateL10nObject( 'commentL10n', window.commentL10n, '5.5.0' );
</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"> * Removed in 5.5.0, needed for back-compatibility.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -349,7 +351,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> done: ''
</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">-window.setPostThumbnailL10n = deprecateL10nObject( 'setPostThumbnailL10n', window.setPostThumbnailL10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.setPostThumbnailL10n = deprecateL10nObject( 'setPostThumbnailL10n', window.setPostThumbnailL10n, '5.5.0' );
</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"> * Removed in 3.3.0, needed for back-compatibility.
</span></span></pre></div>
<a id="trunksrcjs_enqueuesadminwidgetsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/admin/widgets.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/admin/widgets.js 2020-10-14 20:25:17 UTC (rev 49150)
+++ trunk/src/js/_enqueues/admin/widgets.js 2020-10-14 21:11:09 UTC (rev 49151)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -760,4 +760,4 @@
</span><span class="cx" style="display: block; padding: 0 10px"> widgetAdded: ''
</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">-wpWidgets.l10n = window.wp.deprecateL10nObject( 'wpWidgets.l10n', wpWidgets.l10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+wpWidgets.l10n = window.wp.deprecateL10nObject( 'wpWidgets.l10n', wpWidgets.l10n, '5.5.0' );
</ins></span></pre></div>
<a id="trunksrcjs_enqueueswpdashboardjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/wp/dashboard.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/wp/dashboard.js 2020-10-14 20:25:17 UTC (rev 49150)
+++ trunk/src/js/_enqueues/wp/dashboard.js 2020-10-14 21:11:09 UTC (rev 49151)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,6 +5,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* global pagenow, ajaxurl, postboxes, wpActiveEditor:true, ajaxWidgets */
</span><span class="cx" style="display: block; padding: 0 10px"> /* global ajaxPopulateWidgets, quickPressLoad, */
</span><span class="cx" style="display: block; padding: 0 10px"> window.wp = window.wp || {};
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.communityEventsData = window.communityEventsData || {};
</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"> * Initializes the dashboard widget functionality.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -265,7 +266,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> jQuery( function( $ ) {
</span><span class="cx" style="display: block; padding: 0 10px"> 'use strict';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var communityEventsData = window.communityEventsData || {},
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var communityEventsData = window.communityEventsData,
</ins><span class="cx" style="display: block; padding: 0 10px"> dateI18n = wp.date.dateI18n,
</span><span class="cx" style="display: block; padding: 0 10px"> format = wp.date.format,
</span><span class="cx" style="display: block; padding: 0 10px"> sprintf = wp.i18n.sprintf,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -466,7 +467,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> renderEventsTemplate: function( templateParams, initiatedBy ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var template,
</span><span class="cx" style="display: block; padding: 0 10px"> elementVisibility,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- l10nPlaceholder = /%(?:\d\$)?s/g, // Match `%s`, `%1$s`, `%2$s`, etc.
</del><span class="cx" style="display: block; padding: 0 10px"> $toggleButton = $( '.community-events-toggle-location' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $locationMessage = $( '#community-events-location-message' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $( '.community-events-results' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -505,7 +505,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * If the API determined the location by geolocating an IP, it will
</span><span class="cx" style="display: block; padding: 0 10px"> * provide events, but not a specific location.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $locationMessage.text( communityEventsData.l10n.attend_event_near_generic );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $locationMessage.text( __( 'Attend an upcoming event near you.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( templateParams.events.length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> template = wp.template( 'community-events-event-list' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -532,7 +532,14 @@
</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"> if ( 'user' === initiatedBy ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp.a11y.speak( communityEventsData.l10n.city_updated.replace( l10nPlaceholder, templateParams.location.description ), 'assertive' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp.a11y.speak(
+ sprintf(
+ /* translators: %s: The name of a city. */
+ __( 'City updated. Listing events near %s.' ),
+ templateParams.location.description
+ ),
+ 'assertive'
+ );
</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"> elementVisibility['#community-events-location-message'] = true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -542,7 +549,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else if ( templateParams.unknownCity ) {
</span><span class="cx" style="display: block; padding: 0 10px"> template = wp.template( 'community-events-could-not-locate' );
</span><span class="cx" style="display: block; padding: 0 10px"> $( '.community-events-could-not-locate' ).html( template( templateParams ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp.a11y.speak( communityEventsData.l10n.could_not_locate_city.replace( l10nPlaceholder, templateParams.unknownCity ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp.a11y.speak(
+ sprintf(
+ /*
+ * These specific examples were chosen to highlight the fact that a
+ * state is not needed, even for cities whose name is not unique.
+ * It would be too cumbersome to include that in the instructions
+ * to the user, so it's left as an implication.
+ */
+ /*
+ * translators: %s is the name of the city we couldn't locate.
+ * Replace the examples with cities related to your locale. Test that
+ * they match the expected location and have upcoming events before
+ * including them. If no cities related to your locale have events,
+ * then use cities related to your locale that would be recognizable
+ * to most users. Use only the city name itself, without any region
+ * or country. Use the endonym (native locale name) instead of the
+ * English name if possible.
+ */
+ __( 'We couldn’t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.' ),
+ templateParams.unknownCity
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> elementVisibility['.community-events-errors'] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> elementVisibility['.community-events-could-not-locate'] = true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -554,12 +582,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Showing error messages for an event that user isn't aware of
</span><span class="cx" style="display: block; padding: 0 10px"> * could be confusing or unnecessarily distracting.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp.a11y.speak( communityEventsData.l10n.error_occurred_please_try_again );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp.a11y.speak( __( 'An error occurred. Please try again.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> elementVisibility['.community-events-errors'] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> elementVisibility['.community-events-error-occurred'] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $locationMessage.text( communityEventsData.l10n.enter_closest_city );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $locationMessage.text( __( 'Enter your closest city to find nearby events.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> elementVisibility['#community-events-location-message'] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> elementVisibility['.community-events-toggle-location'] = true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -791,3 +819,21 @@
</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">+
+/**
+ * Removed in 5.6.0, needed for back-compatibility.
+ *
+ * @since 4.8.0
+ * @deprecated 5.6.0
+ *
+ * @type {object}
+*/
+window.communityEventsData.l10n = window.communityEventsData.l10n || {
+ enter_closest_city: '',
+ error_occurred_please_try_again: '',
+ attend_event_near_generic: '',
+ could_not_locate_city: '',
+ city_updated: ''
+};
+
+window.communityEventsData.l10n = window.wp.deprecateL10nObject( 'communityEventsData.l10n', window.communityEventsData.l10n, '5.6.0' );
</ins></span></pre></div>
<a id="trunksrcjs_enqueueswpthemeplugineditorjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/wp/theme-plugin-editor.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/wp/theme-plugin-editor.js 2020-10-14 20:25:17 UTC (rev 49150)
+++ trunk/src/js/_enqueues/wp/theme-plugin-editor.js 2020-10-14 21:11:09 UTC (rev 49151)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1023,4 +1023,4 @@
</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">-wp.themePluginEditor.l10n = window.wp.deprecateL10nObject( 'wp.themePluginEditor.l10n', wp.themePluginEditor.l10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+wp.themePluginEditor.l10n = window.wp.deprecateL10nObject( 'wp.themePluginEditor.l10n', wp.themePluginEditor.l10n, '5.5.0' );
</ins></span></pre></div>
<a id="trunksrcjs_enqueueswpupdatesjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/wp/updates.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/wp/updates.js 2020-10-14 20:25:17 UTC (rev 49150)
+++ trunk/src/js/_enqueues/wp/updates.js 2020-10-14 21:11:09 UTC (rev 49151)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,7 +115,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> autoUpdatesError: ''
</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">- wp.updates.l10n = window.wp.deprecateL10nObject( 'wp.updates.l10n', wp.updates.l10n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp.updates.l10n = window.wp.deprecateL10nObject( 'wp.updates.l10n', wp.updates.l10n, '5.5.0' );
</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"> * User nonce for ajax calls.
</span></span></pre></div>
<a id="trunksrcwpincludesscriptloaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/script-loader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/script-loader.php 2020-10-14 20:25:17 UTC (rev 49150)
+++ trunk/src/wp-includes/script-loader.php 2020-10-14 21:11:09 UTC (rev 49151)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1757,34 +1757,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'nonce' => wp_create_nonce( 'community_events' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'cache' => $events_client->get_cached_events(),
</span><span class="cx" style="display: block; padding: 0 10px"> 'time_format' => get_option( 'time_format' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- 'l10n' => array(
- 'enter_closest_city' => __( 'Enter your closest city to find nearby events.' ),
- 'error_occurred_please_try_again' => __( 'An error occurred. Please try again.' ),
- 'attend_event_near_generic' => __( 'Attend an upcoming event near you.' ),
-
- /*
- * These specific examples were chosen to highlight the fact that a
- * state is not needed, even for cities whose name is not unique.
- * It would be too cumbersome to include that in the instructions
- * to the user, so it's left as an implication.
- */
- /*
- * translators: %s is the name of the city we couldn't locate.
- * Replace the examples with cities related to your locale. Test that
- * they match the expected location and have upcoming events before
- * including them. If no cities related to your locale have events,
- * then use cities related to your locale that would be recognizable
- * to most users. Use only the city name itself, without any region
- * or country. Use the endonym (native locale name) instead of the
- * English name if possible.
- */
- 'could_not_locate_city' => __( 'We couldn’t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.' ),
-
- // This one is only used with wp.a11y.speak(), so it can/should be more brief.
- /* translators: %s: The name of a city. */
- 'city_updated' => __( 'City updated. Listing events near %s.' ),
- ),
</del><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="trunktestsqunitfixturescommonjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/qunit/fixtures/common.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/qunit/fixtures/common.js (rev 0)
+++ trunk/tests/qunit/fixtures/common.js 2020-10-14 21:11:09 UTC (rev 49151)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,10 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Mock the deprecateL10nObject() for tests.
+ *
+ * deprecateL10nObject() is part of wp-admin/js/common.js which requires
+ * some HTML markup to exist. Instead of adding all the markup this adds
+ * a noop version of deprecateL10nObject(). This makes it possible
+ * to test wp-admin/js/dashboard.js.
+ */
+window.wp = window.wp || {};
+window.wp.deprecateL10nObject = function () {};
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/qunit/fixtures/common.js
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsqunitindexhtml"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/qunit/index.html</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/qunit/index.html 2020-10-14 20:25:17 UTC (rev 49150)
+++ trunk/tests/qunit/index.html 2020-10-14 21:11:09 UTC (rev 49151)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,6 +82,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <script src="fixtures/wp-api-generated.js"></script>
</span><span class="cx" style="display: block; padding: 0 10px"> <script src="fixtures/js-widgets-endpoint.js"></script>
</span><span class="cx" style="display: block; padding: 0 10px"> <script src="fixtures/wp-api.js"></script>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <script src="fixtures/common.js"></script>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- Tested files -->
</span></span></pre>
</div>
</div>
</body>
</html>