├── .gitattributes ├── .gitignore ├── .gitmodules ├── DocumentTranslation.CLI ├── DocumentTranslatorIcon_100.png ├── Program.cs ├── Properties │ ├── Resources.Designer.cs │ ├── Resources.resx │ └── launchSettings.json ├── doctr.csproj ├── testDocTr.cmd └── testDocTrSet.cmd ├── DocumentTranslation.GUI ├── App.xaml ├── App.xaml.cs ├── AssemblyInfo.cs ├── Categories.cs ├── DocumentTranslation.GUI.csproj ├── DocumentTranslatorIcon_100.ico ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties │ ├── Resources.Designer.cs │ ├── Resources.de-de.resx │ ├── Resources.es-es.resx │ ├── Resources.fr-fr.resx │ ├── Resources.it-it.resx │ └── Resources.resx ├── Resources │ └── Version.txt ├── ShowErrors.xaml ├── ShowErrors.xaml.cs ├── UISettingsSetter.cs └── ViewModel.cs ├── DocumentTranslation.Setup ├── DocumentTranslation.Setup.wixproj ├── LICENSE.rtf ├── Product.wxs └── ZipItUp.cmd ├── DocumentTranslation.sln ├── DocumentTranslationService ├── AppSettingsSetter.cs ├── CredentialsException.cs ├── DocTransAppSettings.cs ├── DocumentTranslationBusiness.cs ├── DocumentTranslationService.cs ├── DocumentTranslationService.csproj ├── FlightPolicy.cs ├── GetCapabilities.cs ├── Glossary.cs ├── HttpClientFactory.cs ├── InvalidCategoryException.cs ├── KeyVaultAccess.cs ├── KeyVaultAccessException.cs ├── Language.cs ├── LocalFormats │ ├── LocalDocumentTranslationFileFormat.cs │ ├── LocalFormats.cs │ ├── SRTCaptionInfo.cs │ ├── SRTMarkdownConverter.cs │ └── StringCompression.cs ├── Logger.cs ├── StatusResponse.cs ├── TestCredentials.cs └── TextTranslationService.cs ├── LICENSE.md ├── README.md └── docs ├── images ├── AppPrivateEndpoint.png ├── AzureKeyVault.png ├── AzureKeyVaultOverview.png ├── AzurePrivateEndpoint.png ├── Glossary.png ├── Logo.png ├── Running.png ├── SettingsDialog.png ├── TextTranslate.png ├── TranslateDocuments.png ├── connectionstring.png ├── storageaccount1.png ├── translatoraccount.png └── translatorkey.png └── index.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd 364 | /DocumentTranslation.GUI/Properties/BuildDate.txt 365 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftTranslator/DocumentTranslation/cc395704b7c210578279055e829bdff50c4953ad/.gitmodules -------------------------------------------------------------------------------- /DocumentTranslation.CLI/DocumentTranslatorIcon_100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftTranslator/DocumentTranslation/cc395704b7c210578279055e829bdff50c4953ad/DocumentTranslation.CLI/DocumentTranslatorIcon_100.png -------------------------------------------------------------------------------- /DocumentTranslation.CLI/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace DocumentTranslation.CLI.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DocumentTranslation.CLI.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to ERROR: Missing or invalid credentials. Use the 'config set' command to set values.. 65 | /// 66 | internal static string msg_MissingCredentials { 67 | get { 68 | return ResourceManager.GetString("msg_MissingCredentials", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to ERROR: Translator service: . 74 | /// 75 | internal static string msg_ServerMessage { 76 | get { 77 | return ResourceManager.GetString("msg_ServerMessage", resourceCulture); 78 | } 79 | } 80 | 81 | /// 82 | /// Looks up a localized string similar to ERROR: Missing or invalid resource name. Use the 'config set name' command to set value.. 83 | /// 84 | internal static string msg_WrongResourceName { 85 | get { 86 | return ResourceManager.GetString("msg_WrongResourceName", resourceCulture); 87 | } 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /DocumentTranslation.CLI/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | ERROR: Missing or invalid credentials. Use the 'config set' command to set values. 122 | 123 | 124 | ERROR: Translator service: 125 | 126 | 127 | ERROR: Missing or invalid resource name. Use the 'config set name' command to set value. 128 | 129 | -------------------------------------------------------------------------------- /DocumentTranslation.CLI/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "TestDocumentTranslation": { 4 | "commandName": "Project", 5 | "commandLineArgs": "config test" 6 | }, 7 | "TranslateWGlossary": { 8 | "commandName": "Project", 9 | "commandLineArgs": "translate d:\\TestDocsSmall --to de --glossary d:\\testdocs\\glossary.tsv" 10 | }, 11 | "TranslateOneDrive": { 12 | "commandName": "Project", 13 | "commandLineArgs": "translate C:\\Users\\wendt\\OneDrive\\Test --to de " 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /DocumentTranslation.CLI/doctr.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | DocumentTranslation.CLI 7 | 0.0.5 8 | Chris Wendt 9 | Document Translation 10 | Translate documents using the Azure Translator service 11 | MIT license 12 | 13 | https://github.com/MicrosoftTranslator/DocumentTranslation 14 | DocumentTranslatorIcon_100.png 15 | https://github.com/MicrosoftTranslator/DocumentTranslation 16 | Github 17 | Initial pre-release. 18 | en 19 | 0.0.8.0 20 | 0.0.8.0 21 | true 22 | false 23 | OnBuildSuccess 24 | DocumentTranslation.CLI.Program 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | True 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | True 45 | True 46 | Resources.resx 47 | 48 | 49 | 50 | 51 | 52 | ResXFileCodeGenerator 53 | Resources.Designer.cs 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /DocumentTranslation.CLI/testDocTr.cmd: -------------------------------------------------------------------------------- 1 | cd bin\Debug\net6.0 2 | doctr languages 3 | pause 4 | doctr formats 5 | pause 6 | doctr clear 7 | pause 8 | doctr config test 9 | pause 10 | doctr config list 11 | pause 12 | doctr glossary 13 | pause 14 | doctr translate d:\TestDocsSmall --to de --glossary d:\glossary.tsv -------------------------------------------------------------------------------- /DocumentTranslation.CLI/testDocTrSet.cmd: -------------------------------------------------------------------------------- 1 | REM fill all the with the values from your Azure portal 2 | cd bin\debug\net6.0 3 | doctr config set --key 4 | doctr config set --storage 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DocumentTranslation.GUI/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace DocumentTranslation.GUI 4 | { 5 | /// 6 | /// Interaction logic for App.xaml 7 | /// 8 | public partial class App : Application 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DocumentTranslation.GUI/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo( 4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 5 | //(used if a resource is not found in the page, 6 | // or application resource dictionaries) 7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 8 | //(used if a resource is not found in the page, 9 | // app, or any theme specific resource dictionaries) 10 | )] 11 | -------------------------------------------------------------------------------- /DocumentTranslation.GUI/Categories.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.IO; 4 | using System.Text.Json; 5 | 6 | namespace DocumentTranslation.GUI 7 | { 8 | public class Categories 9 | { 10 | public BindingList MyCategoryList { get; set; } = new(); 11 | 12 | const string AppName = "Document Translation"; 13 | const string AppSettingsFileName = "CustomCategories.json"; 14 | 15 | public Categories() 16 | { 17 | Read(); 18 | } 19 | 20 | private void Read() 21 | { 22 | string categoriesJson; 23 | try 24 | { 25 | string filename = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + AppName + Path.DirectorySeparatorChar + AppSettingsFileName; 26 | categoriesJson = File.ReadAllText(filename); 27 | } 28 | catch (Exception ex) 29 | { 30 | if (ex is FileNotFoundException || ex is DirectoryNotFoundException) 31 | { 32 | MyCategoryList.Add(new MyCategory("Category 1", "")); 33 | MyCategoryList.Add(new MyCategory("Category 2", "")); 34 | return; 35 | } 36 | throw; 37 | } 38 | try 39 | { 40 | MyCategoryList = JsonSerializer.Deserialize>(categoriesJson, new JsonSerializerOptions { IncludeFields = true }); 41 | } 42 | catch 43 | { 44 | MyCategoryList.Add(new MyCategory("Category 1", "")); 45 | MyCategoryList.Add(new MyCategory("Category 2", "")); 46 | } 47 | } 48 | 49 | public void Write(string filename = null) 50 | { 51 | if (string.IsNullOrEmpty(filename)) 52 | { 53 | Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + AppName); 54 | filename = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + AppName + Path.DirectorySeparatorChar + AppSettingsFileName; 55 | } 56 | File.WriteAllText(filename, JsonSerializer.Serialize(this.MyCategoryList, new JsonSerializerOptions { IncludeFields = true, WriteIndented = true })); 57 | } 58 | } 59 | 60 | public class MyCategory 61 | { 62 | public string Name { get; set; } 63 | public string ID { get; set; } 64 | 65 | public MyCategory(string name, string iD) 66 | { 67 | Name = name; 68 | ID = iD; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /DocumentTranslation.GUI/DocumentTranslation.GUI.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | net8.0-windows7.0 6 | true 7 | true 8 | DocumentTranslatorIcon_100.ico 9 | 1.0.0.0 10 | 1.0.0.0 11 | en-US 12 | 13 | 14 | 15 | 16 | True 17 | True 18 | Resources.resx 19 | 20 | 21 | Resources.resx 22 | True 23 | True 24 | 25 | 26 | 27 | 28 | 29 | PublicResXFileCodeGenerator 30 | Resources.Designer.cs 31 | 32 | 33 | Designer 34 | Resources.Designer.cs 35 | PublicResXFileCodeGenerator 36 | 37 | 38 | 39 | 40 | 41 | Always 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /DocumentTranslation.GUI/DocumentTranslatorIcon_100.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftTranslator/DocumentTranslation/cc395704b7c210578279055e829bdff50c4953ad/DocumentTranslation.GUI/DocumentTranslatorIcon_100.ico -------------------------------------------------------------------------------- /DocumentTranslation.GUI/Properties/Resources.es-es.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | BuildDate.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 123 | 124 | 125 | ..\Resources\Version.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 126 | 127 | 128 | Agregar 129 | 130 | 131 | Hojear 132 | 133 | 134 | Cancelar 135 | 136 | 137 | Claro 138 | 139 | 140 | Cerrar 141 | 142 | 143 | Borrar 144 | 145 | 146 | Salvar 147 | 148 | 149 | Escoger 150 | 151 | 152 | Mostrar errores 153 | 154 | 155 | Prueba 156 | 157 | 158 | Traducir 159 | 160 | 161 | Traducir documentos 162 | 163 | 164 | Detección automática 165 | 166 | 167 | Región de Azure: 168 | 169 | 170 | Categoría: 171 | 172 | 173 | ID de categoría de traductor personalizado 174 | 175 | 176 | Nombre 177 | 178 | 179 | Punto de enlace de traducción de documentos: 180 | 181 | 182 | Documentos a traducir: 183 | 184 | 185 | Traducción de documentos | 186 | 187 | 188 | Experimental 189 | 190 | 191 | Vuelo: 192 | 193 | 194 | De: 195 | 196 | 197 | Glosarios | 198 | 199 | 200 | Glosario a utilizar (opcional): 201 | 202 | 203 | Entrada: 204 | 205 | 206 | URI del Almacén de claves de Azure: 207 | 208 | 209 | Nuevo ID de categoría 210 | 211 | 212 | Nuevo nombre de categoría 213 | 214 | 215 | Mostrar lenguajes experimentales: 216 | 217 | 218 | Cadena de conexión de almacenamiento: 219 | 220 | 221 | Clave de recurso: 222 | 223 | 224 | Carpeta de destino: 225 | 226 | 227 | Ensayo... 228 | 229 | 230 | Extremo de traducción de texto: 231 | 232 | 233 | Para: 234 | 235 | 236 | Traducción: 237 | 238 | 239 | Bytes 240 | 241 | 242 | Cancelado 243 | 244 | 245 | Cancelar... 246 | 247 | 248 | Categorías guardadas 249 | 250 | 251 | Personajes cargados: 252 | 253 | 254 | Completado: 255 | 256 | 257 | documento(s) traducido(s) 258 | 259 | 260 | Documentos cargados. 261 | 262 | 263 | Carga de documentos ... 264 | 265 | 266 | Hecho 267 | 268 | 269 | Error 270 | 271 | 272 | Fracasado: 273 | 274 | 275 | Archivos 276 | 277 | 278 | En curso: 279 | 280 | 281 | Credenciales no válidas 282 | 283 | 284 | Obtenga credenciales válidas e ingrese en Configuración 285 | 286 | 287 | idioma seleccionado 288 | 289 | 290 | idiomas seleccionados 291 | 292 | 293 | Inicia sesión con tu cuenta profesional o educativa. 294 | 295 | 296 | Nombre del recurso incorrecto o no es una suscripción de pago 297 | 298 | 299 | Se requiere una suscripción de nivel S1 o superior. 300 | 301 | 302 | Configuración guardada 303 | 304 | 305 | Haber iniciado sesión 306 | 307 | 308 | Iniciar sesión ... 309 | 310 | 311 | Error del contenedor de almacenamiento 312 | 313 | 314 | Prueba fallida 315 | 316 | 317 | Prueba superada 318 | 319 | 320 | caracteres traducidos 321 | 322 | 323 | Error 324 | 325 | 326 | Categoría no válida 327 | 328 | 329 | Espera: 330 | 331 | 332 | Acerca de 333 | 334 | 335 | Autenticación 336 | 337 | 338 | Categorías 339 | 340 | 341 | Documentación 342 | 343 | 344 | Idiomas 345 | 346 | 347 | Configuración 348 | 349 | 350 | Traducir documentos 351 | 352 | 353 | Traducir texto 354 | 355 | 356 | Fecha de construcción: 357 | 358 | 359 | Esta lista de nombres de categoría proporciona un fácil acceso a un nombre descriptivo para los sistemas de traducción personalizados que ha creado con Custom Translator. Más información en http://customtranslator.ai. No es necesario usar esto a menos que haya creado un sistema de traducción personalizado. 360 | 361 | 362 | Cómo obtener las credenciales de servicio. 363 | 364 | 365 | La traducción de documentos utiliza códigos de idioma ISO para referirse a un idioma. Esta tabla ayuda a identificar dónde coloca Document Translation un archivo cuando se utiliza un '*' en el nombre de la carpeta de destino. 366 | 367 | 368 | Abrir en el navegador 369 | 370 | 371 | Obtenga la clave de recursos, la región de Azure, los puntos de conexión y la cadena de conexión de almacenamiento del Portal de Azure o del administrador de Azure de su organización. Si tiene un URI del Almacén de claves de Azure, no es necesario rellenar los demás campos. 372 | 373 | 374 | Versión: 375 | 376 | 377 | Errores de traducción de documentos 378 | 379 | 380 | Traducción de documentos 381 | 382 | 383 | La región de Azure en la que reside el recurso de Translator. 384 | 385 | 386 | Utilice la pestaña "Configuración", "Categorías" para definir un conjunto de categorías de traductor personalizado que desea utilizar. Deje la selección clara si no está utilizando Custom Translator. 387 | 388 | 389 | Borra la selección de una categoría. No elimina la categoría de su conjunto de categorías disponibles. 390 | 391 | 392 | El extremo del servicio de traducción de documentos. Para Azure public https://<resource name>.cognitiveservices.azure.com. 393 | 394 | 395 | Si recibió un código de Microsoft para la funcionalidad experimental, escríbalo aquí 396 | 397 | 398 | Obtenga el URI del Almacén de claves de Azure del administrador de Azure profesional o educativo. O 'Borrar' para proporcionar la configuración usted mismo. 399 | 400 | 401 | Guarde la configuración anterior en su dispositivo. 402 | 403 | 404 | Si mostrar los idiomas que el servicio Translator considera experimentales. Los idiomas experimentales pueden no estar disponibles en ambas direcciones y la traducción puede fallar. Déjelo sin marcar a menos que necesite experimentar con idiomas no totalmente compatibles. 405 | 406 | 407 | Copie la "Cadena de conexión" de la página Propiedades del recurso Almacenamiento de la suscripción de Azure. 408 | 409 | 410 | Copie la "Clave 1" o la "Clave 2" del recurso Traductor en su suscripción de Azure. 411 | 412 | 413 | Indique la carpeta de destino. '*' muestra dónde debe ir el ID de idioma. 414 | 415 | 416 | Invoque una prueba de la configuración anterior. Mostrará un resultado aprobado o no aprobado. 417 | 418 | 419 | Punto de conexión de traducción de texto de Azure Translator 420 | 421 | 422 | Establezca esta propiedad en true cuando las solicitudes deban autenticarse en un servidor proxy utilizando las credenciales del usuario que ha iniciado sesión actualmente. 423 | 424 | 425 | Usar credenciales predeterminadas (proxy) 426 | 427 | 428 | Dirección proxy 429 | 430 | 431 | Dirección que se utilizará para las solicitudes http proxy. 432 | 433 | -------------------------------------------------------------------------------- /DocumentTranslation.GUI/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Add 122 | 123 | 124 | Browse 125 | 126 | 127 | Cancel 128 | 129 | 130 | Clear 131 | 132 | 133 | Delete 134 | 135 | 136 | Save 137 | 138 | 139 | Select 140 | 141 | 142 | Test 143 | 144 | 145 | Translate 146 | 147 | 148 | Translate Documents 149 | 150 | 151 | Azure Region: 152 | 153 | 154 | Category: 155 | 156 | 157 | Custom Translator Category ID 158 | 159 | 160 | Name 161 | 162 | 163 | Documents to translate: 164 | 165 | 166 | From: 167 | 168 | 169 | Glossary to use (optional): 170 | 171 | 172 | Input: 173 | 174 | 175 | Document Translation Endpoint: 176 | 177 | 178 | Show experimental languages: 179 | 180 | 181 | Storage Connection String: 182 | 183 | 184 | Resource Key: 185 | 186 | 187 | Target folder: 188 | 189 | 190 | To: 191 | 192 | 193 | Translation: 194 | 195 | 196 | bytes 197 | 198 | 199 | Canceled 200 | 201 | 202 | Canceling... 203 | 204 | 205 | Categories saved 206 | 207 | 208 | Characters Charged: 209 | 210 | 211 | Completed: 212 | 213 | 214 | document(s) translated 215 | 216 | 217 | Documents uploaded. 218 | 219 | 220 | Done 221 | 222 | 223 | Failed: 224 | 225 | 226 | In progress: 227 | 228 | 229 | Invalid credentials 230 | 231 | 232 | Please obtain valid credentials and enter in Settings 233 | 234 | 235 | Settings saved 236 | 237 | 238 | Test failed 239 | 240 | 241 | Test passed 242 | 243 | 244 | Error 245 | 246 | 247 | Invalid Category 248 | 249 | 250 | Waiting: 251 | 252 | 253 | Authentication 254 | 255 | 256 | Categories 257 | 258 | 259 | Settings 260 | 261 | 262 | Translate Documents 263 | 264 | 265 | Translate Text 266 | 267 | 268 | This list of category names provides easy access to a friendly name for custom translation systems you have built with Custom Translator. More information at http://customtranslator.ai. No need to use this unless you have built a custom translation system. 269 | 270 | 271 | Obtain the resource key, the Azure region, the endpoints and the storage connection string from the Azure portal or from your organization's Azure administrator. If you have an Azure Key Vault URI, no need to fill the other fields. 272 | 273 | 274 | Document Translation 275 | App title 276 | 277 | 278 | The Azure region your Translator resource resides in. 279 | 280 | 281 | Use the "Settings" tab, "Categories" to define a set of Custom Translator categories you want to use. Leave the selection clear if you are not using Custom Translator. 282 | 283 | 284 | Clears the selection of a category. Does not remove the category fron your set of available categories. 285 | 286 | 287 | The endpoint of the document Translation Service. For Azure public https://<resource name>.cognitiveservices.azure.com. 288 | 289 | 290 | Save the above settings on your device. 291 | 292 | 293 | Whether to show the languages the Translator service considers experimental. Experimental languages may not be available in both directions and the translation can fail. Leave unchecked unless you need to experiment with not fully supported languages. 294 | 295 | 296 | Copy the "Connection String" from the Properties page of the Storage resource in your Azure subscription. 297 | 298 | 299 | Copy the "Key 1" or "Key 2" of the Translator resource in your Azure subscription. 300 | 301 | 302 | Invoke a test of the above settings. Will show a pass or fail result. 303 | 304 | 305 | characters translated 306 | 307 | 308 | How to obtain the service credentials. 309 | 310 | 311 | Open in browser 312 | 313 | 314 | 315 | BuildDate.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 316 | 317 | 318 | Build date: 319 | 320 | 321 | Testing... 322 | 323 | 324 | Storage container error 325 | 326 | 327 | S1 or higher tier subscription is required. 328 | 329 | 330 | Error 331 | 332 | 333 | Resource name incorrect or not a paid subscription 334 | 335 | 336 | New category name 337 | 338 | 339 | New category ID 340 | 341 | 342 | Auto-Detect 343 | 344 | 345 | Experimental 346 | 347 | 348 | Azure Key Vault URI: 349 | 350 | 351 | Please sign in with your work or school account. 352 | 353 | 354 | Obtain the URI of the Azure Key Vault from your work or school Azure administrator. Or 'Clear' to supply the settings yourself. 355 | 356 | 357 | Document upload ... 358 | 359 | 360 | files 361 | 362 | 363 | Show Errors 364 | 365 | 366 | Document translation errors 367 | 368 | 369 | Close 370 | 371 | 372 | Document Translation| 373 | Used for the file filter dialog. 374 | 375 | 376 | Glossaries| 377 | Used in the file filtering dialog. 378 | 379 | 380 | Signing in ... 381 | 382 | 383 | Signed in 384 | 385 | 386 | languages selected 387 | 388 | 389 | language selected 390 | 391 | 392 | Indicate the target folder. '*' shows where the language ID should go. 393 | 394 | 395 | Text Translation Endpoint: 396 | 397 | 398 | Azure Translator Text Translation Endpoint 399 | 400 | 401 | Flight: 402 | 403 | 404 | If you received a code from Microsoft for experimental functionality, enter it here 405 | 406 | 407 | Document Translation uses ISO language codes to refer to a language. This table helps identify where Document Translation places a file when you use a '*' in the target folder name. 408 | 409 | 410 | About 411 | 412 | 413 | Documentation 414 | 415 | 416 | Languages 417 | 418 | 419 | Version: 420 | 421 | 422 | ..\Resources\Version.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 423 | 424 | 425 | Set this property to true when requests should be authenticated against a proxy server using the credentials of the currently logged on user. 426 | 427 | 428 | Use Default Credentials (Proxy): 429 | 430 | 431 | Proxy Address: 432 | 433 | 434 | Address to be used for proxying http requests. 435 | 436 | -------------------------------------------------------------------------------- /DocumentTranslation.GUI/Resources/Version.txt: -------------------------------------------------------------------------------- 1 | 1.0.3.0 -------------------------------------------------------------------------------- /DocumentTranslation.GUI/ShowErrors.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |