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.
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.
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.
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.
- 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.
- In PhotoShop, use the Text tool and type “File”.
- Choose “Micsosoft Sans Serif” font and size “11”.
- Repeat for other strings.
- 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.
- Make all the text layers visible, and place them as in the original screenshot. Save the file.
The layers panel will look something like this:
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.
Now, define variable for each of the text layers that we need to replace. See Variables in Photoshop help.
- Choose Image > Variables > Define.
- Choose File layer, and select Text Replacement, and enter variable as File_var.
- Click the arrows next to the Layer drop down list and a create variable for each text layer.
- 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.
- Choose Image > Variables > Data Sets.
- Click Import.
- Click OK. The data is imported. And the first variable is used to create the data sets.
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.
- Choose File > Export > Data Sets as Files.
- Specify an output folder and the file naming conventions
- Choose All Data Sets if you want to create all versions.
- Click OK. The files are created and placed in the output folder.
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)