예제 #1
0
		private void WriteSegmentedBackTrans(BTSegment bts)
		{
			CloseTranslationElementIfNeeded();
			foreach (int ws in bts.AvailableTranslations)
			{
				ITsString tssSeg = bts.GetTransForWs(ws);
				string data = tssSeg.Text;
				if (!string.IsNullOrEmpty(tssSeg.Text))
				{
					OpenTrGroupIfNeeded();
					MarkBackTranslation(ws, bts.GetBtStatusForWs(ws), true);
					m_writer.Formatting = Formatting.None;
					WriteSegmentAnnotations(bts, data, ws);
					WriteBtSegment(tssSeg);
					m_writer.WriteEndElement();
					if (!InFootnote) // Don't want to add whitespace if we're in a footnote or picture since they need to be inline.
						m_writer.Formatting = Formatting.Indented;
				}
			}
			CloseTrGroupIfNeeded();

			// Write any annotations for back translation.
			if (bts.TargetObject is IStTxtPara && ((IStTxtPara)bts.TargetObject).TranslationsOC.Count > 0)
			{
				BackTranslationInfo btInfo = GetBackTranslationForPara((IStTxtPara)bts.TargetObject);
				if (btInfo != null)
					ExportAnnotationsForObj(btInfo.Hvo);
			}
		}
예제 #2
0
		private void WriteSegmentedBackTrans(BTSegment bts, int iseg)
		{
//#if DEBUG
//            WriteSegmentedBackTransDebugInfo(bts, iseg);
//#endif
			CloseTranslationElementIfNeeded();
			foreach (int ws in bts.AvailableTranslations)
			{
				ITsString tss = bts.GetTransForWs(ws);
				string data = tss.Text;
				if (!String.IsNullOrEmpty(data))
				{
					OpenTrGroupIfNeeded();
					m_writer.WriteStartElement("bt");
					m_writer.WriteAttributeString("xml", "lang", null, m_dictAnalLangs[ws]);
					m_writer.WriteAttributeString("segmented", "true");
					string status = bts.GetBtStatusForWs(ws);
					if (!String.IsNullOrEmpty(status))
						m_writer.WriteAttributeString("status", status.ToLower());
					//  OxesInfo xinfo = OxesInfo.GetOxesInfoForCharStyle(styleName);
					//  if (!String.IsNullOrEmpty(xinfo.XmlTag))
					//  {
					//      m_writer.WriteStartElement(xinfo.XmlTag);
					//      if (!String.IsNullOrEmpty(xinfo.AttrName) && !String.IsNullOrEmpty(xinfo.AttrValue))
					//          m_writer.WriteAttributeString(xinfo.AttrName, xinfo.AttrValue);
					//  }
					m_writer.Formatting = Formatting.None;
					WriteSegmentAnnotations(bts, data, ws);
					m_writer.WriteString(data.Normalize());
					m_writer.WriteEndElement();
					m_writer.Formatting = Formatting.Indented;
				}
			}
			CloseTrGroupIfNeeded();
		}