コード例 #1
0
 public static void doImport(String sourcelang, String targetlang, String folder, String tmxfile)
     throws IOException {
   Language source = new Language(sourcelang);
   Language target = new Language(targetlang);
   TMXSaver saver = new TMXSaver(source.getLanguage(), target.getLanguage(), tmxfile);
   FolderScanner scanner = new FolderScanner(folder, target.getLocale(), saver);
   scanner.scan();
   saver.save();
 }
コード例 #2
0
ファイル: TMXReader2.java プロジェクト: ryancar/OmegaT
  protected void parseHeader(StartElement element, final Language sourceLanguage) {
    isParagraphSegtype = SEG_PARAGRAPH.equals(getAttributeValue(element, "segtype"));
    isOmegaT = CT_OMEGAT.equals(getAttributeValue(element, "creationtool"));

    // log some details
    Log.logRB("TMXR_INFO_CREATION_TOOL", new Object[] {getAttributeValue(element, "creationtool")});
    Log.logRB(
        "TMXR_INFO_CREATION_TOOL_VERSION",
        new Object[] {getAttributeValue(element, "creationtoolversion")});
    Log.logRB("TMXR_INFO_SEG_TYPE", new Object[] {getAttributeValue(element, "segtype")});
    Log.logRB("TMXR_INFO_SOURCE_LANG", new Object[] {getAttributeValue(element, "srclang")});

    // give a warning if the TMX source language is
    // different from the project source language
    String tmxSourceLanguage = getAttributeValue(element, "srclang");
    if (!tmxSourceLanguage.equalsIgnoreCase(sourceLanguage.getLanguage())) {
      Log.logWarningRB(
          "TMXR_WARNING_INCORRECT_SOURCE_LANG", new Object[] {tmxSourceLanguage, sourceLanguage});
    }

    // give a warning that TMX file will be upgraded to sentence segmentation
    if (isSegmentingEnabled && isParagraphSegtype) {
      Log.logWarningRB("TMXR_WARNING_UPGRADE_SENTSEG");
    }
  }