/// ------------------------------------------------------------------------------------ /// <summary> /// Create a back translation from a format string, and attach it to the /// given paragraph. /// </summary> /// <param name="scrInMemoryCache">in-memory cache to use for testing</param> /// <param name="book">book to use</param> /// <param name="para">the paragraph that will own this back translation</param> /// <param name="format">(See CreateText for the definition of the format string)</param> /// <param name="ws">writing system of the back translation</param> /// ------------------------------------------------------------------------------------ internal static void AddBackTranslation(ScrInMemoryFdoCache scrInMemoryCache, IScrBook book, StTxtPara para, string format, int ws) { ICmTranslation cmTrans = para.GetOrCreateBT(); // Set the translation string for the given WS cmTrans.Translation.GetAlternative(ws).UnderlyingTsString = ScrInMemoryFdoCache.CreateFormatText(book, null, format, ws); }