Problem with import tmx

Hi All

I have a strange problem when i'm trying to import TMX file. Below is my function:

public string MemoryImport(string file, bool check, bool is_doc_import,string invalidUits,string tmfile)
        {
            
            FileBasedTranslationMemory tm1 = new FileBasedTranslationMemory(@"C:\1\tst.sdltm");


            System.Windows.Forms.MessageBox.Show(tm1.GetTranslationUnitCount().ToString());
            TranslationMemoryImporter import= new TranslationMemoryImporter(tm1.LanguageDirection);

            import.ImportSettings.IsDocumentImport = is_doc_import;
            import.ImportSettings.ExistingFieldsUpdateMode = Sdl.LanguagePlatform.TranslationMemory.ImportSettings.FieldUpdateMode.Merge;
            import.ImportSettings.NewFields = Sdl.LanguagePlatform.TranslationMemory.ImportSettings.NewFieldsOption.AddToSetup;
            import.ImportSettings.InvalidTranslationUnitsExportPath = invalidUits;
            import.ImportSettings.OverwriteExistingTUs = true;
                import.Import(@"C:\1\n.tmx");
            Sdl.LanguagePlatform.TranslationMemory.ImportStatistics stats = import.Statistics;
            
            string ret = tm1.Name + "\r\nAdded Tus: " + stats.AddedTranslationUnits.ToString() + "\r\nMerged TUS: " +
                         stats.MergedTranslationUnits.ToString() + "\r\nBad TUS: " +
                         stats.BadTranslationUnits.ToString() + "\r\n\r\n";
            return ret;
            tm1.Save();
        }

It fails on higlighted line with message: The language resource file could not be located.

Memory is loaded properly (correct number of tus is displayed in messagebox),tmx file does exist.

Any ideas?

Parents Reply Children
No Data