Localize graphics using Adobe Photoshop CS5


Customers have always demanded more screenshots. When we comply with their demand, we introduce a significant delay in providing localized documentation for non-English users. It takes time, and a lot of money to produce translated documents. Many a times, the English and translated versions of the documentation remain out of sync for prolonged periods.

When it comes to translating text, we’re not all that slow. Modern memory translation systems can translate huge quantities of text, accurately and efficiently. Translating images? I don’t think so. Translated screenshots are usually taken by the localization vendors, and is typically a manual activity. It is costly in terms of time and money.

In this blog post, I propose a methodology to leverage data-driven graphics capability of Adobe Photoshop to generate translated screenshots. And because a vast majority of us are technical writers and not graphic designers, I’m also including small tutorial so that you can understand the process from a practical perspective.

Data driven graphics

Data driven graphics let you generate multiple variants of an image quickly and accurately. Photoshop supports data-driven graphics; and Adobe Technical Communication Suite includes Adobe Photoshop. We can use Photoshop to automate the screenshot localization process. Photoshop can insert localized text strings into a base screenshot and generate variants of the screenshot in the required languages.

Translating screenshots

Typically, localized UI strings become available long before the documentation is even sent for translation. We can leverage the early availability of these localized UI strings to automatically generate translated screenshots. Data driven graphics can combine a base screenshot and the localized UI strings to generate graphics that are ready for publishing. The basic workflow is shown in the figure below.

Localize Screenshots Workflow

Localize Screenshots Workflow

Tutorial

For the sake of brevity, this article assumes that you have basic familiarity with Photoshop, and are aware of  editing images, and working with layers. I’ve added links to the relevant topics in the Photoshop help to get you started.

This small hands-on exercise is to demonstrate the process. In this exercise, we take a screenshot from Adobe Reader 9, and generate translated versions in German, French, Dutch, and Spanish.

Note: The localized strings were generated using Google Translate.

Take the base screenshot

Using the screenshot utility of your choice, take a screenshot, and paste it in a new image in Photoshop. See Create an Image in Photoshop.

Screenshot captured and placed in Photoshop

Screenshot captured and placed in Photoshop

Prepare the base screenshot

Now that you’ve taken the screenshot, you notice that it has text strings that need to be replaced. For that we need to do two things: add a text layers for each text string and remove the static text images. See Layers Basics in Photoshop Help.

  1. Add a text layer for each string that needs to be replaced. In our screenshot we have eight text strings: File, Edit, View,…Help, and Find.
    1. In PhotoShop, use the Text tool and type “File”.
    2. Choose “Micsosoft Sans Serif” font and size “11”.
    3. Repeat for other strings.
  2. The layers panel will look something like this:

    Photoshop Layers panel with text strings

    Photoshop Layers panel with text strings

    TIP: Create another text layer, language, but place it outside the visible image area or hide it. We’ll map this layer to the data set name.

  3. Remove the text elements from the original image layer, and hide the text layers. You can use the Eraser tool, or even the new content aware features to remove the existing strings. See Eraser Tool or Content Aware pattern fills in Photoshop help.

    Screenshot with text strings removed

    Screenshot with text strings removed

  4. Make all the text layers visible, and place them as in the original screenshot. Save the file.

    Text strings made visible

    Text strings made visible

Defining variables

Now, define variable for each of the text layers that we need to replace. See Variables in Photoshop help.

  1. Choose Image > Variables > Define.
  2. Choose File layer, and select Text Replacement, and enter variable as File_var.
    Define Variables

    Define Variables

  3. Click the arrows next to the Layer drop down list and a create variable for each text layer.
  4. So you’ll end up with eight variables of the form <layer_name>_var.

TIP: Create an additional language variable for the data set name.

Create Data file

Create a csv or text file that contains the localized strings. The first line (or row) contains the variable names to import. These must match the variables that you defined in the earlier step. The subsequent rows contain the data. The first column may contain a data set name. Save the file. Your localization support should be able to provide you with the final strings. For this demonstration I used Google Translate. The file should look something like this:

lang_var,File_var,Edit_var,View_var,Document_var,Tools_var,Window_var,Help_var,Find_var
en,File,Edit,View,Document,Tools,Window,Help,Find
de,Datei, Bearbeiten, Ansicht, Dokument,Tools, Fenster, Hilfe, suchen
fr,Fichier, Edition, Affichage, Document, Outils, Fenêtre, Aide, Trouver
du,Bestand, Bewerken, Beeld, Document, Tools, Venster, Help, zoeken
es,Archivo, Editar, Ver, documentos, herramientas, Ventana, Ayuda, Buscar

Import data file

Now, import the data sets from the data file into the Photoshop image. See Data Sets in Photoshop help.

  1. Choose Image > Variables > Data Sets.
  2. Click Import.

    Import Dataset

    Import Dataset

  3. Click OK. The data is imported. And the first variable is used to create the data sets.

    Variables

    Variables

Preview

Enable the Preview check box, and browse the data sets using buttons next to the Data Set drop down.

Nudge the original text layers to make sure that all the text is visible, in all languages. You can also touch-up the final files. In my opinion, you’ll only run into problems with German, because the strings are considerably longer.

Publish

  1. Choose File > Export > Data Sets as Files.
  2. Specify an output folder and the file naming conventions
  3. Choose All Data Sets if you want to create all versions.

    Export data sets as files

    Export data sets as files

  4. Click OK. The files are created and placed in the output folder.

    Saved psd files

    Saved psd files

Post-publish

After you have translated the screenshots, you might need to process them before you can use them in your documentation. Depending on your company standards, you may need to resize, optimize etc or convert the .psd file to jpeg. See Image Processor in Photoshop help. You have other Automation options in Photoshop too.

Use the Photoshop Image Processor (File > Scripts > Image Processor)

Image processor

Image processor

Results

Final translated screenshots

Final translated screenshots

, , , ,