In code you can use goog.getMsg() and you can supply a .xtb file to
the compiler (which is as far as I could tell a non-standard format,
but it's pretty easy to work it out from reading the code).
Separately, soy templates have unrelated support to use xliff files,
but that doesn't integrate with goog.getMsg in any way.
If you're using plovr, you can try
https://codereview.appspot.com/6194048/ which adds XTB support to
plovr and
https://codereview.appspot.com/6201051/ on top of that if
you want to use XLIFF files. Someone on the plovr list reported
success with using those, although that's all a bit dated.