Login Account

Properties Example Translated with doloc

Doloc offers a streamlined approach to localizing your Java application’s content. By utilizing its API, you can efficiently translate your Properties files into multiple languages. Here’s an example to illustrate the process:

Original Properties Files BEFORE localization

messages_en.properties:

# Main UI elements
greeting=Ahoy there!
description=Innovation at your fingertips, shaping tomorrow today.

# Footer section
footer=Don't miss out, be a part of the future.
contact=Let's get the ball rolling, we're just a message away!
terms=If you proceed, you accept the mysteries that lie ahead.

messages_de.properties:

# already translated texts
greeting=Ahoi!
description=Innovation zum Greifen nah bei dir, heute schon das morgen gestalten.

Running the doloc curl command

To translate this file into German using doloc’s API, execute the following curl command (be sure to get your $API_TOKEN in your doloc account):

curl "https://api.doloc.io" -H "Authorization: Bearer $API_TOKEN" -F source="@messages_en.properties" -F target="@messages_de.properties" -o messages_de.properties

Note: For further customization, refer to the options you can pass as query parameters in the URL! This allows you to tailor the experience to your needs.

Properties Files AFTER localization

After running the command, the translated Properties file will appear as follows:

messages_de.properties

# already translated texts
greeting=Ahoi!
description=Innovation zum Greifen nah bei dir, heute schon das morgen gestalten.
footer=Verpasse es nicht, sei ein Teil der Zukunft.
contact=Lass uns ins Rollen kommen, wir sind nur eine Nachricht entfernt!
terms=Wenn du fortfährst, akzeptierst du die Geheimnisse, die vor dir liegen.
All new texts are also translated according to existing translations. E.g. informal "you" of "description" translation is respected.

This process demonstrates how doloc can seamlessly integrate into your development workflow, providing instant translations and accelerating your application’s localization.

Getting started with Properties localization

Ready to get started with doloc? It is only three steps:

  1. Register now!
  2. Create your personal $API_TOKEN
  3. Add the curl command (see above) to your dev workflow.

Make sure to check out our complete Properties Format Documentation.