fix bug requesting translation for empty sting

This commit is contained in:
Geriano
2022-09-02 08:16:29 +07:00
parent 9f42185400
commit 88e058f044

View File

@@ -8,7 +8,7 @@ export const getAllDefinedTransaction = () => axios.get(route('api.translation.g
.then(response => window.translations = response) .then(response => window.translations = response)
export const __ = (text, replacements = {}) => { export const __ = (text, replacements = {}) => {
if (typeof text === 'string') { if (typeof text === 'string' && text.trim() !== '') {
if (window.translations.hasOwnProperty(text.trim().toLowerCase())) { if (window.translations.hasOwnProperty(text.trim().toLowerCase())) {
text = window.translations[text.trim().toLocaleLowerCase()] text = window.translations[text.trim().toLocaleLowerCase()]
} else { } else {