/** * Set the current {@link TextUnit} name. * * @param name * the name (resname in XLIFF) of the {@link TextUnit} * @throws NullPointerException * if there is no current {@link TextUnit} */ public void setTextUnitName(String name) { ITextUnit tu = peekMostRecentTextUnit(); if (tu != null) { tu.setName(name); } }
Code.stringToCodes(result.getString(7)), false); tu.setTargetContent(targetLocale, tf); tu.setName(result.getString(1)); attributes.put(NGRPNAME, result.getString(2)); attributes.put(NFILENAME, result.getString(3));
tuRes = new TextUnit(String.valueOf(++tuId), unescape(value)); tuRes.setName(key); tuRes.setMimeType(MimeTypeMapper.PROPERTIES_MIME_TYPE); tuRes.setPreserveWhitespaces(true);
tu.setSourceContent(tf); tu.setMimeType(MimeTypeMapper.MIF_MIME_TYPE); tu.setName(resname); resname = null; processILC(tu); queue.add(new Event(EventType.TEXT_UNIT, tu, skel));
public ITextUnit convert (Unit unit) { ITextUnit tu = new TextUnit(unit.getId()); tu.setName(unit.getName()); tu.setType(unit.getType());
tu.setMimeType(MimeTypeMapper.TS_MIME_TYPE); if (ts.messageId != null) { tu.setName(ts.messageId);
String name = result.group(rule.nameGroup); if ( name.length() > 0 ) { tuRes.setName(name);
tu.setPreserveWhitespaces(true); tu.setSourceContent(tf); tu.setName(resname); resname = null; tu.setMimeType(MIFSTRING_MIME_TYPE); processILC(tu);
dupTu.setName(tuidProp.getValue());
textUnit.setName(name);
/** * Converts a TranslationUnit to a TextUnit * @param tu The TranslationUnit to convert. * @return The converted TextUnit */ public static ITextUnit convertToTextUnit (TranslationUnit tu) { ITextUnit textUnit; String tuid = tu.getMetadata().get(MetadataType.ID); textUnit = new TextUnit(tuid); if (tuid != null) { textUnit.setName(tuid); } textUnit.setSourceContent(tu.getSource().getContent()); textUnit.setTargetContent(tu.getTarget().getLanguage(), tu.getTarget().getContent()); for (MetadataType type : tu.getMetadata().keySet()) { if (type != MetadataType.ID) { textUnit.setProperty(new Property(type.fieldName(), tu.getMetadata().get(type))); } } return textUnit; }
tu.setName(tu.getId()); // In this case resname == id tu.setSourceContent(item.getSource().getContent()); if ( !item.isTargetEmpty() ) {
tu.setName(ci.idValue);