Documentation

Magic Translate vs. vue-i18n

vue-i18n is the standard i18n library for Vue, and @nuxtjs/i18n builds on it for Nuxt. Like most i18n libraries, it uses a key for every text and a set of messages per language. Magic Translate translates the text in your Vue templates directly, without keys or message files.

At a glance

Magic Translatevue-i18n
How you write textYour own words, wrapped in <T>A key per text, such as $t('cart.title')
TranslationsAI translation, created automaticallyYou or your translators write them
Message filesNoneOne set of messages per language
New languagesChange the language settingTranslate every message into the new language
Switching languagesAt runtime, with useLanguageSwitcherAt runtime, by changing the locale
Plurals and formattingTranslated as part of the sentenceBuilt in, with plural rules and number and date formats
PriceFree plan, then monthly plans based on usageOpen source and free

How the code differs

With vue-i18n, you define the messages for each language and refer to them by key:

// i18n.ts
import { createI18n } from 'vue-i18n';
export const i18n = createI18n({
locale: 'de',
messages: {
en: { cart: { title: 'Your shopping cart' } },
de: { cart: { title: 'Ihr Warenkorb' } }
}
});
<h2>{{ $t('cart.title') }}</h2>

With Magic Translate, the text stays in the template:

<h2><T>Your shopping cart</T></h2>

For attributes such as placeholders, use useTranslate:

<input :placeholder="t('Search products')" />

When to choose Magic Translate

  • You want your Vue app in many languages without managing messages for each one.
  • You don't have translators, or you don't want to wait for them before you release.
  • Your texts change often, and you want every language to stay up to date.

When to choose vue-i18n

  • Every text must be translated or reviewed by a person.
  • You need search engines to see translated HTML from Nuxt server rendering. Magic Translate for Vue translates in the browser.
  • You want a free, open-source library with no external service.

Moving from vue-i18n to Magic Translate

You can switch one component at a time. Replace $t('key') with the English text from your messages, wrapped in <T>, or use t() from useTranslate for attributes. Both libraries can run side by side while you migrate. The Vue guide shows the setup.

Ready to try it? Follow the getting started guide to translate your first component in five minutes.