Examples of OutputFileOptions


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

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

    SoyMsgBundle msgBundle = (new ExtractMsgsVisitor()).exec(soyTree);

    XliffMsgPlugin msgPlugin = new XliffMsgPlugin();

    // Test without target language.
    OutputFileOptions outputFileOptions = new OutputFileOptions();
    CharSequence extractedMsgsFile =
        msgPlugin.generateExtractedMsgsFile(msgBundle, outputFileOptions);

    URL expectedExtractedMsgsFile = Resources.getResource(
        XliffMsgPluginTest.class, "test_data/test-v2_extracted.xlf");
    assertEquals(
        Resources.toString(expectedExtractedMsgsFile, Charsets.UTF_8),
        extractedMsgsFile.toString());

    // Test with target language.
    outputFileOptions.setTargetLocaleString("x-zz");
    extractedMsgsFile = msgPlugin.generateExtractedMsgsFile(msgBundle, outputFileOptions);

    expectedExtractedMsgsFile = Resources.getResource(
        XliffMsgPluginTest.class, "test_data/test-v2_extracted_x-zz.xlf");
    assertEquals(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.