From 88e058f0441072a6ddf2e25cc6d91175af2c344f Mon Sep 17 00:00:00 2001 From: Geriano Date: Fri, 2 Sep 2022 08:16:29 +0700 Subject: [PATCH] fix bug requesting translation for empty sting --- resources/js/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/common.js b/resources/js/common.js index e1b50d0..cb96a81 100644 --- a/resources/js/common.js +++ b/resources/js/common.js @@ -8,7 +8,7 @@ export const getAllDefinedTransaction = () => axios.get(route('api.translation.g .then(response => window.translations = response) export const __ = (text, replacements = {}) => { - if (typeof text === 'string') { + if (typeof text === 'string' && text.trim() !== '') { if (window.translations.hasOwnProperty(text.trim().toLowerCase())) { text = window.translations[text.trim().toLocaleLowerCase()] } else {