Migrating an i18next project

Migrating your existing i18next project to Locize is a straightforward process that unlocks powerful translation management, collaboration, and automation features. This guide will walk you through the essential steps to get up and running with Locize in just a few minutes.

Why migrate to Locize?

  • Centralized translation management
  • Real-time updates and collaboration
  • Seamless integration with i18next and popular frameworks

1. Update Your Backend Integration

Switching from your current i18next backend to Locize requires only a few lines of code change. Use the i18next-locize-backend for browser, Node.js, or Deno environments:

import i18next from 'i18next';
import Backend from 'i18next-locize-backend';

i18next
  .use(Backend)
  .init({
    // ...other options
    backend: {
      projectId: '[PROJECT_ID]',
      apiKey: '[API_KEY]'
    }
  });

You can find your projectId and API Key in your Locize project settings under the API tab.

For more details and advanced configuration, see the i18next-locize-backend documentation.

Examples:


2. Migrate Your Existing Translations

Easily transfer your current translation files to Locize using the Locize CLI:

locize migrate --api-key <your-api-key> --project-id <your-project-id> --path ./public/locales

Replace <your-api-key> and <your-project-id> with your actual credentials. This command will upload all your existing i18next translation files to your Locize project.


Next Steps

  • Explore the Locize dashboard to manage your translations.
  • Integrate Locize with your deployment workflow for continuous localization.
  • Check out more guides and best practices.

If you have any questions or need help, send us an e-mail!