0.0.17 • Published 1 year ago

@deegital/nuxt-trustup-io-translations v0.0.17

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

nuxt-trustup-io-translations

npm version npm downloads License Nuxt

Nuxt module to translate on our nuxt apps

Features

  •  Foo
  • 🚠  Bar
  • 🌲  Baz

Quick Setup

  1. 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
  1. Add @deegital/nuxt-trustup-io-translations to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: ["@deegital/nuxt-trustup-io-translations"],
  trustupIoTranslations: {},
});
  1. Add runtimeconfig
runtimeConfig: {
    public: {
      appName: "",
    },
  },
  1. Add environment variable related to your app
NUXT_PUBLIC_APP_NAME=trustup-pro
  1. 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
  - git@github.com:deegitalbe/nuxt-trustup-io-translations.git // git@github.com: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

0.0.17

1 year ago

0.0.16

1 year ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago