Technically the codeblock is not within the theme as it is a core funciton. I have never tried this use case. Perhaps the theme based translation is not yet loaded when the codeblock is executed. It should use the current theme but try to set it specifially as the 2nd parameter.
Thanks for the feedback. Know the problem with several sites Sure, you should be able to create a simple basically functionless plugin which just consists of strings to translate. However if these strings are still site/theme related they should be in the theme IMHO.