From 512b80184bcdc184e53d18b563da7f1bd8de90fc Mon Sep 17 00:00:00 2001 From: Alexander Sorokin <10401817+brawaru@users.noreply.github.com> Date: Thu, 23 Nov 2023 04:40:43 +0100 Subject: [PATCH] Add vintl global var in docs --- apps/docs/plugins/global-vintl.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 apps/docs/plugins/global-vintl.ts diff --git a/apps/docs/plugins/global-vintl.ts b/apps/docs/plugins/global-vintl.ts new file mode 100644 index 0000000..b30a6f1 --- /dev/null +++ b/apps/docs/plugins/global-vintl.ts @@ -0,0 +1,19 @@ +export default defineNuxtPlugin((nuxtApp) => { + if (process.client && typeof window !== null) { + ;(window as any).vintl = nuxtApp.$i18n + console.log('~'.repeat(80)) + console.log('%cHey there! 👋', 'font-size: 1.2rem') + console.log( + 'VIntl controller can be used here through a global `vintl` variable.', + ) + console.log( + 'Have playing with it! And if you break anything, just refresh the page :P', + ) + if (!process.dev) { + console.log( + '⚠️ This is a production environment. Message parsing is unavailable.', + ) + } + console.log('~'.repeat(80)) + } +})