Originally Posted by
cas
While the _ macro could be used in any number of ways, the typical (in free software) use is as a call to the gettext() function, which does not do translation as you seem to be implying. It's not a simple “look each word up in the dictionary” scheme: gettext() looks up strings in a message catalogue so that proper translations can be done. As an example, CUPS has a translation of the string "Unknown printer-op-policy \"%s\"." into French as "Paramètre printer-op-policy « %s » inconnu." This is clearly not a simple mechanical translation: The quote marks have changed, the order of words has changed, and a new word has been added.
The downside to the gettext() method is that each and every string has to be translated by hand. This means adding a new strings (or modifying one) means that a new translation must be done by a human being. But this is also its upside: as a result, translations that sound right in the native language can be used. Whether they do depends on the ability of the translator, of course.
The only time your concern would matter is if you are trying to print out a single word (or small phrase) that, depending on context, has wildly different meanings. While possible, this is rare, and can be worked around easily enough. Your example of “comment” is not susceptible; at least, not in the examples used: _("1 comment") would look up a different translation than _("give comment").
gettext() is not perfect, but it works well in practice.