/// <summary> /// Insert into xlf file /// </summary> /// <param name="txtEnglishTranslate"></param> private void Add() { if (acceptHotkey.Tag == null) { pascal = ConvertPascalConvention.ToConvention(string.IsNullOrWhiteSpace(txtEnglishTranslate.Text) ? txtText.Text : txtEnglishTranslate.Text); } else { pascal = acceptHotkey.Tag.ToString(); } // A2 insertToClipboard if (IsAlreadyContainedInXlfKeys(pascal, false)) { return; } if (!string.IsNullOrWhiteSpace(pascal)) { var fromL = GetFrom(); var toL = GetTo(); if (fromL == Langs.cs) { // Write czech XmlLocalisationInterchangeFileFormat.Append(fromL, string.Empty, txtText.Text, pascal, filesWithTranslation[fromL]); XmlLocalisationInterchangeFileFormat.Append(toL, string.Empty, txtEnglishTranslate.Text, pascal, filesWithTranslation[toL]); } else { XmlLocalisationInterchangeFileFormat.Append(fromL, string.Empty, txtText.Text, pascal, filesWithTranslation[fromL]); } AddConsts(CA.ToListString(pascal)); } }
public void AppendTest() { var file = @"D:\_Test\sunamo\SunamoCode\ParseAndRemoveNamespacesTest\a.xlf"; XmlLocalisationInterchangeFileFormat.Append("Hello", "Ahoj", "HelloID", file); }