From 91b3526e8de7c2646c3827e0584b52172b2965e4 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 8 Apr 2025 12:57:03 +0200 Subject: [PATCH] Plugins: non-static $translations (fix #1000) The main reason is that static properties are minified. --- adminer/include/plugin.inc.php | 4 ++-- externals/PhpShrink | 2 +- plugins/adminer.js.php | 2 +- plugins/backward-keys.php | 2 +- plugins/before-unload.php | 2 +- plugins/codemirror.php | 2 +- plugins/config.php | 2 +- plugins/dark-switcher.php | 2 +- plugins/database-hide.php | 2 +- plugins/designs.php | 2 +- plugins/dump-alter.php | 2 +- plugins/dump-bz2.php | 2 +- plugins/dump-date.php | 2 +- plugins/dump-json.php | 2 +- plugins/dump-php.php | 2 +- plugins/dump-xml.php | 2 +- plugins/dump-zip.php | 2 +- plugins/edit-calendar.php | 2 +- plugins/edit-foreign.php | 2 +- plugins/edit-textarea.php | 2 +- plugins/editor-setup.php | 2 +- plugins/editor-views.php | 2 +- plugins/email-table.php | 2 +- plugins/enum-option.php | 2 +- plugins/file-upload.php | 2 +- plugins/foreign-system.php | 2 +- plugins/frames.php | 2 +- plugins/json-column.php | 2 +- plugins/login-ip.php | 2 +- plugins/login-otp.php | 2 +- plugins/login-password-less.php | 2 +- plugins/login-servers.php | 2 +- plugins/login-ssl.php | 2 +- plugins/login-table.php | 2 +- plugins/master-slave.php | 2 +- plugins/menu-links.php | 2 +- plugins/monaco.php | 2 +- plugins/pretty-json-column.php | 2 +- plugins/prism.php | 2 +- plugins/select-email.php | 2 +- plugins/slugify.php | 2 +- plugins/sql-gemini.php | 2 +- plugins/sql-log.php | 2 +- plugins/table-indexes-structure.php | 2 +- plugins/table-structure.php | 2 +- plugins/tables-filter.php | 2 +- plugins/tinymce.php | 2 +- plugins/translation.php | 2 +- plugins/version-github.php | 2 +- plugins/version-noverify.php | 2 +- 50 files changed, 51 insertions(+), 51 deletions(-) diff --git a/adminer/include/plugin.inc.php b/adminer/include/plugin.inc.php index dfbf7871..cc1641e5 100644 --- a/adminer/include/plugin.inc.php +++ b/adminer/include/plugin.inc.php @@ -3,7 +3,7 @@ namespace Adminer; // the overridable methods don't use return type declarations so that plugins can be compatible with PHP 5 abstract class Plugin { - /** @var array>[] */ protected static $translations = array(); // key is language code + /** @var array>[] */ protected $translations = array(); // key is language code /** Get plain text plugin description; empty string means to use the first line of class doc-comment * @return string @@ -25,7 +25,7 @@ abstract class Plugin { */ protected function lang(string $idf, $number = null): string { $args = func_get_args(); - $args[0] = idx(static::$translations[LANG], $idf) ?: $idf; + $args[0] = idx($this->translations[LANG], $idf) ?: $idf; return call_user_func_array('Adminer\lang_format', $args); } } diff --git a/externals/PhpShrink b/externals/PhpShrink index 7a4c6ac9..bc2ad3a1 160000 --- a/externals/PhpShrink +++ b/externals/PhpShrink @@ -1 +1 @@ -Subproject commit 7a4c6ac9ac102a32ed20ea02ac19ee99e7a815a7 +Subproject commit bc2ad3a1d2135ae562aec848083979490b71a05b diff --git a/plugins/adminer.js.php b/plugins/adminer.js.php index 3b5bffb5..ac73081c 100644 --- a/plugins/adminer.js.php +++ b/plugins/adminer.js.php @@ -17,7 +17,7 @@ class AdminerDotJs extends Adminer\Plugin { } } - protected static $translations = array( + protected $translations = array( 'cs' => array('' => 'Nahraje adminer.js'), 'de' => array('' => 'Laden Sie adminer.js'), 'pl' => array('' => 'Wczytuj adminer.js'), diff --git a/plugins/backward-keys.php b/plugins/backward-keys.php index 33754ea9..ace9cc5b 100644 --- a/plugins/backward-keys.php +++ b/plugins/backward-keys.php @@ -56,7 +56,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row return "https://www.adminer.org/static/plugins/backward-keys.png"; } - protected static $translations = array( + protected $translations = array( 'cs' => array('' => 'Zobrazí odkazy na tabulky odkazující aktuální řádek, stejně jako Adminer Editor'), ); } diff --git a/plugins/before-unload.php b/plugins/before-unload.php index 2cf98a36..ec9bf7b6 100644 --- a/plugins/before-unload.php +++ b/plugins/before-unload.php @@ -31,7 +31,7 @@ onbeforeunload = () => editChanged; array('' => 'Zobrazí potvrzení před odnahráním stránky, pokud bylo změněno formulářové políčko'), ); } diff --git a/plugins/codemirror.php b/plugins/codemirror.php index d51c53d3..b2f435ed 100644 --- a/plugins/codemirror.php +++ b/plugins/codemirror.php @@ -102,7 +102,7 @@ addEventListener('DOMContentLoaded', () => { return "https://www.adminer.org/static/plugins/codemirror.gif"; } - protected static $translations = array( + protected $translations = array( 'cs' => array('' => 'Použít CodeMirror 5 pro zvýrazňování syntaxe a