Package com.google.template.soy.msgs

Examples of com.google.template.soy.msgs.SoyMsgBundleHandler$OutputFileOptions


    SoyFileSet sfs = sfsBuilder.build();

    SoyMsgBundle msgBundle = sfs.extractMsgs();

    SoyMsgBundleHandler msgBundleHandler = injector.getInstance(SoyMsgBundleHandler.class);
    OutputFileOptions options = new OutputFileOptions();
    options.setSourceLocaleString(sourceLocaleString);
    if (targetLocaleString.length() > 0) {
      options.setTargetLocaleString(targetLocaleString);
    }
    msgBundleHandler.writeToFile(msgBundle, options, outputFile0);
  }
View Full Code Here


    javaSrcOptions.setBidiGlobalDir(bidiGlobalDir);

    // Create SoyMsgBundle.
    SoyMsgBundle msgBundle = null;
    if (messageFilePath.length() > 0) {
      SoyMsgBundleHandler msgBundleHandler = injector.getInstance(SoyMsgBundleHandler.class);
      msgBundle = msgBundleHandler.createFromFile(new File(messageFilePath));
    }

    // Compile.
    String generatedCode = sfs.compileToJavaSrc(javaSrcOptions, msgBundle);
View Full Code Here

    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 {
View Full Code Here

TOP

Related Classes of com.google.template.soy.msgs.SoyMsgBundleHandler$OutputFileOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.