Adding a translation phrase to WordPress Theme

Here is an idea or two that you can pursue here: (CAVEAT: Untested)

OPTION 1

In your template file (use a child theme if this is not your own theme), use get_locale in a conditional statement to check which language is set in WPLANG and then dish up the text according to the locale

OPTION 2

Create yourself a function (which will be the ideal solution and what you are actually asking) using the gettext or gettext_with_context filter depending on your string context.

In conjuction with get_locale() you can then get and transalte and serve the correct translated string according to the language set