/** * Creates a new TMXContent object and set its content to the given fragment. * @param content The TextFragment object to format. */ public TMXContent (TextFragment content) { setContent(content); }
/** * Sets the flag indicating whether the writer should output * letter-coded content (e.g. to work for OmegaT). * @param value true to output letter-coded content. False otherwise. * @param zeroBased true to have 0-based code, false for unaltered IDs. */ public void setLetterCodedMode (boolean value, boolean zeroBased) { tmxCont.setLetterCodedMode(value, zeroBased); }
/** * Sets the default quote mode to use in escaping the TMX segment content (1 is the default). * @param quoteMode 0=no quote escaped, 1=apos and quot, 2=#39 and quot, * and 3=quot only. */ public void setQuoteMode (int quoteMode) { tmxCont.setQuoteMode(quoteMode); }
writer.writeAttributeString("xml:lang", srcLoc.toBCP47()); writer.writeStartElement("seg"); writer.writeRawXML(tmxCont.setContent(source).toString()); writer.writeRawXML(tmxCont.setContent(target).toString());
private TMXContent tmxCont = new TMXContent(); private LocaleId srcLoc; private LocaleId trgLoc; this.trgLoc = targetLocale; if ( tmxCont.getLetterCodedMode() ) {
/** * Generates a TMX string from the content. * This is the same as calling this.toString(quoteMode, true), * where quoteMode is the value set by {@link #setQuoteMode(int)} or 1 by default. * @return The string formatted in TMX. */ @Override public String toString () { return toString(defaultQuoteMode, true); }
/** * Sets the flag indicating whether the writer should output * workaround codes specific for Trados. * @param value true to output Trados-specific workarounds. False otherwise. */ public void setTradosWorkarounds (boolean value) { tmxCont.setTradosWorkarounds(value); }
writer.writeRawXML(tmxCont.setContent(frag).toString());