docu and declare return type for t()

This commit is contained in:
Mario
2024-06-10 08:26:06 +00:00
parent 388e7c88df
commit 69862bc6df

View File

@@ -198,10 +198,10 @@ function load_translation_table($lang, $install = false) {
*
* @param string $s string that should get translated
* @param string $ctx (optional) context to appear in po file
* @return translated string if exists, otherwise return $s
* @return string translated string if exists, otherwise return $s
*
*/
function t($s, $ctx = '') {
function t($s, $ctx = ''): string {
$cs = $ctx ? '__ctx:' . $ctx . '__ ' . $s : $s;
if (x(App::$strings, $cs)) {