Marking strings to be ignored for localization

Don’t translate this now and don’t ask me again next time.

Problem

Strings in source code start as text surrounded by quotes, such as "abc". The developer examines each string and sorts them into three choices; localize: LocalizationString("abc"), don’t localize: "abc", or undecided for now: "abc". Note that the two last choices look the same. Every time the source code is examined for unwrapped strings, the strings that are not to be localized continue to be flagged as "does this string need to be translated?"

Keeping track of strings that are not to be localized typically requires a list separate from the source code. The difficulty with a list is that a string in one line of code that should not get translated might be the same as a string in another line of code where its localization fate is still undecided. Additionally, strings that should not be localized could be changed in the source code and no longer be on the list.

The goal is to have a developer mark a string as “not to be localized” and then never ask them again.

Solution

Our IP marks strings that are not to be localized with a function that returns what you feed it, such as: NOP("abc"). Alternatively the "do not localize strings" could be wrapped with parens ("abc") since most compilers ignore the parens. Marking the string in the source code eliminates the need for a separate list, and it makes the status of a string (localize, don’t localize, undecided) very clear in the source code. Localize = LocalizationString("abc"), don’t localize = ("abc"), and undecided = "abc".

Impact

It is easy to distinguish between "do not localize" and "localization is undecided" strings. It is obvious which strings to present to the developer again on the next pass through the source code so that they can choose which to localize. This technique is accurate, allows a string to be in one of three states (localize, do not localize, undecided), and does not rely on an error prone external data set to track the status of a string.

Status

US Patent Application Number 62065717
Filed 19-OCT-2015