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:
<scriptid="locizify" projectid="[PROJECT_ID]"apikey="[API_KEY]" referencelng="[LNG]"fallbacklng="[LNG]" saveMissing="true"src="https://unpkg.com/locizify@^2.0.0"></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.
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​
To connect i18next with the locize service integrate the xhr or node.js backend:
import i18next from 'i18next';import Backend from 'i18next-locize-backend';​i18next.use(Backend).init({// ...other optionsbackend: {projectId: '[PROJECT_ID]',apiKey: '[API_KEY]',referenceLng: '[LNG]'}});
browser: Learn more about the browser backend​
nodejs: Learn more about the nodejs backend​
Checkout our samples.
(You should not expose your write API key into production - only use it during development)
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 clientside, 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'));});
For more details checkout locizer docs​
Our samples:
​react-intl​
​vue-i18n​
​formatjs​
​polyglot​
​js-lingui​
​react-intl-namespaces Integrations of react-intl internationalization library with locize.com online translation service. Comes with support for namespaces, incontext editor, ...
For js environments please watch out for the i18next integration options.
On other environments you could use:
​Our API​
​Our locize-cli​
You can use following modules to convert between formats:
​xliff​
​android-string-resource​
​gettext (.mo/.po)​
Simplest is to use those in combination with our cli to build an automated production pipeline powered by grunt, gulp, npm script, ...