Skip to main content

i18n Localization

MStore Dashboard mendukung 3 bahasa menggunakan @nuxtjs/i18n: English, Bahasa Indonesia, dan Japanese.

Configuration

Locale Files Structure

Example Locale Files

Usage in Components

Basic Usage with $t

With useI18n Composable

With Parameters

Pluralization

Language Switcher Component

Formatting

Date Formatting

Configure date formats in each locale:

Number Formatting

Configure number formats:

Persisting Language Preference

Integration with Backend

Sending Locale to API

Translating Backend Errors

Organizing Translations

For large applications, organize translations by feature:

Best Practices

Use hierarchical keys:
Example:
  • inventory.form.save
  • auth.error.invalidCredentials
  • common.button.cancel
Enable lazy loading untuk mengurangi initial bundle size:
Selalu set default locale:
Handle missing translations gracefully:

Next Steps

Nuxt UI Components

UI component library

Development Guide

Development best practices