@verbx/localize-vue
v0.2.2
Published
VerbX Localize — Vue 3 SDK: createVerbX plugin, useT, useLocale, <T>.
Readme
@verbx/localize-vue
The Vue 3 SDK for VerbX Localize — install one package, register a plugin, and the text your users read is translated with no translation files and no keys to invent.
npm install @verbx/localize-vue// main.ts
import { createApp } from "vue";
import { createVerbX } from "@verbx/localize-vue";
import App from "./App.vue";
createApp(App)
.use(
createVerbX({
apiKey: "vx_…",
projectKey: "proj_…",
supportedLocales: ["en", "es", "hi"],
}),
)
.mount("#app");<script setup lang="ts">
import { useT } from "@verbx/localize-vue";
const t = useT();
</script>
<template>
<!-- the English string IS the key -->
<h1>{{ t("Your cart") }}</h1>
<!-- or the component form, with context and vars -->
<T :context="{ componentType: 'Button', parentLabel: 'Coupon code' }">Apply</T>
</template>What you get
createVerbX(config)— the plugin.apiKeyandprojectKeyare required.useT()— returnst(source, options?). Synchronous, never throws; a backend problem shows the source language rather than a spinner.<T>— component form for template children, withvars,count(plurals), andcontext.useLocale()— the current locale andsetLocale(locale).useVerbX()— the underlying client.
The SDK sends the placeholder token, never the value, so interpolated data stays on the device:
<T :vars="{ name: user.firstName }">Hi {name}</T>.
Docs
Full guide, the CLI, and the GitHub agent: localize.verbxeco.com — the Docs section is readable without an account.
License
Proprietary. See LICENSE.md and the VerbX terms of service.
