Cooking Up a Screenshot Migration Recipe Between Projects on Transifex 👩‍🍳

:tada: Greetings, code chefs! Today, we’re preparing a piping-hot Python recipe to help you copy screenshots and their context mappings between two Transifex projects. Whether you’re reorganizing projects or cloning resources for a new initiative, this utility ensures your visual context comes along for the ride. Let’s get cooking!

:cooking: Kitchen Prep: What You’ll Need

Make sure you have the following ingredients prepped before running the script:
:white_check_mark: Python 3 installed on your machine.

:white_check_mark: Your Transifex API token.

:white_check_mark: Access to both the source and target Transifex organizations/projects.

:white_check_mark: The Transifex Python SDK installed (pip install transifex-python).

:white_check_mark: Target project should already include the same resources as the source project (this is important! :brain:).

:salt: Recipe Overview

This script:

  • Fetches all context screenshot mappings from the source project.

  • Downloads each screenshot from the Transifex usermedia CDN.

  • Uploads each screenshot to the target project.

  • Re-creates the context mappings by locating the corresponding resource strings in the target project.

:salt: Script

You can access to this script here.

:test_tube: Cooking Instructions: How to Run the Script

Download the script from our Developer Hub or copy it into your own .py file.

Open your terminal and navigate to the script’s folder.

Run:

python copy_screenshots.py

When prompted, enter your API token and both the source and target organization/project slugs.

Watch the script do its thing—downloading, uploading, and mapping screenshots like a true sous-chef. :cook:

:fire_extinguisher:Troubleshooting

Missing screenshots? Check if the source project has any mappings.

Getting hash mismatch errors? Ensure the resource slugs and string hashes match between source and target projects.

Not sure about your project or org slug? You can find them in your Transifex URL:
https://app.transifex.com/organization_slug/project_slug/

:partying_face: Final Plating

Once done, your screenshots and their context should be fully cloned in the target project—complete with coordinates and connections. Say goodbye to manual screenshot uploads, and hello to smoother project migrations. :shortcake:
Bon appétit, and happy localizing! :globe_showing_europe_africa::sparkles: