mirror of
https://github.com/vrana/adminer.git
synced 2025-08-15 11:04:02 +02:00
Plugins: non-static $translations (fix #1000)
The main reason is that static properties are minified.
This commit is contained in:
@@ -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<literal-string, string|list<string>>[] */ protected static $translations = array(); // key is language code
|
||||
/** @var array<literal-string, string|list<string>>[] */ 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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user