Search result not found.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

On this page

Locize Docs

Introduction

Using locize

Integration

Guides / Tips & Tricks

More

Which integration option should I use?Do I have to use the locize CDN or can I host / bundle the translations directly?How is locize different from the alternatives?Why do I get “The passed json is nested too deeply.” when consuming the API?Is locize only for developers and translators or is project management within the process too?What is the regular way to update the translation memory?Is there any visibility on project’s level of completion that shows how translators are progressing?Why is my namespace suddenly a flat json?How to change the publish format?Why does my namespace contain an array with a lot of null items?Why is the pricing so complicated?How to change credit card or billing information or download the invoices?How to import translations from a file?How to manually publish a specific version?How to delete or rename a namespace?Why is there such a high download amount?Where do I find the namespace backups?How can a segment/key be copied/moved or renamed?Why a new namespace is created, when I upload a translation file?I want to use the locize CDN, but would like to have a fallback that uses local/bundled translationsIs it possible to integrate multiple projects in the same app/website?Why do I see strange new keys marked as ONE, FEW, MANY, OTHERS?How do I open and edit JSON files?i18n vs. i18nexti18next vs. locizeWord CounterHow to style text within locize?What do I have to consider if my translation texts may contain confidential information?How to translate a file and download the results?

Instrumenting your code

locizify

Zero effort - drop one line of code.

Using our locizify script is the simplest way to get your website or webapplication translated. We highly recommend using it on your static site generators like wordpress, shopify, ...

Drop one line of code:

<script
    id="locizify" projectid="[PROJECT_ID]"
    apikey="[API_KEY]" referencelng="[LNG]"
    fallbacklng="[LNG]" saveMissing="true"
    src="https://unpkg.com/locizify@^6.0.11"
    autopilot="true"
></script>

You can find your projectId and API Key in your projects settings. (You should not expose your write API key into production - only use it during development)

Reload your page and see the phrases ready to translate in your locize project.

Find more details and configuration options on the github page.

https://youtu.be/f0ukRI0LMfo?t=180

i18next

Best translation management for i18next.

You can use locize in combination with i18next. I18next is a well known internationalization framework and offers a wide range of framework integrations and plugins for almost every need.

Learn more about i18next

Here you'll find a simple tutorial on how to best use react-i18next.Some basics of i18next and some cool possibilities on how to optimize your localization workflow.

To connect i18next with the locize service integrate the i18next-locize-backend:

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

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

(You should not expose your write API key into production - only use it during development)

Here you can find a step by step react tutorial.

code integration part of showcase/demo

Other i18next tutorials:

Here you'll find a simple Angular tutorial on how to best use angular-i18next.
Are you still using i18next in jQuery? Check out this tutorial blog post.
Are you using Next.js? Here you can find an example with different approaches and a blog post explaining this. Using Next.js 13/14/15 with the new app directory? Then this article is what you are looking for.
Are you using Gatsby? Here you can find an example and an appropriate blog post.
Are you using Remix? Here you can find a simple example and a step by step tutorial.
Are you using Vue.js? Here you can find a simple example and a step by step tutorial.

other options

client side: polyglot, formatjs, react-intl, vue-i18n, js-lingui, messageformat, ...

For server side rendering (SSR) or serverless usage, we do not suggest to use our locizer script. Because of this we suggest to download the translations in your CI/CD pipeline (via cli or via api) and package them with your application. Like described here.

On client side, you can use our locizer script to load translations from locize and add them to your i18n framework in the browser:

Sample for polyglot:

// <script src="https://unpkg.com/locizer/locizer.min.js"></script>
locizer
  .init({
    fallbackLng: 'en',
    referenceLng: 'en',
    projectId: '[your project id]'
  })
  .load('translation', function(err, translations, lng) {
    const polyglot = new Polyglot({ phrases: translations, locale: lng });
    console.log(polyglot.t('some key'));
  });

Sample for vue-i18n (Vue v3):

import { createI18n } from 'vue-i18n'
import locizer from 'locizer'

locizer.init({
  projectId: 'project-id'
});

export const i18n = createI18n({
  locale: locizer.lng, // set locale
  fallbackLocale: 'en' // set fallback locale
  // If you need to specify other options, you can set other options
  // ...
});

// called from within setup hook in App.vue
export const loadMessagesPromise = new Promise((resolve, reject) => {
  locizer.loadAll('messages', (err, messages) => {
    if (err) return reject(err);
    Object.keys(messages).forEach((l) => {
      i18n.global.setLocaleMessage(l, messages[l])
    });
    resolve(messages);
  });
})

The full example can be found here.

Here you'll find a simple tutorial on how to best use vue-i18n. Some basics of vue-i18n and some cool possibilities on how to optimize your localization workflow.

For more details checkout locizer docs.

Our samples:

3rd party modules

react-intl-namespaces Integrations of react-intl internationalization library with locize.com online translation service. Comes with support for namespaces, incontext editor, ...

serverside

Did you know internationalization is also important on your app's backend? In this tutorial blog post you can check out how this works.

For JavaScript environments please watch out for the i18next integration options and plugins.

On other environments you could use:

other formats xliff, gettext, ...

You can use following modules to convert between formats:

Simplest is to use those in combination with our cli to build an automated production pipeline powered by grunt, gulp, npm script, ...