Cara menggunakan google trans new python

In this tutorial, you will learn how to perform Python translation of nearly any type of text. I’ll show you how to work with the Google Translate and DeepL engines using Python, how to detect the language of your texts, and how to automate language translation using a dedicated TMS. We are going to discuss three Python translate libraries: Translators, googletrans, and deep-translator, and see them in action.

What is machine translation and which engine is the best one?

Machine translation (MT) is a process involving some kind of algorithm to perform translations automatically rather than hiring a human specialist. The MT market is growing rapidly: computer-generated translations have come a long way, from absolutely terrible to pretty usable, thanks to the emergence of machine learning and neural networks. Some even say that we don’t really need human translators anymore, but I’d say that’s a little far-fetched. MT has pros, but of course it has cons, too.

If you are interested in learning more about MT in general and the available engines, I would recommend checking out this very detailed blog post on this topic.

Python translation libraries

There are a few available Python packages that introduce the ability to translate texts by taking advantage of neural networks. Let’s discuss some of them.

Translators

The translators package is probably one of the best choices out there.

Pros:

  • It is actively supported.
  • It does not have many open issues and appears stable.
  • Its package supports around a dozen different translation APIs.
  • It can be used to translate HTML.
  • It supports batch translations.

Cons:

  • It does not provide many customization options.
  • Translators does not allow performance of language detection only.
  • The response contains the translated text without any additional information.

Deep-translator

Deep-translator also seems like a very solid option.

Pros:

  • It has support for multiple translation APIs, including Google, Microsoft, Yandex, Libre, and others.
  • Allows performance of translations directly from a text file (unfortunately, it has to be in
    {
      "welcome": "Welcome to the tutorial, {username}!",
      "description": "This tutorial explains how to translate texts with Python."
    }
    9 format).
  • Can be used directly from a terminal.
  • Supports batch translations.

Cons:

  • Language detection is only possible with a private API key.
  • The package’s community seems to have become less active.

Googletrans

Googletrans is the library that, as the name suggests, enables you to easily translate any text using Google Translate. While it’s still a feasible solution, it does have certain issues.

Pros:

  • No configuration or authentication needed; you can start using the library right away.
  • It has a text language detection feature.
  • The returned data contains extra information like translation confidence score or potential mistakes.

Cons:

  • The biggest problem is that this package no longer appears to be actively maintained.
  • The latest stable release has unresolved issues and you’ll have to install release candidate instead.
  • Certain additional data no longer seems to be available.

Translate

Translate is a simple command-line tool and a Python module that enables you to perform translations using Google MT and other engines. It’s quite similar to googletrans.

Pros:

  • It is available both as a Python module and as a command-line tool.
  • Supports multiple engines, including Google, Microsoft, and DeepL.

Cons:

  • This package is a bit too simplistic.
  • Does not allow text language detection.
  • Has unresolved issues and does not seem to be actively maintained.

Setting up a new Python project

Now I would like to see these Python translation libraries in action, but first things first: we need to prepare a sample project. I’ll be using Pipenv to manage dependencies and create a virtual environment, but of course you can take advantage of another solution.

Let’s install Pipenv:

pip install --user pipenv

Next, create a new folder for your project and add a

import translators as ts
0 file in it:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "~=2.27"
python-lokalise-api = "~=1.6"
python-dotenv = "~=0.20"
googletrans = "==4.0.0rc1"
translators = "~= 5.4"
deep-translator = "~=1.9"
[requires]
python_version = "3.10"

We will use these packages throughout the tutorial, therefore install it by running:

pipenv install

Also, create an empty

import translators as ts
1 file and an
import translators as ts
2 directory. Inside the
import translators as ts
2 directory, let’s add an
import translators as ts
4 folder with an
import translators as ts
5 file. The full path to this file is
import translators as ts
6. Here are some sample contents for this JSON file:

{
  "welcome": "Welcome to the tutorial, {username}!",
  "description": "This tutorial explains how to translate texts with Python."
}

Okay, so we’ve laid the ground work and can proceed to the main part of this tutorial.

Using DeepL and the Translators library

The first library that I wanted to show you has a very concise name: Translators. It supports numerous engines, including Google, DeepL, Baidu, and others.

Translate texts with DeepL

To get started, let’s create a new

import translators as ts
7 file:

import translators as ts

Then you will have to decide . To use an engine, you simply need to call a method with the corresponding name, for example:

ts.google()
ts.deepl()
ts.baidu()

These methods accept at least one argument: the text you would like to translate. Next, you can specify additional options, for example the source and the target language. By default the engine will try to “guess” the source language, and use English as the target.

Let’s translate a simple sentence into French:

import translators as ts

res = ts.deepl("Welcome to our tutorial!", to_language='fr')
print(res)

Here’s the result:

Bienvenue à notre tutoriel !

What if we wanted to translate multiple items from a JSON file? That’s not a problem either:

import json
import os
import translators as ts

filepath = os.path.join(os.path.dirname(__file__), "i18n/en.json")

with open(filepath) as i18n_file:
    parsed_json = json.loads(i18n_file.read())

result = [ts.deepl(phrase, to_language='fr', sleep_seconds=5) for phrase in parsed_json.values()]
print(result)

In this case I’ve specified the

import translators as ts
8 option to avoid sending too many requests.

Now you can run the script

pipenv run python src\translate-translators.py

…and observe the results.

That was fast, eh?

Using Google Translate and the deep-translator package

Next, I’ll show you how to get started with the deep-translator library and easily perform text language detection.

Translate your texts

So, to see this library in action, let’s create a new

import translators as ts
9 file:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "~=2.27"
python-lokalise-api = "~=1.6"
python-dotenv = "~=0.20"
googletrans = "==4.0.0rc1"
translators = "~= 5.4"
deep-translator = "~=1.9"
[requires]
python_version = "3.10"
0

In this example we will be using

ts.google()
ts.deepl()
ts.baidu()
0 but the package has support for other translation APIs as well.

Next, let’s pick the source and the target languages. For the source, I want Google MT to “guess” it for me, and the target should be French:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "~=2.27"
python-lokalise-api = "~=1.6"
python-dotenv = "~=0.20"
googletrans = "==4.0.0rc1"
translators = "~= 5.4"
deep-translator = "~=1.9"
[requires]
python_version = "3.10"
1

The last step is to perform the actual translation:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "~=2.27"
python-lokalise-api = "~=1.6"
python-dotenv = "~=0.20"
googletrans = "==4.0.0rc1"
translators = "~= 5.4"
deep-translator = "~=1.9"
[requires]
python_version = "3.10"
2

Simple, right?

Let’s read our JSON file and take advantage of bulk translation:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "~=2.27"
python-lokalise-api = "~=1.6"
python-dotenv = "~=0.20"
googletrans = "==4.0.0rc1"
translators = "~= 5.4"
deep-translator = "~=1.9"
[requires]
python_version = "3.10"
3

Now we need to take all the values from the

ts.google()
ts.deepl()
ts.baidu()
1 and pass it to the
ts.google()
ts.deepl()
ts.baidu()
2 method:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "~=2.27"
python-lokalise-api = "~=1.6"
python-dotenv = "~=0.20"
googletrans = "==4.0.0rc1"
translators = "~= 5.4"
deep-translator = "~=1.9"
[requires]
python_version = "3.10"
4

The

ts.google()
ts.deepl()
ts.baidu()
3 variable will contain an array with the translated texts:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "~=2.27"
python-lokalise-api = "~=1.6"
python-dotenv = "~=0.20"
googletrans = "==4.0.0rc1"
translators = "~= 5.4"
deep-translator = "~=1.9"
[requires]
python_version = "3.10"
5

Great!

Detect text language with Python

Deep-translator allows you to perform language detection, but unfortunately this does not work out of the box. To start using this feature, you have to register on the https://detectlanguage.com website and generate an API key. The good news is that registration takes less than a minute and you won’t have to pay anything: there’s a free plan that allows you to send up to 1000 requests per day. So, after you’ve registered, proceed to your personal profile, and copy the API key.

Next, paste it in the

import translators as ts
1 file:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "~=2.27"
python-lokalise-api = "~=1.6"
python-dotenv = "~=0.20"
googletrans = "==4.0.0rc1"
translators = "~= 5.4"
deep-translator = "~=1.9"
[requires]
python_version = "3.10"
6

Create a new

ts.google()
ts.deepl()
ts.baidu()
5 file:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "~=2.27"
python-lokalise-api = "~=1.6"
python-dotenv = "~=0.20"
googletrans = "==4.0.0rc1"
translators = "~= 5.4"
deep-translator = "~=1.9"
[requires]
python_version = "3.10"
7

And now simply use the

ts.google()
ts.deepl()
ts.baidu()
6 method:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "~=2.27"
python-lokalise-api = "~=1.6"
python-dotenv = "~=0.20"
googletrans = "==4.0.0rc1"
translators = "~= 5.4"
deep-translator = "~=1.9"
[requires]
python_version = "3.10"
8

After running the script, you should see

ts.google()
ts.deepl()
ts.baidu()
7 printed to the screen. Nice!

Using Google Translate and the googletrans library

In this section, I’m going to show you how to utilize the googletrans library and use Google Machine Translation (MT) with ease.

Performing text translations

To see the googletrans library in action, let’s create a new

ts.google()
ts.deepl()
ts.baidu()
8 file and instantiate the
ts.google()
ts.deepl()
ts.baidu()
9 class:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "~=2.27"
python-lokalise-api = "~=1.6"
python-dotenv = "~=0.20"
googletrans = "==4.0.0rc1"
translators = "~= 5.4"
deep-translator = "~=1.9"
[requires]
python_version = "3.10"
9

To perform text translation, you should use a method called — guess what? —

import translators as ts

res = ts.deepl("Welcome to our tutorial!", to_language='fr')
print(res)
0. Easy, huh? This method accepts at least one argument: that’s your source text. By default the target language is English, but you can override it simply by passing a second argument:

pipenv install
0

The

import translators as ts

res = ts.deepl("Welcome to our tutorial!", to_language='fr')
print(res)
1 variable will contain a special object responding to the following methods:

  • import translators as ts
    
    res = ts.deepl("Welcome to our tutorial!", to_language='fr')
    print(res)
    2 — target translation value (in our case, it should return French text).
  • import translators as ts
    
    res = ts.deepl("Welcome to our tutorial!", to_language='fr')
    print(res)
    3 — returns a target (destination) language code. In our case, it’ll be
    ts.google()
    ts.deepl()
    ts.baidu()
    7.
  • import translators as ts
    
    res = ts.deepl("Welcome to our tutorial!", to_language='fr')
    print(res)
    5 — the source text.
  • import translators as ts
    2 — the source text language, which Google MT will detect automatically.

So, why don’t we try to display this info? Modify your script by adding the following lines:

pipenv install
1

Now run the script:

pipenv install
2

And here’s your result:

pipenv install
3

Great!

Of course, you can read the contents of our sample JSON file and translate those with ease:

pipenv install
4

Now rerun the script and make sure that the translations display properly. You might note, however, that the

import translators as ts

res = ts.deepl("Welcome to our tutorial!", to_language='fr')
print(res)
7 placeholder is translated as well. Unfortunately, there’s no simple way to prevent that: sometimes MT engines fail to recognize such elements. One solution is to split your text and translate it in parts, but in this case the result could be very far from ideal. Your translated parts might have no meaning when connected together. Nevertheless, later I’ll show you another solution that can detect such placeholders for you.

Python language detection

Okay, so what if you need to perform language detection only? This can come in handy when you are not sure what the source language of your texts is. To achieve this, let’s create another

import translators as ts

res = ts.deepl("Welcome to our tutorial!", to_language='fr')
print(res)
8 file:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "~=2.27"
python-lokalise-api = "~=1.6"
python-dotenv = "~=0.20"
googletrans = "==4.0.0rc1"
translators = "~= 5.4"
deep-translator = "~=1.9"
[requires]
python_version = "3.10"
9

To perform language detection, we should use another method which is unsurprisingly called

import translators as ts

res = ts.deepl("Welcome to our tutorial!", to_language='fr')
print(res)
9:

pipenv install
6

The

import translators as ts

res = ts.deepl("Welcome to our tutorial!", to_language='fr')
print(res)
1 object has a
Bienvenue à notre tutoriel !
1 attribute which returns the detected code:

pipenv install
7

Of course, you can provide more phrases in different languages:

pipenv install
8

Nice!

How to automate translations in Python

So, as you can see, using a machine translation engine is not a complex task and you can start working with it in a matter of minutes. However, while the approach explained above is fine for translating smaller sentences, it does not scale well and thus is not suitable for large projects.

Suppose you have a large website with hundreds or even thousands of texts stored in multiple translation files. How hard would it be to translate this website into three languages? I would say quite hard, as you might face various unexpected issues. Also, as explained above, using an MT engine alone to translate complex texts is probably not the best idea, and you’ll most likely need someone to perform post-editing. Moreover, you’ll probably need a tool to better organize your translations, and provide screenshots explaining where and how these texts display (context matters!). Or maybe you’ll need to automatically export and import translations to and from your GitHub repository. There are numerous potential requirements, and the simplest solution would be to take advantage of a dedicated translation management system.

In this section, you’ll meet Lokalise — a TMS for agile teams that will cover all your needs. I’ll show you how to get started with Lokalise, how to automatically apply machine translation to uploaded text, and how to use the API to easily upload and download your translation files in any format.

Prepare a new Lokalise project

To begin, grab your free trial at app.lokalise.com/signup (no credit card required!). After signing up, you can join an existing team, if your company is already using Lokalise, or create a new one. For the purposes of this demo, let’s stick to the latter option and create a brand-new team. A team is basically a collection of users, groups, settings, and translation projects. Follow the wizard’s instructions; for example, choose:

  • I’m a software developer.
  • I want to start localization from scratch.
  • My content is in translation files.

Then press Create a project:

Cara menggunakan google trans new python

Next, give your project a name and choose base and target languages. The base language is the original language of your content, whereas the target is the language that you want to translate into (please note that it’s possible to choose multiple targets):

Cara menggunakan google trans new python

 

That’s pretty much it: you can now close the wizard without uploading any translation files. Instead, we’ll set up an automation and then upload our data via the API.

Setting up an automation rule

The next step is creating a special automation rule that will apply machine translation to the uploaded text.

Choose More > Automations from the top menu:

Cara menggunakan google trans new python

 

Then click Create automation rules and adjust the following options:

Cara menggunakan google trans new python

  • Monitored language: English (or your own base language)
  • Minimal change required: 0%
  • Automated languages: add any target languages of your choice
  • Actions:
    • Use machine translation — by Google
    • Clear statuses
    • Mark as unverified (actually, enabling the last two options is not mandatory but most likely you’ll want to double-check machine translations as they might not be perfect)

To learn more about automations, please refer to our documentation.

Basically, that’s it! Once you are ready, hit Save changes and return to the project’s main page (called the “project editor”). The next thing to do is generate a Lokalise API key.

Generating an API key

We are going to use the Lokalise API in order to upload and download our translations; therefore, we must generate an API token. To achieve this, find your avatar in the bottom left corner, click on it, and choose Profile settings:

Cara menggunakan google trans new python

Then, choose API tokens in the left menu, and click Generate new token. The following dialog will appear:

Cara menggunakan google trans new python

Choose Read and write access, and then click Generate. Copy the newly created token and paste it to your

import translators as ts
1 file:

pipenv install
9

Great job! If would like to learn more about the Lokalise API and see usage examples, please check out my “APIv2 in practice” tutorial and a tutorial explaining how to build a Flask app with the Lokalise API and implement an OAuth 2 flow.

Uploading a translation file and applying an automation

At this point we are ready to upload our translation file and use the automation rule to apply machine translation.

First of all, let’s create a new

Bienvenue à notre tutoriel !
3 file, load all the necessary dependencies, and read environment variables from the
import translators as ts
1 file:

{
  "welcome": "Welcome to the tutorial, {username}!",
  "description": "This tutorial explains how to translate texts with Python."
}
0

Next, we are going to initialize an API client and define some variables:

{
  "welcome": "Welcome to the tutorial, {username}!",
  "description": "This tutorial explains how to translate texts with Python."
}
1

We will be using an official Python SDK for Lokalise API.

Please note that you’ll need to specify a Lokalise project ID. You can find this ID by returning to your Lokalise project and clicking More > Settings in the top menu. You’ll see your project ID under the corresponding section:

Cara menggunakan google trans new python

 

Now here’s the main part of our uploading script:

{
  "welcome": "Welcome to the tutorial, {username}!",
  "description": "This tutorial explains how to translate texts with Python."
}
2

Here:

  1. The imported content must be encoded with Base64.
  2. We are providing our content under the
    Bienvenue à notre tutoriel !
    5 field.
  3. Be sure to specify a language ISO code for your translation data. My base language is English, therefore I’m providing
    Bienvenue à notre tutoriel !
    6. Please note that this language code has to be present in the chosen Lokalise project otherwise you’ll get an error.
  4. Be sure to set
    Bienvenue à notre tutoriel !
    7 to
    Bienvenue à notre tutoriel !
    8 so that our rule kicks in when the translations are uploaded.
  5. While the uploading process happens in the background on Lokalise, we’ll have to wait a few moments and make sure our data is properly imported. The scheduled background process is represented by the
    Bienvenue à notre tutoriel !
    9 object.

Now let’s code the

import json
import os
import translators as ts

filepath = os.path.join(os.path.dirname(__file__), "i18n/en.json")

with open(filepath) as i18n_file:
    parsed_json = json.loads(i18n_file.read())

result = [ts.deepl(phrase, to_language='fr', sleep_seconds=5) for phrase in parsed_json.values()]
print(result)
0 method:

{
  "welcome": "Welcome to the tutorial, {username}!",
  "description": "This tutorial explains how to translate texts with Python."
}
3

We are requesting the status of the background process five times with a 1 second delay. If the status has changed to

import json
import os
import translators as ts

filepath = os.path.join(os.path.dirname(__file__), "i18n/en.json")

with open(filepath) as i18n_file:
    parsed_json = json.loads(i18n_file.read())

result = [ts.deepl(phrase, to_language='fr', sleep_seconds=5) for phrase in parsed_json.values()]
print(result)
1, it means that everything is good and our data was properly processed. If all five checks failed, it probably means that something has gone wrong. Please note that you might need to adjust these numbers depending on how large your translation file is.

And so this is it: your uploading script is ready!

Checking the file uploading feature

So, let’s execute our script by running:

{
  "welcome": "Welcome to the tutorial, {username}!",
  "description": "This tutorial explains how to translate texts with Python."
}
4

Once the operation is completed, return to your Lokalise project and open the editor:

Cara menggunakan google trans new python

Wow, take a look at that! The French and German translations were provided for us automatically; we didn’t have to lift a finger. Moreover, the

import translators as ts

res = ts.deepl("Welcome to our tutorial!", to_language='fr')
print(res)
7 part was properly recognized as a placeholder and now has a special formatting as placeholders should not be translated or modified.

These orange circles next to the translations mean that these values are unverified. You can filter only the unverified texts (by using the Filter dropdown) and double-check the result delivered by the MT.

Awesome!

Downloading translated content from Lokalise to your project

Now that our translations are done, we can download them back to the project. To do this, let’s create a new

import json
import os
import translators as ts

filepath = os.path.join(os.path.dirname(__file__), "i18n/en.json")

with open(filepath) as i18n_file:
    parsed_json = json.loads(i18n_file.read())

result = [ts.deepl(phrase, to_language='fr', sleep_seconds=5) for phrase in parsed_json.values()]
print(result)
3 file:

{
  "welcome": "Welcome to the tutorial, {username}!",
  "description": "This tutorial explains how to translate texts with Python."
}
5

Next, instantiate a client and add a list of the language ISO codes that you’d like to download:

{
  "welcome": "Welcome to the tutorial, {username}!",
  "description": "This tutorial explains how to translate texts with Python."
}
6

You can find a language code by opening your Lokalise project, clicking on the languages dropdown, and then pressing More > Settings next to the language name:

Cara menggunakan google trans new python

You’ll see a dialog with the following information:

Cara menggunakan google trans new python

That’s your language code. If needed, you can actually toggle the switch to On and enter any other code.

Great, now let’s start the download process:

{
  "welcome": "Welcome to the tutorial, {username}!",
  "description": "This tutorial explains how to translate texts with Python."
}
7
  • import json
    import os
    import translators as ts
    
    filepath = os.path.join(os.path.dirname(__file__), "i18n/en.json")
    
    with open(filepath) as i18n_file:
        parsed_json = json.loads(i18n_file.read())
    
    result = [ts.deepl(phrase, to_language='fr', sleep_seconds=5) for phrase in parsed_json.values()]
    print(result)
    4 — the desired format for your translation files. Lokalise supports more than a dozen file formats.
  • import json
    import os
    import translators as ts
    
    filepath = os.path.join(os.path.dirname(__file__), "i18n/en.json")
    
    with open(filepath) as i18n_file:
        parsed_json = json.loads(i18n_file.read())
    
    result = [ts.deepl(phrase, to_language='fr', sleep_seconds=5) for phrase in parsed_json.values()]
    print(result)
    5 — only the chosen languages should be included in the download bundle.
  • import json
    import os
    import translators as ts
    
    filepath = os.path.join(os.path.dirname(__file__), "i18n/en.json")
    
    with open(filepath) as i18n_file:
        parsed_json = json.loads(i18n_file.read())
    
    result = [ts.deepl(phrase, to_language='fr', sleep_seconds=5) for phrase in parsed_json.values()]
    print(result)
    6 — we would like to preserve the original names for our files.
  • import json
    import os
    import translators as ts
    
    filepath = os.path.join(os.path.dirname(__file__), "i18n/en.json")
    
    with open(filepath) as i18n_file:
        parsed_json = json.loads(i18n_file.read())
    
    result = [ts.deepl(phrase, to_language='fr', sleep_seconds=5) for phrase in parsed_json.values()]
    print(result)
    7 — translation files should not be further grouped into nested folders.
  • import json
    import os
    import translators as ts
    
    filepath = os.path.join(os.path.dirname(__file__), "i18n/en.json")
    
    with open(filepath) as i18n_file:
        parsed_json = json.loads(i18n_file.read())
    
    result = [ts.deepl(phrase, to_language='fr', sleep_seconds=5) for phrase in parsed_json.values()]
    print(result)
    8 — two spaces should be used for indentation.
  • import json
    import os
    import translators as ts
    
    filepath = os.path.join(os.path.dirname(__file__), "i18n/en.json")
    
    with open(filepath) as i18n_file:
        parsed_json = json.loads(i18n_file.read())
    
    result = [ts.deepl(phrase, to_language='fr', sleep_seconds=5) for phrase in parsed_json.values()]
    print(result)
    9 — our format is ICU, but you can choose other options depending on the file format (Symfony, iOS, .NET, raw, and so on).

Finally, we should extract the archive to the

pipenv run python src\translate-translators.py
0 folder:

{
  "welcome": "Welcome to the tutorial, {username}!",
  "description": "This tutorial explains how to translate texts with Python."
}
8

Please note that any duplicate files in that directory will be overwritten so be careful!

And, that’s pretty much it. Now you can run the

import json
import os
import translators as ts

filepath = os.path.join(os.path.dirname(__file__), "i18n/en.json")

with open(filepath) as i18n_file:
    parsed_json = json.loads(i18n_file.read())

result = [ts.deepl(phrase, to_language='fr', sleep_seconds=5) for phrase in parsed_json.values()]
print(result)
3 script and make sure that two new files, namely
pipenv run python src\translate-translators.py
2 and
pipenv run python src\translate-translators.py
3, were created in the
import translators as ts
4 directory. Great job!

What about human-generated translations?

As you already know, while MT is a great tool it does have its limitations. Is there an easy way to hire a professional translators without needing to find a candidate all by yourself? But of course!

Lokalise allows you to take advantage of professional translation services with just a few clicks. First, choose Order from the left menu and then click New order:

Cara menggunakan google trans new python

Then you’ll just need to select a translation provider (Lokalise or Gengo), choose the project, and adjust the other options:

Cara menggunakan google trans new python

Once you are ready, simply enter your credit card details and wait until the order is completed. If you choose the Gengo provider, you’ll also be able to attach a plain text file instead of choosing a translation project.

To learn more about professional translation services, please refer to our documentation.

Conclusion

And this concludes our tutorial. Actually, we’ve only scratched the surface, as you can build much more complex flows with Lokalise. Here are some suggestions for further research:

  • Learn more about Python internationalization
  • Learn how to get started with Django internationalization and how to implement more complex concepts
  • Create an app that registers a webhook and responds to events that occur on Lokalise
  • Create your very own custom processor that transforms all the data uploaded and downloaded on Lokalise
  • And finally, you might be interested in taking our free course, “Lokalise for Developers”, which covers the useful apps Lokalise has to offer and explains how to work with the API, webhooks, custom processors, custom placeholders, and more

I thank you for staying with me, and until next time.

  • Tutorials

Author

Ilya Krukowski

Lead of content, SDK/integrations dev

Ilya is a lead of content/documentation/onboarding at Lokalise, an IT tutor and author, web developer, and ex-Microsoft/Cisco specialist. His primary programming languages are Ruby, JavaScript, Python, and Elixir. He enjoys coding, teaching people and learning new things. In his free time he writes educational posts, participates in OpenSource projects, tweets, goes in for sports and plays music.