Get started

Let's get started with nuxt-loco.

  1. Install the dependencies in your Nuxt project:
npx nuxi@latest module add nuxt-loco
  1. Configure your nuxt.config.ts to load the module
nuxt.config.ts
import { defineNuxtConfig } from 'nuxt/config'// https://nuxt.com/docs/guide/directory-structure/nuxt.config#nuxt-config-fileexport default defineNuxtConfig({  ...  modules: [    'nuxt-loco',  ],})
  1. Parameters

You can customize the parameters of the module by providing the loco key from your nuxt.config.ts

KeyTypeRequiredDescription
tokenstringtrueThe localise token to export the locales
pathBooleantrueWhere the locales will be writen
localestringfalseused to handle case you have only one locale and due to lack of informatiom from localise.
fallbackBooleanfalseFallback locale for untranslated assets, specified as short code. e.g. en or en_GB see more
disabledBooleanfalsein case you don't need to sync it from localise server