@deegital/nuxt-trustup-io-translations
v0.0.17
Published
Nuxt module to translate on our nuxt apps
Downloads
125
Keywords
Readme
nuxt-trustup-io-translations
Nuxt module to translate on our nuxt apps
Features
- ⛰ Foo
- 🚠 Bar
- 🌲 Baz
Quick Setup
- Add
@deegital/nuxt-trustup-io-translations
dependency to your project
# Using pnpm
pnpm add -D @deegital/nuxt-trustup-io-translations
# Using yarn
yarn add --dev @deegital/nuxt-trustup-io-translations
# Using npm
npm install --save-dev @deegital/nuxt-trustup-io-translations
- Add
@deegital/nuxt-trustup-io-translations
to themodules
section ofnuxt.config.ts
export default defineNuxtConfig({
modules: ["@deegital/nuxt-trustup-io-translations"],
trustupIoTranslations: {},
});
- Add runtimeconfig
runtimeConfig: {
public: {
appName: "",
},
},
- Add environment variable related to your app
NUXT_PUBLIC_APP_NAME=trustup-pro
- How to use it ?
<div>{{ $t("apps.worksite") }}</div>
<TrustupLocaleMenu token="qsdqdqsd" :to-right="true" />
OR
<div>{{ $translator.t("apps.worksite") }}</div>
OR
const translation = useTranslation();
translation.getAvailableLocales();
translation.getCurrentLocale();
translation.i18n;
translation.setCurrentLocale("fr");
translation.loader;
translation.t("key");
translation.toggleShowKey();
useTranslate("key"); // work like $t
That's it! You can now use nuxt-trustup-io-translations in your Nuxt app ✨
Development
Bootstrap module
Find and replace all on all files (CMD+SHIFT+F):
- nuxt-trustup-io-translations // nuxt-trustup-io-toasteo
- Nuxt module to translate on our nuxt apps // Our notification package for nuxt.
- trustupIoTranslations // trustupIoToasteo
- @deegital // @deegital
- [email protected]:deegitalbe/nuxt-trustup-io-translations.git // [email protected]:deegitalbe/nuxt-trustup-io-toasteo.git
Start bootstrap script
./cli bootstrap
Available commands
# Install dependencies
./cli yarn install
# Generate playground
./cli yarn generate
# Start project
./cli start
# Stop project
./cli stop
# Restart project
./cli restart
# Build the playground for production
./cli yarn dev:build
# Run ESLint
./cli yarn lint
# Run Vitest
./cli yarn test
./cli yarn test:watch
# Validate your package (running linter & typecript validation)
./cli yarn validate
# Build the package for publication
./cli yarn build
# Release new version
npm version patch
References
Nuxt module development reference