Download TMX files for multiple projects/languages

Greetings, culinary code connoisseurs! Today, we’re donning our digital chef hats to whip up a batch of TMX files straight from the bountiful gardens of Transifex. This tool is your sous-chef in the kitchen of translation memory management, designed to streamline the process with precision and flair. Let’s turn the heat up and get cooking!

:spoon: Kitchen Prep: Ingredients You’ll Need Before we start sizzling, ensure you have these essentials on your countertop:

  • :key: A Valid Transifex API Token: This is your all-access pass to the Transifex pantry.
  • :office: Organization Slug: The name tag for your Transifex organization, making sure we pick ingredients from the right shelf.

:fire: Cooking Instructions: Let’s Fire Up the Stove!

  1. Heat Up Your Terminal: Crack open your terminal and preheat it with the command:

python download_tmx.py

  1. Provide Required Inputs: The utility will prompt you to enter your API token, organization slug, and options to specify projects and languages. Example:

Please enter your API token: YOUR_API_TOKEN Please enter your Organization slug: YOUR_ORG_SLUG Do you want reports for [a]ll projects or [s]pecific ones? [a/s]: a Do you want [o]ne report for all languages, [s]eparate reports for all languages or separate reports for specific [l]anguages? [o/s/l]: o

  1. Download TMX Files: The utility will process your input and download the specified TMX files to a directory structured as:

organization_slug/project_slug/language_code.tmx

Successful Outputs

You’ll see messages indicating the progress and completion of TMX file downloads:

  • For one file including all languages for a project:

TMX-Download for Project PROJECT_SLUG including all languages completed.

  • For separate files per language within a project:

TMX-Download for Project PROJECT_SLUG and language (LANGUAGE_CODE) completed.

Troubleshooting Errors

If there are errors during the process, such as issues with downloading files or incorrect slugs, the utility will print relevant error messages:

  • If the utility fails to download a TMX file:

The source file failed to be downloaded: ERROR_MESSAGE

An app.log file will also be created in the utility’s directory, logging any errors encountered during the process. Check this file for detailed error information and troubleshooting. :hammer_and_wrench::page_facing_up:


:star2: Savor the Success

With your TMX files now neatly organized and your digital kitchen cleaned up, you’re all set to serve up some stellar translations. If any spills occur along the way, the logs are your cleanup crew, ready to get things sparkling again.

Happy translating, and bon appétit! Let’s celebrate the art of code and cuisine together. :tada::globe_with_meridians:

1 Like