public ImportResult AddTranslationUnit(TranslationUnit translationUnit, ImportSettings settings) { var result = _fileBasedTranslationProviderLanguageDirection.AddTranslationUnit(translationUnit, settings); if (result == null) { return(null); } var tmDataAccess = TmDataAccess.OpenConnection(TranslationProvider.Uri); if (result.Action == Action.Add || result.Action == Action.Merge || result.Action == Action.Overwrite) { var customFieldsValue = new CustomFieldValues { FileNameFullPath = translationUnit.GetFilePath(), ProjectName = translationUnit.GetProjectName() }; tmDataAccess.AddOrUpdateCustomFields(result.TuId.Id, customFieldsValue); } return(result); }
public ImportResult AddTranslationUnit(TranslationUnit translationUnit, ImportSettings settings) { var result = _fileBasedTranslationProviderLanguageDirection.AddTranslationUnit(translationUnit, settings); if (result == null) { return(null); } var translationUnits = new TranslationUnit[] { translationUnit }; var results = new ImportResult[] { result }; ProcessTranslationUnits(translationUnits, results); return(result); }
public ImportResult AddTranslationUnit(TranslationUnit translationUnit, ImportSettings settings) { var result = _fileBasedTranslationProviderLanguageDirection.AddTranslationUnit(translationUnit, settings); if (result == null) { return(null); } var tmDataAccess = TmDataAccess.OpenConnection(TranslationProvider.Uri); if (result.Action == Action.Add || result.Action == Action.Merge || result.Action == Action.Overwrite) { tmDataAccess.AddOrUpdateSourceFile(result.TuId.Id, translationUnit.DocumentProperties.LastOpenedAsPath); } return(result); }