We’d like to tell you about a new resource we’ve created, the Lokalise Developer Hub. It’s a single place to host all relevant information for developers including guides, sample apps written in different languages, API explorer where you can test endpoints in real time, tips, docs, API and SDK changelogs. So, let’s see what it has to offer.
REST API docs and explorer
We have a dedicated section providing comprehensive documentation for all the API endpoints that Lokalise supports. Here you can also find information on authentication (with API tokens and OAuth 2), pagination, rate limiting and branching support.
And last but not the least is the ability to test our API by sending real requests using the API explorer. To get started, you’ll only require an API token and a project ID (for certain endpoints you might require a team ID instead):
- Log into your Lokalise account or create a new one.
- Click on the avatar in the bottom left corner, choose Profile settings, proceed to the API tokens tab and generate a new token. Make sure to never publicly expose it and treat it as your password.
- Next, open your translation project, click More > Settings, and under the General tab find your project ID.
Next, return to the API explorer, choose one of the endpoints from the left menu and, paste your API token into the X-Api-Token header text field, fill in the other request params as needed, and press Try It. Then you’ll be able to observe the response.
To learn more about the API explorer, you can watch the short video tutorial found on the “getting started” page.
Guides and tutorials
Lokalise apps and engines
Apart from the API docs, we also provide additional guides and articles related to apps and engines. So, what’s an app, you ask? In terms of Lokalise, we consider an app any piece of code that expands Lokalise’s functionality. An app can come in handy when you want to automate your localization process and workflows, customize and extend Lokalise core capabilities, or connect Lokalise with other systems. For example, we already have apps to send notifications via Slack or Discord and to automatically create tasks on Asana or Jira. There are various types of apps available, and you can read about those in the corresponding Developer Hub article.
An engine, in turn, facilitates the content exchange between Lokalise and ecommerce, PIM systems, or other content management systems, for example, Contentful, Storyblok, or WordPress.
A custom processor is one example of a Lokalise engine that we’ve introduced recently. To put it simply, a custom processor is a script that runs on a third-party service and manages translations that are uploaded and downloaded on Lokalise.
To better understand the idea, let’s see how a regular upload is performed on Lokalise:
- You choose one or more translation files to upload.
- Lokalise detects the translation file languages automatically, but you can adjust those as needed.
- You adjust any additional uploading options and click Upload.
- Lokalise parses the uploaded data, and extracts keys and translation values.
- Extracted data is displayed in the translation editor.
However, if you have a custom processor set up, after performing step 4 Lokalise will automatically send the parsed data to your service. There you can perform any additional actions, such as analyzing the uploaded data, transforming your translations, adding special formatting, removing unneeded special characters or certain banned words, restructuring translation keys, and so on. The only requirement is that the data returned by your processor must preserve the initial structure. A custom processor can also intercept the downloaded data in the same way.
This is very convenient, for example, when you would like to perform complex text analysis, remove banned words from your translations, add custom formatting, and so on.
Of course you might want to build a custom app to work with Lokalise, and to help you get started we’ve prepared a collection of tutorials with app samples. Specifically, you can learn how to work with the Lokalise API, implement an OAuth 2 flow and act on the user’s behalf, utilize webhooks to react to certain events happening in Lokalise. On top of that, we provide boilerplate examples for custom processors showing how exactly you can process received data.
Currently we provide code samples in the PHP, JS, Python, and Ruby languages.
App publishing process
After you’ve built an app, you might want to feature it on Lokalise so that other customers can take advantage of it (however, it’s not mandatory). You can refer to the app publishing section to learn about requirements regarding the apps, and what the overall publishing process looks like. Also, you can find an app review checklist and some useful tips on building successful apps.
If you are not looking to build a custom Lokalise app but rather want to know how to implement internationalization (i18n) in your project, this section is for you. We have a vast collection of I18n tutorials explaining how to build multilingual apps with different technologies. Our articles cover dozens of technologies including React, Angular, Django, Rails, Laravel, and many, many others.
Finally, changelogs for all our official API SDKs and the API itself can be found on the DevHub. You’ll never miss an update!
So, in this article we’ve briefly explored the Lokalise DevHub and checked out what it has to offer. We sincerely hope this new resource will help developers build something truly wonderful.
If you have any feedback for us, please don’t hesitate to fill out this form – we would love to hear from you.
That’s all for now. Stay tuned and happy coding!