diff --git a/config/function.php b/config/function.php index 3580c8c..9fab60e 100644 --- a/config/function.php +++ b/config/function.php @@ -3,9 +3,6 @@ * Copyright (c) 2023. Wepesi. */ -use Wepesi\Core\I18n; -use Wepesi\Core\Session; - /** * @param string $dir * @return array @@ -108,19 +105,6 @@ function appDirSeparator(string $path): string return $new_path; } -/** - * translate your text - * @param string $message - * @param string|array $value - * @return string - */ -function tra(string $message, $value = null): string -{ - $i18n = new i18n(Session::get('lang')); - $translate_value = !is_array($value) ? [$value] : $value; - return $i18n->translate($message, $translate_value); -} - /** * get a formatted application route path * @param string $path diff --git a/config/init.php b/config/init.php index b91c51f..b579525 100644 --- a/config/init.php +++ b/config/init.php @@ -56,6 +56,10 @@ function serverDomain(): object * Project General built-in Functions */ require_once $ROOT_DIR . '/config/function.php'; +/** + * + */ +require_once $ROOT_DIR . '/config/tra.php'; /** * Project autoload register diff --git a/config/tra.php b/config/tra.php new file mode 100644 index 0000000..fc0980e --- /dev/null +++ b/config/tra.php @@ -0,0 +1,28 @@ +translate($message, $translate_value); +} + +function tra_js(){} \ No newline at end of file