diff options
Diffstat (limited to 'src/web/helpers/lang.php')
-rw-r--r-- | src/web/helpers/lang.php | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/web/helpers/lang.php b/src/web/helpers/lang.php index e8fa29e..b11cc7c 100644 --- a/src/web/helpers/lang.php +++ b/src/web/helpers/lang.php @@ -1,7 +1,13 @@ <?php /* Copyright (c) 2024 Freya Murphy */ $lang = array(); -function lang($key, $default = NULL, $sub = NULL) { +/** + * @param ?array<string,mixed> $sub + */ +function lang( + string $key, + ?string $default = NULL, + ?array $sub = NULL) { $lang = $GLOBALS['lang']; if(array_key_exists($key, $lang)) { if ($sub) { @@ -17,15 +23,20 @@ function lang($key, $default = NULL, $sub = NULL) { } } -function ilang($key, - $class = NULL, - $id = NULL, - $href = NULL, - $click = NULL, - $attrs = array(), - $sub = NULL, - $button = FALSE, - $container = 'span' +/** + * @param array<string,string> $attrs + * @param ?array<string,mixed> $sub + */ +function ilang( + string $key, + string $class = NULL, + string $id = NULL, + string $href = NULL, + string $click = NULL, + array $attrs = array(), + ?array $sub = NULL, + bool $button = FALSE, + string $container = 'span' ) { $text = ucfirst(lang($key . "_text", FALSE, sub: $sub)); $tip = lang($key . "_tip", FALSE, sub: $sub); |