From 7f399ff70861271eaabe4d73959d85192cc9a318 Mon Sep 17 00:00:00 2001 From: juancristobalgd1 <65052633+juancristobalgd1@users.noreply.github.com> Date: Sat, 11 Nov 2023 05:21:07 +0100 Subject: [PATCH 1/2] update axm_helper file --- src/axm_helper.php | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/axm_helper.php b/src/axm_helper.php index 5a0b8fe..29fddda 100644 --- a/src/axm_helper.php +++ b/src/axm_helper.php @@ -1,6 +1,6 @@ 1) { - $args = func_get_args(); - unset($args[0]); - // Replace placeholders in the message using vsprintf. - $message = vsprintf($message, $args); + // $message = Lang::gettext($key); + + // // Check if multiple parameters are passed. + // if (func_num_args() > 1) { + // $args = func_get_args(); + // unset($args[0]); + // // Replace placeholders in the message using vsprintf. + // $message = vsprintf($message, $args); + // } + + // return $message; + + // Get an instance of Lang + $lang = Lang::make(); + + if (emty($args)) { + return $lang->trans('file.message'); } - return $message; + // Translate a key + return $lang->trans('file.message', $args); } } From fbc575d1b52d3e44a624a714dca854adfbca64a6 Mon Sep 17 00:00:00 2001 From: juancristobalgd1 <65052633+juancristobalgd1@users.noreply.github.com> Date: Sat, 11 Nov 2023 05:58:44 +0100 Subject: [PATCH 2/2] updated --- src/axm_helper.php | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/axm_helper.php b/src/axm_helper.php index 29fddda..f07ecb7 100644 --- a/src/axm_helper.php +++ b/src/axm_helper.php @@ -278,23 +278,10 @@ function randomId($size = 50) */ function lang(string $key, array $args = []) { - // Get the message translation using the provided key. - // $message = Lang::gettext($key); - - // // Check if multiple parameters are passed. - // if (func_num_args() > 1) { - // $args = func_get_args(); - // unset($args[0]); - // // Replace placeholders in the message using vsprintf. - // $message = vsprintf($message, $args); - // } - - // return $message; - // Get an instance of Lang $lang = Lang::make(); - if (emty($args)) { + if (empty($args)) { return $lang->trans('file.message'); } @@ -364,6 +351,17 @@ function baseUrl(string $dir = ''): string } } +if (!function_exists('asset')) { + + function asset(string $dirFile): string + { + $pathAssets = 'resources/assets/'; + $file = baseUrl($pathAssets.$dirFile); + + return $file; + } +} + if (!function_exists('go')) { /**