From d00fef5ca051b36fc7a9920c16bd7036d5e6c8f5 Mon Sep 17 00:00:00 2001 From: Seaton Jiang Date: Tue, 4 Aug 2020 08:14:31 +0800 Subject: [PATCH 1/2] feat: add Simplified Chinese (zh_CN) translations --- languages/plugin-update-checker-zh_CN.mo | Bin 0 -> 1060 bytes languages/plugin-update-checker-zh_CN.po | 48 +++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 languages/plugin-update-checker-zh_CN.mo create mode 100644 languages/plugin-update-checker-zh_CN.po diff --git a/languages/plugin-update-checker-zh_CN.mo b/languages/plugin-update-checker-zh_CN.mo new file mode 100644 index 0000000000000000000000000000000000000000..c0fc4055778c6587af79724223e28c087346aa9c GIT binary patch literal 1060 zcmZ`%&ubGw6dtwyAPS;aMIMD*)QOwWL)aKmV=L8GgH6R-*ls4t+RaRynN3>{62*fR zMWNP~Hd2dJM5GZFQSb+z{TuWm*<1ww1>YuVQz;I7`|W%C-ka}x$($rpPnMb;LKs9*nPTBjgbB4P-!m(uuzy zAIA6x@&V*sJ%nIO>ukj*rU|CV_Ev_F9UTsIwoa~Y8o30^s8X{Jb~$Rq9iS%i%8aV{o!rvYnl0+XP$r9B0`Vbx1?kwMw@3JwSDXqWYz0?sC& z!lZHp2a$)MBCOVm@U{&XZ0b%4&&{D84LPQnEIAwn=GPR1g?iW9TVBE{vRMNf`}az( z3|c_oIzrM?TxGVVgE@M+tqwU4ej?Yl~BE7^aPGE$d!Cn($M$Di_oEm*##LcL2 z#E2V4Xb4y5Sp`Nj%qp1>8Xg?(@6L`!j8IB&&A6tSsWMK{Y*HU9yOzTf!QQ1}Iyssd zpz&^2_bW8$WhvaY&MZ) ziR`2qJsPu-aRUm?1)|-ywh@NR;hcl3f#a$bovdgn92K!e>BRcZOt@amrY>yI!7OPP z)98U3=psb?XH|b`#b12qKYmU8H_Lu)y78dieDtEZaJ!xL=T;hD=YCah5x@4bxwO*# z&}wboeeYLq{`s^JRs{cujn6ZU>HC|f1pWBgpL^=Rooz0!HdYt>`Fi8w^Z%AM7gvKx S^L4*gMRCpPJAUm|Fy=2vaBdI) literal 0 HcmV?d00001 diff --git a/languages/plugin-update-checker-zh_CN.po b/languages/plugin-update-checker-zh_CN.po new file mode 100644 index 0000000..005b4d0 --- /dev/null +++ b/languages/plugin-update-checker-zh_CN.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-08-04 08:10+0800\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.4\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: Seaton Jiang \n" +"Language: zh_CN\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "检查更新" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "%s 目前是最新版本。" + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "%s 当前有可用的更新。" + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "%s 无法确定是否有可用的更新。" + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "未知的更新检查状态:%s" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "没有可用的更新日志。" From 8c4a998c63a76d372df51a7054e940f17abf1998 Mon Sep 17 00:00:00 2001 From: Yahnis Elsts Date: Mon, 10 Aug 2020 22:08:34 +0300 Subject: [PATCH 2/2] Hopefully fixed a fatal error related to Debug Bar Apparently, upgrading a plugin that uses PUC 4.9 to a version that uses PUC 4.10 may trigger two fatal errors, one of which happens inside the Debug Bar extension. Cause is unclear and the errors are not reproduced, but I suspect it has to do with PUC trying to set up a Debug Bar panel after the currently active PUC version has already been replaced. This patch should fix that. --- Puc/v4p9/DebugBar/Extension.php | 9 +++++++++ Puc/v4p9/UpdateChecker.php | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Puc/v4p9/DebugBar/Extension.php b/Puc/v4p9/DebugBar/Extension.php index 9401789..5fad500 100644 --- a/Puc/v4p9/DebugBar/Extension.php +++ b/Puc/v4p9/DebugBar/Extension.php @@ -142,6 +142,15 @@ if ( !class_exists('Puc_v4p9_DebugBar_Extension', false) ): @ini_set('display_errors', 'On'); } + /** + * Remove hooks that were added by this extension. + */ + public function removeHooks() { + remove_filter('debug_bar_panels', array($this, 'addDebugBarPanel')); + remove_action('debug_bar_enqueue_scripts', array($this, 'enqueuePanelDependencies')); + remove_action('wp_ajax_puc_v4_debug_check_now', array($this, 'ajaxCheckNow')); + } + /** * @param string $filePath * @return string diff --git a/Puc/v4p9/UpdateChecker.php b/Puc/v4p9/UpdateChecker.php index db3e926..964b692 100644 --- a/Puc/v4p9/UpdateChecker.php +++ b/Puc/v4p9/UpdateChecker.php @@ -65,6 +65,11 @@ if ( !class_exists('Puc_v4p9_UpdateChecker', false) ): */ protected $cachedMetadataHost = 0; + /** + * @var Puc_v4p9_DebugBar_Extension|null + */ + protected $debugBarExtension = null; + public function __construct($metadataUrl, $directoryName, $slug = null, $checkPeriod = 12, $optionName = '') { $this->debugMode = (bool)(constant('WP_DEBUG')); $this->metadataUrl = $metadataUrl; @@ -168,6 +173,10 @@ if ( !class_exists('Puc_v4p9_UpdateChecker', false) ): if ( $this->scheduler ) { $this->scheduler->removeHooks(); } + + if ( $this->debugBarExtension ) { + $this->debugBarExtension->removeHooks(); + } } /** @@ -925,7 +934,7 @@ if ( !class_exists('Puc_v4p9_UpdateChecker', false) ): */ public function maybeInitDebugBar() { if ( class_exists('Debug_Bar', false) && file_exists(dirname(__FILE__) . '/DebugBar') ) { - $this->createDebugBarExtension(); + $this->debugBarExtension = $this->createDebugBarExtension(); } }