Lost in Translation – Finding Strings

Did you know Understand comes in different languages? We have a major Japanese release coming soon, so this week, like many of the Understand Engineers, I’ve been finding string literals that aren’t getting translated and fixing them. Here’s how I did it, using Understand.

One missing string was “Configuration:” on the page below, which is part of the Understand New Project wizard when building a new Understand project by importing a Visual Studio or XCode project file:

Since the string “Configuration:” isn’t an entity, it isn’t findable with the Entity Filter. Instead, Instant Search (the search box at the top right of the main window) is very convenient. The query “string:configuration” will give search results in strings (the “string:” part) that contain “configuration”. More details on the syntax are available from the “?” link next to the Instant Search box.

There are 81 files with a string containing “configuration” but since the page is part of the New Project wizard, the NewWizard.cpp file seems like a good place to start. In fact, the “tr” translation function was missing from the final result on the list. Double-clicking the result opens an editor at that location for a fast fix.

Instant Search only searches project files. It turns out some of the strings I was looking for weren’t in code files. For example, the styles for the Blame Margin in the Understand Editor (configurable under Tools->Options->Editor->Styles).

Instant Search for “Blame Oldest” has 0 results. In that case, Find In Files (in the Search menu) is useful to search a particular directory. In this case, I was pretty sure it was in a configuration file, so I searched the conf directory:

Unlike Instant Search, Find In Files takes time (11 seconds in my case), but this time I found the missing string:

Unfortunately, the string already looks correct and is wrapped with the tr function. Time to compare the “Blame Oldest” string to one of the styles on this page that is translated correctly. One style name that seems unlikely to appear in too many places is “Fold Margin.” Trying Instant Search first (because it’s faster), I can quickly see the string “Fold Margin” appears in a header file “EditorTrStrings.h.”

Aha, that seems promising. In fact, adding the missing “Blame” string literals to that file fixes the issue and this part of the application can now be translated correctly.

Cover Photo by David Edelstein / Unsplash