.add(Resources.getResource("features.soy"))
.setCompileTimeGlobals(Resources.getResource("FeaturesUsage_globals.txt"))
.build();
SoyTofu tofu = sfs.compileToTofu().forNamespace("soy.examples.features");
SoyMsgBundle msgBundle;
if (locale.length() > 0) {
// Use translations from an XLIFF file.
SoyMsgBundleHandler msgBundleHandler = injector.getInstance(SoyMsgBundleHandler.class);
URL xliffResource = Resources.getResource(XLIFF_RESOURCE_PREFIX + locale + ".xlf");
msgBundle = msgBundleHandler.createFromResource(xliffResource);
if (msgBundle.getLocaleString() == null) {
throw new IOException(
"Error reading message resource \"" + XLIFF_RESOURCE_PREFIX + locale + ".xlf\".");
}
} else {
// Use the messages from the Soy source files.