diff --git a/resources/js/app.js b/resources/js/app.js index e0f7a5b..df792ba 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -17,7 +17,7 @@ const appName = window.document.getElementsByTagName('title')[0]?.innerText || ' const { $token } = JSON.parse(document.getElementById('app').dataset.page).props axios.defaults.headers.common['Authorization'] = `Bearer ${$token}` -commons.getAllDefinedTransaction() +commons.getAllDefinedTranslation() Object.keys(commons).forEach(key => Object.defineProperty(window, key, { value: commons[key], diff --git a/resources/js/common.js b/resources/js/common.js index e1b50d0..46f9392 100644 --- a/resources/js/common.js +++ b/resources/js/common.js @@ -3,7 +3,7 @@ import { usePage } from "@inertiajs/inertia-vue3" window.translations = {} window.locale = localStorage.getItem('locale') || 'id' -export const getAllDefinedTransaction = () => axios.get(route('api.translation.get', window.locale)) +export const getAllDefinedTranslation = () => axios.get(route('api.translation.get', window.locale)) .then(response => response.data) .then(response => window.translations = response) @@ -14,7 +14,7 @@ export const __ = (text, replacements = {}) => { } else { axios.post(route( 'api.translation.register', window.locale - ), { text }).then(getAllDefinedTransaction) + ), { text }).then(getAllDefinedTranslation) } for (const key in replacements) {