public ImportResult[] AddTranslationUnits(TranslationUnit[] translationUnits, ImportSettings settings) { var results = _fileBasedTranslationProviderLanguageDirection.AddTranslationUnits(translationUnits, settings); var tmPath = this.TranslationProvider.Uri.AbsolutePath; var tmDataAccess = TmDataAccess.OpenConnection(tmPath); for (int i = 0; i < results.Length; i++) { var result = results[i]; if (result == null) { continue; } var translationUnit = translationUnits[i]; if (result.Action == Action.Add || result.Action == Action.Merge || result.Action == Action.Overwrite) { tmDataAccess.AddOrUpdateSourceFile(result.TuId.Id, translationUnit.DocumentProperties.LastOpenedAsPath); } } return(results); }
public ImportResult[] AddTranslationUnits(TranslationUnit[] translationUnits, ImportSettings settings) { var results = _fileBasedTranslationProviderLanguageDirection.AddTranslationUnits(translationUnits, settings); var tmDataAccess = TmDataAccess.OpenConnection(TranslationProvider.Uri); for (int i = 0; i < results.Length; i++) { var result = results[i]; if (result == null) { continue; } var translationUnit = translationUnits[i]; 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(results); }
public ImportResult[] AddTranslationUnits(TranslationUnit[] translationUnits, ImportSettings settings) { var results = _fileBasedTranslationProviderLanguageDirection.AddTranslationUnits( translationUnits, settings); ProcessTranslationUnits(translationUnits, results); return(results); }