From 2c6b6a7e38fd7594232594342a7ed3dcb99b98c6 Mon Sep 17 00:00:00 2001 From: tom-englert Date: Sat, 6 Jun 2026 16:30:32 +0200 Subject: [PATCH 1/5] Update Microsoft.ML.Tokenizers package to be able to use newer AI models --- .../Topics/Automatic-Translations.md | 32 ++++++++++++++++--- src/Directory.Packages.props | 6 ++-- .../WebExporterOutput/src/resources.it.json | 6 +--- .../src/resources.zh-Hans.json | 6 +--- .../ResXManager.Translators.csproj | 2 ++ .../Properties/AssemblyInfo.cs | 1 + 6 files changed, 37 insertions(+), 16 deletions(-) diff --git a/Documentation/Topics/Automatic-Translations.md b/Documentation/Topics/Automatic-Translations.md index c6129a1f..939f669d 100644 --- a/Documentation/Topics/Automatic-Translations.md +++ b/Documentation/Topics/Automatic-Translations.md @@ -32,10 +32,34 @@ The API URL for Deepl is https://api.deepl.com/v2/translate, but for the free ve #### Configuration - Add a new Azure OpenAI resource using the portal or CLI. - Model availability may vary depending on e.g. region, check the model availabilty [here](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-4-and-gpt-4-turbo-preview-model-availability) -- Deploy the "gpt-3.5-turbo-instruct" (completion based) or "gpt-3.5-turbo"/"gpt-4-turbo" (chat based) model. -- Copy the API key, URL to the endpoint and name of the deployment and model into the settings of the translator - -#### Addtional Settings +- Deploy one of the supported models (see below). +- Copy the API key, URL to the endpoint, deployment name, and model name into the settings of the translator. + +**Important: Understanding Model Name vs. Model Deployment Name** +- **Model Name**: This is the base model identifier used by OpenAI (e.g., "gpt-3.5-turbo", "gpt-4", "gpt-4o"). This is used internally for tokenization and determining which API endpoint to use. +- **Model Deployment Name**: This is the custom name YOU chose when deploying the model in Azure (e.g., "my-gpt4-deployment"). This is what Azure uses to route your API requests. + +> A list of supported models names can be found [here](https://github.com/dotnet/machinelearning/blob/4c8b3579d1053257b213ca54be2681359b66cf65/src/Microsoft.ML.Tokenizers/Model/TiktokenTokenizer.cs#L1069-L1146) + +**Supported Models**: +- **GPT-3.5 Models**: + - `gpt-3.5-turbo-instruct` (completion-based, legacy) + - `gpt-3.5-turbo` (chat-based, recommended for GPT-3.5) + - Note: You can also use `gpt-35-turbo` or `gpt-35-turbo-instruct` (Azure naming), which will be automatically mapped. + +- **GPT-4 Models**: + - `gpt-4` (chat-based) + - `gpt-4-turbo` (chat-based, faster and more cost-effective) + - `gpt-4o` (chat-based, latest multimodal model) + - `gpt-4o-mini` (chat-based, smaller and faster variant) + +**Example Configuration**: +- If you deployed GPT-4 Turbo in Azure with deployment name "my-translation-model": + - **Model Name**: `gpt-4-turbo` + - **Model Deployment Name**: `my-translation-model` + - **Endpoint URL**: `https://your-resource-name.openai.azure.com` + +#### Additional Settings - You can add a custom prompt to your request to improve the translation quality or behavior, e.g. "preserve the html tags in the results" - You can include the comments in your resources in the prompt, to guide the model with additional hints about the context diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 7c6172c0..743370b3 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -13,7 +13,9 @@ - + + + @@ -27,7 +29,7 @@ - + diff --git a/src/ResXManager.Tests/WebExporterOutput/src/resources.it.json b/src/ResXManager.Tests/WebExporterOutput/src/resources.it.json index 9bbbd58a..c75428de 100644 --- a/src/ResXManager.Tests/WebExporterOutput/src/resources.it.json +++ b/src/ResXManager.Tests/WebExporterOutput/src/resources.it.json @@ -1,8 +1,4 @@ { "_comment": "Auto-generated; do not modify!", - "WebExportTest": { - "SimpleString": "", - "WithInterpolation_TEMPLATE": "", - "WithBadInterpolation_TEMPLATE": "" - } + "WebExportTest": {} } \ No newline at end of file diff --git a/src/ResXManager.Tests/WebExporterOutput/src/resources.zh-Hans.json b/src/ResXManager.Tests/WebExporterOutput/src/resources.zh-Hans.json index 9bbbd58a..c75428de 100644 --- a/src/ResXManager.Tests/WebExporterOutput/src/resources.zh-Hans.json +++ b/src/ResXManager.Tests/WebExporterOutput/src/resources.zh-Hans.json @@ -1,8 +1,4 @@ { "_comment": "Auto-generated; do not modify!", - "WebExportTest": { - "SimpleString": "", - "WithInterpolation_TEMPLATE": "", - "WithBadInterpolation_TEMPLATE": "" - } + "WebExportTest": {} } \ No newline at end of file diff --git a/src/ResXManager.Translators/ResXManager.Translators.csproj b/src/ResXManager.Translators/ResXManager.Translators.csproj index 882bb7e5..39fd8c5e 100644 --- a/src/ResXManager.Translators/ResXManager.Translators.csproj +++ b/src/ResXManager.Translators/ResXManager.Translators.csproj @@ -53,6 +53,8 @@ + + diff --git a/src/ResXManager.VSIX/Properties/AssemblyInfo.cs b/src/ResXManager.VSIX/Properties/AssemblyInfo.cs index 4cea7b70..65e3446d 100644 --- a/src/ResXManager.VSIX/Properties/AssemblyInfo.cs +++ b/src/ResXManager.VSIX/Properties/AssemblyInfo.cs @@ -25,6 +25,7 @@ [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Microsoft.Bcl.AsyncInterfaces.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Microsoft.Bcl.HashCode.dll")] +[assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Microsoft.Bcl.Memory.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Microsoft.ML.Tokenizers.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Microsoft.Xaml.Behaviors.dll")] From 68d63ae952160ead3c4532667573c07bcab4b278 Mon Sep 17 00:00:00 2001 From: tom-englert Date: Sat, 6 Jun 2026 17:38:31 +0200 Subject: [PATCH 2/5] Drop VS2019 support --- src/Directory.Packages.props | 5 +- .../ResXManager.Infrastructure.csproj | 2 +- ...anager.VSIX.Compatibility.Shared.projitems | 24 -- ...sXManager.VSIX.Compatibility.Shared.shproj | 13 - .../CustomToolRunner.cs | 0 .../DteConfiguration.cs | 0 .../DteExtensions.cs | 0 .../DteProjectFile.cs | 0 .../DteSolution.cs | 0 .../DteSourceFilesProvider.cs | 104 ++++---- .../ErrorListProviderService.cs | 0 .../ICustomToolRunner.cs | 0 .../PreBuildService.cs | 240 +++++++++--------- .../Properties/AssemblyInfo.cs | 5 + .../Refactorings.cs | 0 .../ResXManager.VSIX.Compatibility.x64.csproj | 6 +- .../VsixCompatibility.cs | 0 .../FodyWeavers.xml | 4 - .../FodyWeavers.xsd | 27 -- .../ResXManager.VSIX.Compatibility.x86.csproj | 20 -- .../Properties/AssemblyInfo.cs | 2 + src/ResXManager.VSIX/ResXManager.VSIX.csproj | 13 +- src/ResXManager.VSIX/VSPackage.cs | 33 +-- .../source.extension.vsixmanifest | 5 +- src/ResXResourceManager.sln | 14 - 25 files changed, 208 insertions(+), 309 deletions(-) delete mode 100644 src/ResXManager.VSIX.Compatibility.Shared/ResXManager.VSIX.Compatibility.Shared.projitems delete mode 100644 src/ResXManager.VSIX.Compatibility.Shared/ResXManager.VSIX.Compatibility.Shared.shproj rename src/{ResXManager.VSIX.Compatibility.Shared => ResXManager.VSIX.Compatibility.x64}/CustomToolRunner.cs (100%) rename src/{ResXManager.VSIX.Compatibility.Shared => ResXManager.VSIX.Compatibility.x64}/DteConfiguration.cs (100%) rename src/{ResXManager.VSIX.Compatibility.Shared => ResXManager.VSIX.Compatibility.x64}/DteExtensions.cs (100%) rename src/{ResXManager.VSIX.Compatibility.Shared => ResXManager.VSIX.Compatibility.x64}/DteProjectFile.cs (100%) rename src/{ResXManager.VSIX.Compatibility.Shared => ResXManager.VSIX.Compatibility.x64}/DteSolution.cs (100%) rename src/{ResXManager.VSIX.Compatibility.Shared => ResXManager.VSIX.Compatibility.x64}/DteSourceFilesProvider.cs (96%) rename src/{ResXManager.VSIX.Compatibility.Shared => ResXManager.VSIX.Compatibility.x64}/ErrorListProviderService.cs (100%) rename src/{ResXManager.VSIX.Compatibility.Shared => ResXManager.VSIX.Compatibility.x64}/ICustomToolRunner.cs (100%) rename src/{ResXManager.VSIX.Compatibility.Shared => ResXManager.VSIX.Compatibility.x64}/PreBuildService.cs (96%) create mode 100644 src/ResXManager.VSIX.Compatibility.x64/Properties/AssemblyInfo.cs rename src/{ResXManager.VSIX.Compatibility.Shared => ResXManager.VSIX.Compatibility.x64}/Refactorings.cs (100%) rename src/{ResXManager.VSIX.Compatibility.Shared => ResXManager.VSIX.Compatibility.x64}/VsixCompatibility.cs (100%) delete mode 100644 src/ResXManager.VSIX.Compatibility.x86/FodyWeavers.xml delete mode 100644 src/ResXManager.VSIX.Compatibility.x86/FodyWeavers.xsd delete mode 100644 src/ResXManager.VSIX.Compatibility.x86/ResXManager.VSIX.Compatibility.x86.csproj diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 743370b3..15ec72ad 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -16,9 +16,9 @@ - + - + @@ -47,7 +47,6 @@ - diff --git a/src/ResXManager.Infrastructure/ResXManager.Infrastructure.csproj b/src/ResXManager.Infrastructure/ResXManager.Infrastructure.csproj index 084063f4..977c7faa 100644 --- a/src/ResXManager.Infrastructure/ResXManager.Infrastructure.csproj +++ b/src/ResXManager.Infrastructure/ResXManager.Infrastructure.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/ResXManager.VSIX.Compatibility.Shared/ResXManager.VSIX.Compatibility.Shared.projitems b/src/ResXManager.VSIX.Compatibility.Shared/ResXManager.VSIX.Compatibility.Shared.projitems deleted file mode 100644 index 523f97bc..00000000 --- a/src/ResXManager.VSIX.Compatibility.Shared/ResXManager.VSIX.Compatibility.Shared.projitems +++ /dev/null @@ -1,24 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - cc3f887f-9602-43f4-aa73-7557b7c6ab1d - - - ResXManager.VSIX.Compatibility.Shared - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ResXManager.VSIX.Compatibility.Shared/ResXManager.VSIX.Compatibility.Shared.shproj b/src/ResXManager.VSIX.Compatibility.Shared/ResXManager.VSIX.Compatibility.Shared.shproj deleted file mode 100644 index a186be3f..00000000 --- a/src/ResXManager.VSIX.Compatibility.Shared/ResXManager.VSIX.Compatibility.Shared.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - cc3f887f-9602-43f4-aa73-7557b7c6ab1d - 14.0 - - - - - - - - diff --git a/src/ResXManager.VSIX.Compatibility.Shared/CustomToolRunner.cs b/src/ResXManager.VSIX.Compatibility.x64/CustomToolRunner.cs similarity index 100% rename from src/ResXManager.VSIX.Compatibility.Shared/CustomToolRunner.cs rename to src/ResXManager.VSIX.Compatibility.x64/CustomToolRunner.cs diff --git a/src/ResXManager.VSIX.Compatibility.Shared/DteConfiguration.cs b/src/ResXManager.VSIX.Compatibility.x64/DteConfiguration.cs similarity index 100% rename from src/ResXManager.VSIX.Compatibility.Shared/DteConfiguration.cs rename to src/ResXManager.VSIX.Compatibility.x64/DteConfiguration.cs diff --git a/src/ResXManager.VSIX.Compatibility.Shared/DteExtensions.cs b/src/ResXManager.VSIX.Compatibility.x64/DteExtensions.cs similarity index 100% rename from src/ResXManager.VSIX.Compatibility.Shared/DteExtensions.cs rename to src/ResXManager.VSIX.Compatibility.x64/DteExtensions.cs diff --git a/src/ResXManager.VSIX.Compatibility.Shared/DteProjectFile.cs b/src/ResXManager.VSIX.Compatibility.x64/DteProjectFile.cs similarity index 100% rename from src/ResXManager.VSIX.Compatibility.Shared/DteProjectFile.cs rename to src/ResXManager.VSIX.Compatibility.x64/DteProjectFile.cs diff --git a/src/ResXManager.VSIX.Compatibility.Shared/DteSolution.cs b/src/ResXManager.VSIX.Compatibility.x64/DteSolution.cs similarity index 100% rename from src/ResXManager.VSIX.Compatibility.Shared/DteSolution.cs rename to src/ResXManager.VSIX.Compatibility.x64/DteSolution.cs diff --git a/src/ResXManager.VSIX.Compatibility.Shared/DteSourceFilesProvider.cs b/src/ResXManager.VSIX.Compatibility.x64/DteSourceFilesProvider.cs similarity index 96% rename from src/ResXManager.VSIX.Compatibility.Shared/DteSourceFilesProvider.cs rename to src/ResXManager.VSIX.Compatibility.x64/DteSourceFilesProvider.cs index 6c6c66c7..3ca99cbf 100644 --- a/src/ResXManager.VSIX.Compatibility.Shared/DteSourceFilesProvider.cs +++ b/src/ResXManager.VSIX.Compatibility.x64/DteSourceFilesProvider.cs @@ -1,52 +1,52 @@ -namespace ResXManager.VSIX; - -using System.Collections.Generic; -using System.Composition; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using ResXManager.Model; -using ResXManager.View.Tools; - -using TomsToolbox.Composition; - -using static Microsoft.VisualStudio.Shell.ThreadHelper; - -[Shared, Export(typeof(ISourceFilesProvider))] -internal sealed class DteSourceFilesProvider : ISourceFilesProvider -{ - private readonly PerformanceTracer _performanceTracer; - private readonly IConfiguration _configuration; - private readonly DteSolution _solution; - - [ImportingConstructor] - public DteSourceFilesProvider(IExportProvider exportProvider) - { - _performanceTracer = exportProvider.GetExportedValue(); - _configuration = exportProvider.GetExportedValue(); - _solution = exportProvider.GetExportedValue(); - } - - public async Task> GetSourceFilesAsync(CancellationToken? cancellationToken) - { - using (_performanceTracer.Start("Enumerate source files")) - { - await JoinableTaskFactory.SwitchToMainThreadAsync(); - - return await Task.FromResult(_solution.GetProjectFiles(new FileFilter(_configuration)).ToList().AsReadOnly()).ConfigureAwait(false); - } - } - - /// - /// Gets the solution folder. - /// - public string SolutionFolder - { - get - { - ThrowIfNotOnUIThread(); - return _solution.SolutionFolder; - } - } -} +namespace ResXManager.VSIX; + +using System.Collections.Generic; +using System.Composition; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +using ResXManager.Model; +using ResXManager.View.Tools; + +using TomsToolbox.Composition; + +using static Microsoft.VisualStudio.Shell.ThreadHelper; + +[Shared, Export(typeof(ISourceFilesProvider))] +internal sealed class DteSourceFilesProvider : ISourceFilesProvider +{ + private readonly PerformanceTracer _performanceTracer; + private readonly IConfiguration _configuration; + private readonly DteSolution _solution; + + [ImportingConstructor] + public DteSourceFilesProvider(IExportProvider exportProvider) + { + _performanceTracer = exportProvider.GetExportedValue(); + _configuration = exportProvider.GetExportedValue(); + _solution = exportProvider.GetExportedValue(); + } + + public async Task> GetSourceFilesAsync(CancellationToken? cancellationToken) + { + using (_performanceTracer.Start("Enumerate source files")) + { + await JoinableTaskFactory.SwitchToMainThreadAsync(); + + return await Task.FromResult(_solution.GetProjectFiles(new FileFilter(_configuration)).ToList().AsReadOnly()).ConfigureAwait(false); + } + } + + /// + /// Gets the solution folder. + /// + public string SolutionFolder + { + get + { + ThrowIfNotOnUIThread(); + return _solution.SolutionFolder; + } + } +} diff --git a/src/ResXManager.VSIX.Compatibility.Shared/ErrorListProviderService.cs b/src/ResXManager.VSIX.Compatibility.x64/ErrorListProviderService.cs similarity index 100% rename from src/ResXManager.VSIX.Compatibility.Shared/ErrorListProviderService.cs rename to src/ResXManager.VSIX.Compatibility.x64/ErrorListProviderService.cs diff --git a/src/ResXManager.VSIX.Compatibility.Shared/ICustomToolRunner.cs b/src/ResXManager.VSIX.Compatibility.x64/ICustomToolRunner.cs similarity index 100% rename from src/ResXManager.VSIX.Compatibility.Shared/ICustomToolRunner.cs rename to src/ResXManager.VSIX.Compatibility.x64/ICustomToolRunner.cs diff --git a/src/ResXManager.VSIX.Compatibility.Shared/PreBuildService.cs b/src/ResXManager.VSIX.Compatibility.x64/PreBuildService.cs similarity index 96% rename from src/ResXManager.VSIX.Compatibility.Shared/PreBuildService.cs rename to src/ResXManager.VSIX.Compatibility.x64/PreBuildService.cs index 218a96e6..b4a3e245 100644 --- a/src/ResXManager.VSIX.Compatibility.Shared/PreBuildService.cs +++ b/src/ResXManager.VSIX.Compatibility.x64/PreBuildService.cs @@ -1,121 +1,121 @@ -namespace ResXManager.VSIX; - -using System; -using System.Collections.Specialized; -using System.Composition; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Threading; - -using Community.VisualStudio.Toolkit; - -using ResXManager.Infrastructure; -using ResXManager.Model; -using ResXManager.View.Tools; -using ResXManager.View.Visuals; -using ResXManager.VSIX.Compatibility; - -using static Microsoft.VisualStudio.Shell.ThreadHelper; - -[Shared] -[Export(typeof(IService))] -internal sealed class PreBuildService : IService, IDisposable -{ - private readonly IErrorListProvider _errorListProvider; - private readonly ResourceManager _resourceManager; - private readonly ResourceViewModel _resourceViewModel; - private readonly XlfSynchronizer _xlfSynchronizer; - private readonly IVsixShellViewModel _shellViewModel; - private readonly IDteConfiguration _configuration; - - [ImportingConstructor] - public PreBuildService( - ResourceManager resourceManager, - ResourceViewModel resourceViewModel, - XlfSynchronizer xlfSynchronizer, - IVsixShellViewModel shellViewModel, - IErrorListProvider errorListProvider, - IDteConfiguration configuration) - { - _errorListProvider = errorListProvider; - _resourceManager = resourceManager; - _resourceViewModel = resourceViewModel; - _xlfSynchronizer = xlfSynchronizer; - _shellViewModel = shellViewModel; - _configuration = configuration; - - resourceManager.TableEntries.CollectionChanged += TableEntries_CollectionChanged; - errorListProvider.Navigate += Provider_Navigate; - - VS.Events.BuildEvents.SolutionBuildStarted += BuildEvents_SolutionBuildStarted; - } - - public void Start() - { - } - - private void TableEntries_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) - { - if (e.Action != NotifyCollectionChangedAction.Remove) - return; - - foreach (var entry in e.OldItems.OfType()) - { - _errorListProvider.Remove(entry); - } - } - - private void Await(Func action) - { - var frame = new DispatcherFrame(); - - void TaskCompleted() - { - frame.Continue = false; - } - - action().GetAwaiter().OnCompleted(TaskCompleted); - - Dispatcher.PushFrame(frame); - } - - private void BuildEvents_SolutionBuildStarted(object? sender, EventArgs e) - { - if (!_configuration.EnableXlifSync && !_configuration.ShowErrorsInErrorList) - return; - - Await(_resourceViewModel.ReloadAsync); - - if (_configuration.EnableXlifSync) - { - Await(_xlfSynchronizer.UpdateFromXlfAsync); - } - - if (!_configuration.ShowErrorsInErrorList) - { - _errorListProvider.Clear(); - } - else - { - var errorCategory = _configuration.TaskErrorCategory; - var cultures = _resourceManager.Cultures; - var entries = _resourceManager.TableEntries; - - _errorListProvider.SetEntries(entries, cultures, (int)errorCategory); - } - } - - private void Provider_Navigate(ResourceTableEntry entry) - { - ThrowIfNotOnUIThread(); - - _shellViewModel.SelectEntry(entry); - } - - public void Dispose() - { - _errorListProvider.Dispose(); - - VS.Events.BuildEvents.SolutionBuildStarted -= BuildEvents_SolutionBuildStarted; - } +namespace ResXManager.VSIX; + +using System; +using System.Collections.Specialized; +using System.Composition; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Threading; + +using Community.VisualStudio.Toolkit; + +using ResXManager.Infrastructure; +using ResXManager.Model; +using ResXManager.View.Tools; +using ResXManager.View.Visuals; +using ResXManager.VSIX.Compatibility; + +using static Microsoft.VisualStudio.Shell.ThreadHelper; + +[Shared] +[Export(typeof(IService))] +internal sealed class PreBuildService : IService, IDisposable +{ + private readonly IErrorListProvider _errorListProvider; + private readonly ResourceManager _resourceManager; + private readonly ResourceViewModel _resourceViewModel; + private readonly XlfSynchronizer _xlfSynchronizer; + private readonly IVsixShellViewModel _shellViewModel; + private readonly IDteConfiguration _configuration; + + [ImportingConstructor] + public PreBuildService( + ResourceManager resourceManager, + ResourceViewModel resourceViewModel, + XlfSynchronizer xlfSynchronizer, + IVsixShellViewModel shellViewModel, + IErrorListProvider errorListProvider, + IDteConfiguration configuration) + { + _errorListProvider = errorListProvider; + _resourceManager = resourceManager; + _resourceViewModel = resourceViewModel; + _xlfSynchronizer = xlfSynchronizer; + _shellViewModel = shellViewModel; + _configuration = configuration; + + resourceManager.TableEntries.CollectionChanged += TableEntries_CollectionChanged; + errorListProvider.Navigate += Provider_Navigate; + + VS.Events.BuildEvents.SolutionBuildStarted += BuildEvents_SolutionBuildStarted; + } + + public void Start() + { + } + + private void TableEntries_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) + { + if (e.Action != NotifyCollectionChangedAction.Remove) + return; + + foreach (var entry in e.OldItems.OfType()) + { + _errorListProvider.Remove(entry); + } + } + + private void Await(Func action) + { + var frame = new DispatcherFrame(); + + void TaskCompleted() + { + frame.Continue = false; + } + + action().GetAwaiter().OnCompleted(TaskCompleted); + + Dispatcher.PushFrame(frame); + } + + private void BuildEvents_SolutionBuildStarted(object? sender, EventArgs e) + { + if (!_configuration.EnableXlifSync && !_configuration.ShowErrorsInErrorList) + return; + + Await(_resourceViewModel.ReloadAsync); + + if (_configuration.EnableXlifSync) + { + Await(_xlfSynchronizer.UpdateFromXlfAsync); + } + + if (!_configuration.ShowErrorsInErrorList) + { + _errorListProvider.Clear(); + } + else + { + var errorCategory = _configuration.TaskErrorCategory; + var cultures = _resourceManager.Cultures; + var entries = _resourceManager.TableEntries; + + _errorListProvider.SetEntries(entries, cultures, (int)errorCategory); + } + } + + private void Provider_Navigate(ResourceTableEntry entry) + { + ThrowIfNotOnUIThread(); + + _shellViewModel.SelectEntry(entry); + } + + public void Dispose() + { + _errorListProvider.Dispose(); + + VS.Events.BuildEvents.SolutionBuildStarted -= BuildEvents_SolutionBuildStarted; + } } \ No newline at end of file diff --git a/src/ResXManager.VSIX.Compatibility.x64/Properties/AssemblyInfo.cs b/src/ResXManager.VSIX.Compatibility.x64/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..3ea9332b --- /dev/null +++ b/src/ResXManager.VSIX.Compatibility.x64/Properties/AssemblyInfo.cs @@ -0,0 +1,5 @@ +namespace ResXManager.VSIX.Compatibility.x64.Properties; + +public static class AssemblyKey +{ +} diff --git a/src/ResXManager.VSIX.Compatibility.Shared/Refactorings.cs b/src/ResXManager.VSIX.Compatibility.x64/Refactorings.cs similarity index 100% rename from src/ResXManager.VSIX.Compatibility.Shared/Refactorings.cs rename to src/ResXManager.VSIX.Compatibility.x64/Refactorings.cs diff --git a/src/ResXManager.VSIX.Compatibility.x64/ResXManager.VSIX.Compatibility.x64.csproj b/src/ResXManager.VSIX.Compatibility.x64/ResXManager.VSIX.Compatibility.x64.csproj index fdfbe87e..60681644 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/ResXManager.VSIX.Compatibility.x64.csproj +++ b/src/ResXManager.VSIX.Compatibility.x64/ResXManager.VSIX.Compatibility.x64.csproj @@ -3,11 +3,10 @@ net472 true - - + @@ -18,4 +17,7 @@ + + + \ No newline at end of file diff --git a/src/ResXManager.VSIX.Compatibility.Shared/VsixCompatibility.cs b/src/ResXManager.VSIX.Compatibility.x64/VsixCompatibility.cs similarity index 100% rename from src/ResXManager.VSIX.Compatibility.Shared/VsixCompatibility.cs rename to src/ResXManager.VSIX.Compatibility.x64/VsixCompatibility.cs diff --git a/src/ResXManager.VSIX.Compatibility.x86/FodyWeavers.xml b/src/ResXManager.VSIX.Compatibility.x86/FodyWeavers.xml deleted file mode 100644 index 781e5ea3..00000000 --- a/src/ResXManager.VSIX.Compatibility.x86/FodyWeavers.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/ResXManager.VSIX.Compatibility.x86/FodyWeavers.xsd b/src/ResXManager.VSIX.Compatibility.x86/FodyWeavers.xsd deleted file mode 100644 index 794a989e..00000000 --- a/src/ResXManager.VSIX.Compatibility.x86/FodyWeavers.xsd +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/src/ResXManager.VSIX.Compatibility.x86/ResXManager.VSIX.Compatibility.x86.csproj b/src/ResXManager.VSIX.Compatibility.x86/ResXManager.VSIX.Compatibility.x86.csproj deleted file mode 100644 index d4bb3f07..00000000 --- a/src/ResXManager.VSIX.Compatibility.x86/ResXManager.VSIX.Compatibility.x86.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - net472 - true - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ResXManager.VSIX/Properties/AssemblyInfo.cs b/src/ResXManager.VSIX/Properties/AssemblyInfo.cs index 65e3446d..9eed88ec 100644 --- a/src/ResXManager.VSIX/Properties/AssemblyInfo.cs +++ b/src/ResXManager.VSIX/Properties/AssemblyInfo.cs @@ -27,6 +27,8 @@ [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Microsoft.Bcl.HashCode.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Microsoft.Bcl.Memory.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Microsoft.ML.Tokenizers.dll")] +[assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Microsoft.ML.Tokenizers.Data.CL100KBase.dll")] +[assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Microsoft.ML.Tokenizers.Data.O200KBase.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Microsoft.Xaml.Behaviors.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Buffers.dll")] diff --git a/src/ResXManager.VSIX/ResXManager.VSIX.csproj b/src/ResXManager.VSIX/ResXManager.VSIX.csproj index c5b66699..4cb7e7b8 100644 --- a/src/ResXManager.VSIX/ResXManager.VSIX.csproj +++ b/src/ResXManager.VSIX/ResXManager.VSIX.csproj @@ -57,10 +57,9 @@ BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;GetCopyToOutputDirectoryItems;SatelliteDllsProjectOutputGroup;DebugSymbolsProjectOutputGroup; - - - - + + BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;GetCopyToOutputDirectoryItems;SatelliteDllsProjectOutputGroup;DebugSymbolsProjectOutputGroup; + @@ -72,7 +71,7 @@ - + @@ -80,10 +79,6 @@ - - - - diff --git a/src/ResXManager.VSIX/VSPackage.cs b/src/ResXManager.VSIX/VSPackage.cs index 7595432a..08fed346 100644 --- a/src/ResXManager.VSIX/VSPackage.cs +++ b/src/ResXManager.VSIX/VSPackage.cs @@ -20,8 +20,6 @@ using Ninject; -using Resourcer; - using ResXManager.Infrastructure; using ResXManager.Model; using ResXManager.View.Tools; @@ -96,6 +94,22 @@ public static VsPackage Instance private ITracer Tracer { get; } + public override IVsAsyncToolWindowFactory? GetAsyncToolWindowFactory(Guid toolWindowType) + { + return toolWindowType == typeof(MyToolWindow).GUID ? this : null; + } + + protected override string GetToolWindowTitle(Type toolWindowType, int id) + { + return toolWindowType == typeof(MyToolWindow) ? "ResX Manager" : base.GetToolWindowTitle(toolWindowType, id); + } + + protected override Task InitializeToolWindowAsync(Type toolWindowType, int id, CancellationToken cancellationToken) + { + // Perform any async initialization here that the tool window needs + return Task.FromResult(null); + } + protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress progress) { await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(false); @@ -182,25 +196,12 @@ private LoaderMessages FillCatalog() try { - var is64BitProcess = Environment.Is64BitProcess; - - using var resourceStream = is64BitProcess - ? Resource.AsStream("ResXManager.VSIX.Compatibility.x64.dll") - : Resource.AsStream("ResXManager.VSIX.Compatibility.x86.dll"); - - var length = resourceStream.Length; - var data = new byte[length]; - if (length != resourceStream.Read(data, 0, (int)length)) - throw new InvalidOperationException("Failed to read compatibility layer."); - - var compatibilityLayer = Assembly.Load(data); - _kernel.BindExports(assembly, typeof(Infrastructure.Properties.AssemblyKey).Assembly, typeof(Model.Properties.AssemblyKey).Assembly, typeof(Translators.Properties.AssemblyKey).Assembly, typeof(View.Properties.AssemblyKey).Assembly, - compatibilityLayer); + typeof(Compatibility.x64.Properties.AssemblyKey).Assembly); _kernel.Bind().ToConstant(ExportProvider); } diff --git a/src/ResXManager.VSIX/source.extension.vsixmanifest b/src/ResXManager.VSIX/source.extension.vsixmanifest index 470fdef3..c2ca70f3 100644 --- a/src/ResXManager.VSIX/source.extension.vsixmanifest +++ b/src/ResXManager.VSIX/source.extension.vsixmanifest @@ -13,9 +13,6 @@ WPF, WinForms, resx, resources, Editor, localization, Productivity, Visual Studio, internationalization, string, resource, l10n, i18n - - x86 - amd64 @@ -31,6 +28,6 @@ - + \ No newline at end of file diff --git a/src/ResXResourceManager.sln b/src/ResXResourceManager.sln index 761b2472..730098db 100644 --- a/src/ResXResourceManager.sln +++ b/src/ResXResourceManager.sln @@ -23,7 +23,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ResXManager.View", "ResXMan EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ResXManager.VSIX", "ResXManager.VSIX\ResXManager.VSIX.csproj", "{41E0911D-7C82-4B4F-B905-BF0B549BC9C4}" ProjectSection(ProjectDependencies) = postProject - {C59E23B4-6ACD-43DC-BFC7-FCB667155EB3} = {C59E23B4-6ACD-43DC-BFC7-FCB667155EB3} {330FADF0-80F3-4B2A-8F11-79F528AFA1DD} = {330FADF0-80F3-4B2A-8F11-79F528AFA1DD} EndProjectSection EndProject @@ -114,10 +113,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Signing", "Signing", "{8B04 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ResXManager.VSIX.Compatibility", "ResXManager.VSIX.Compatibility\ResXManager.VSIX.Compatibility.csproj", "{7812E1AE-8AD7-42F1-ADD7-216BD28E4A88}" EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ResXManager.VSIX.Compatibility.Shared", "ResXManager.VSIX.Compatibility.Shared\ResXManager.VSIX.Compatibility.Shared.shproj", "{CC3F887F-9602-43F4-AA73-7557B7C6AB1D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ResXManager.VSIX.Compatibility.x86", "ResXManager.VSIX.Compatibility.x86\ResXManager.VSIX.Compatibility.x86.csproj", "{C59E23B4-6ACD-43DC-BFC7-FCB667155EB3}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ResXManager.VSIX.Compatibility.x64", "ResXManager.VSIX.Compatibility.x64\ResXManager.VSIX.Compatibility.x64.csproj", "{330FADF0-80F3-4B2A-8F11-79F528AFA1DD}" EndProject Global @@ -162,10 +157,6 @@ Global {7812E1AE-8AD7-42F1-ADD7-216BD28E4A88}.Debug|Any CPU.Build.0 = Debug|Any CPU {7812E1AE-8AD7-42F1-ADD7-216BD28E4A88}.Release|Any CPU.ActiveCfg = Release|Any CPU {7812E1AE-8AD7-42F1-ADD7-216BD28E4A88}.Release|Any CPU.Build.0 = Release|Any CPU - {C59E23B4-6ACD-43DC-BFC7-FCB667155EB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C59E23B4-6ACD-43DC-BFC7-FCB667155EB3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C59E23B4-6ACD-43DC-BFC7-FCB667155EB3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C59E23B4-6ACD-43DC-BFC7-FCB667155EB3}.Release|Any CPU.Build.0 = Release|Any CPU {330FADF0-80F3-4B2A-8F11-79F528AFA1DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {330FADF0-80F3-4B2A-8F11-79F528AFA1DD}.Debug|Any CPU.Build.0 = Debug|Any CPU {330FADF0-80F3-4B2A-8F11-79F528AFA1DD}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -180,9 +171,4 @@ Global GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {04A160C5-3AA5-4A9E-9D73-A227A07E3EE4} EndGlobalSection - GlobalSection(SharedMSBuildProjectFiles) = preSolution - ResXManager.VSIX.Compatibility.Shared\ResXManager.VSIX.Compatibility.Shared.projitems*{330fadf0-80f3-4b2a-8f11-79f528afa1dd}*SharedItemsImports = 5 - ResXManager.VSIX.Compatibility.Shared\ResXManager.VSIX.Compatibility.Shared.projitems*{c59e23b4-6acd-43dc-bfc7-fcb667155eb3}*SharedItemsImports = 5 - ResXManager.VSIX.Compatibility.Shared\ResXManager.VSIX.Compatibility.Shared.projitems*{cc3f887f-9602-43f4-aa73-7557b7c6ab1d}*SharedItemsImports = 13 - EndGlobalSection EndGlobal From 1a5ef813131f5e133472d9d7ec1e7e8bf88d68c7 Mon Sep 17 00:00:00 2001 From: tom-englert Date: Sat, 6 Jun 2026 18:01:19 +0200 Subject: [PATCH 3/5] Update dependencies --- src/Directory.Build.props | 2 +- src/Directory.Packages.props | 26 +++++++++---------- src/ResXManager.Model/ExcelExtensions.cs | 12 ++++----- .../CustomToolRunner.cs | 4 +-- .../DteConfiguration.cs | 12 ++++----- .../DteExtensions.cs | 7 +++-- .../DteProjectFile.cs | 13 +++++----- .../DteSolution.cs | 13 +++++++--- .../DteSourceFilesProvider.cs | 2 +- .../ErrorListProviderService.cs | 4 +-- .../ICustomToolRunner.cs | 4 +-- .../PreBuildService.cs | 4 +-- .../Refactorings.cs | 4 +-- .../ResXManager.VSIX.Compatibility.x64.csproj | 2 +- .../VsixCompatibility.cs | 20 +++++++------- src/ResXManager.VSIX/MyToolWindow.cs | 2 +- .../Properties/AssemblyInfo.cs | 1 + src/ResXManager.VSIX/VSPackage.cs | 6 ++--- 18 files changed, 72 insertions(+), 66 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 3931b936..939bef83 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -27,7 +27,7 @@ - + diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 15ec72ad..7795981c 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -6,8 +6,8 @@ - - + + @@ -16,7 +16,7 @@ - + @@ -29,18 +29,18 @@ - + - - - - - + + + + + - - - - + + + + diff --git a/src/ResXManager.Model/ExcelExtensions.cs b/src/ResXManager.Model/ExcelExtensions.cs index 891aa85e..b15317c4 100644 --- a/src/ResXManager.Model/ExcelExtensions.cs +++ b/src/ResXManager.Model/ExcelExtensions.cs @@ -27,7 +27,7 @@ public enum ExcelExportMode public static partial class ResourceEntityExtensions { - private static readonly string[] _singleSheetFixedColumnHeaders = { "Project", "File", "Key" }; + private static readonly string[] _singleSheetFixedColumnHeaders = ["Project", "File", "Key"]; public static void ExportExcelFile(this ResourceManager resourceManager, string filePath, IResourceScope? scope, ExcelExportMode exportMode) { @@ -256,12 +256,12 @@ private static IEnumerable GetRows(this Sheet sheet, WorkbookPart workbookP { var sheetId = sheet.Id; - if ((sheetId is not { Value: {} value}) || string.IsNullOrEmpty(value)) - return Enumerable.Empty(); + if ((sheetId is not { Value: { } value }) || string.IsNullOrEmpty(value)) + return []; var worksheetPart = (WorksheetPart)workbookPart.GetPartById(value); - return worksheetPart.Worksheet.ChildElements.OfType().FirstOrDefault()?.OfType() ?? Enumerable.Empty(); + return worksheetPart.Worksheet?.ChildElements.OfType().FirstOrDefault()?.OfType() ?? []; } private static ResourceEntity FindResourceEntity(this IEnumerable entities, Sheet sheet) @@ -286,7 +286,7 @@ public DataAppender(int numberOfFixedColumns) public SheetData AppendRow(SheetData sheetData, IEnumerable rowData) { - var row = (sheetData.ChildElements?.OfType()?.Count() ?? 0) + 1; + var row = (sheetData.ChildElements.OfType()?.Count() ?? 0) + 1; var column = 1; return sheetData.AppendItem(rowData.Aggregate(new Row(), (seed, item) => seed.AppendItem(CreateCell(item, row, column++)))); } @@ -707,4 +707,4 @@ public static void AddStylesToWorkbookPart(WorkbookPart part) } } } -} \ No newline at end of file +} diff --git a/src/ResXManager.VSIX.Compatibility.x64/CustomToolRunner.cs b/src/ResXManager.VSIX.Compatibility.x64/CustomToolRunner.cs index 1b3b49f8..a04dd603 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/CustomToolRunner.cs +++ b/src/ResXManager.VSIX.Compatibility.x64/CustomToolRunner.cs @@ -1,4 +1,4 @@ -namespace ResXManager.VSIX; +namespace ResXManager.VSIX.Compatibility.x64; using System; using System.Collections.Generic; @@ -44,4 +44,4 @@ public void Dispose() { RunCustomTool(); } -} \ No newline at end of file +} diff --git a/src/ResXManager.VSIX.Compatibility.x64/DteConfiguration.cs b/src/ResXManager.VSIX.Compatibility.x64/DteConfiguration.cs index 43f6a358..1938f33a 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/DteConfiguration.cs +++ b/src/ResXManager.VSIX.Compatibility.x64/DteConfiguration.cs @@ -1,4 +1,4 @@ -namespace ResXManager.VSIX; +namespace ResXManager.VSIX.Compatibility.x64; using System; using System.ComponentModel; @@ -14,7 +14,7 @@ using static Microsoft.VisualStudio.Shell.ThreadHelper; -using Configuration = ResXManager.Model.Configuration; +using Configuration = Model.Configuration; [Shared] [Export(typeof(IConfiguration))] @@ -48,16 +48,16 @@ public DteConfiguration(DteSolution solution, ITracer tracer) var solutionKey = GetSolutionKey(key); - if (!TryGetValueFromSolutionGlobals(solutionKey, out var value)) + if (!TryGetValueFromSolutionGlobals(solutionKey, out var value)) return base.InternalGetValue(defaultValue, key); Tracer.WriteLine("Convert old solution settings to new file based settings for key {0}, value {1}", solutionKey, value); // Convert old solution settings to new ones. TryClearValueFromSolutionGlobals(solutionKey); - + base.InternalSetValue(value, key, false); - + return value; } @@ -66,7 +66,7 @@ public DteConfiguration(DteSolution solution, ITracer tracer) ThrowIfNotOnUIThread(); TryClearValueFromSolutionGlobals(GetSolutionKey(key)); - + base.InternalSetValue(value, key, forceGlobal); } diff --git a/src/ResXManager.VSIX.Compatibility.x64/DteExtensions.cs b/src/ResXManager.VSIX.Compatibility.x64/DteExtensions.cs index 3ce56c75..9fd428ef 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/DteExtensions.cs +++ b/src/ResXManager.VSIX.Compatibility.x64/DteExtensions.cs @@ -1,4 +1,4 @@ -namespace ResXManager.VSIX; +namespace ResXManager.VSIX.Compatibility.x64; using System; using System.Collections.Generic; @@ -10,14 +10,13 @@ using Community.VisualStudio.Toolkit; using Microsoft.VisualStudio; - using Microsoft.VisualStudio.Shell.Interop; -using static Microsoft.VisualStudio.Shell.ThreadHelper; - using ResXManager.View; using ResXManager.VSIX.Compatibility; +using static Microsoft.VisualStudio.Shell.ThreadHelper; + internal static class DteExtensions { public static EnvDTE.Document? TryGetDocument(this EnvDTE.ProjectItem? projectItem) diff --git a/src/ResXManager.VSIX.Compatibility.x64/DteProjectFile.cs b/src/ResXManager.VSIX.Compatibility.x64/DteProjectFile.cs index 1091d1e4..df1634b0 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/DteProjectFile.cs +++ b/src/ResXManager.VSIX.Compatibility.x64/DteProjectFile.cs @@ -1,12 +1,10 @@ -namespace ResXManager.VSIX; +namespace ResXManager.VSIX.Compatibility.x64; using System; using System.Collections.Generic; using System.IO; using System.Linq; -using EnvDTE; - using ResXManager.Model; using ResXManager.VSIX.Compatibility; using ResXManager.VSIX.Compatibility.Properties; @@ -186,6 +184,9 @@ private void SetCodeGenerator(CodeGenerator value) case CodeGenerator.Unknown: case CodeGenerator.WinForms: break; + + default: + throw new ArgumentOutOfRangeException(nameof(value), value, null); } } } @@ -233,12 +234,12 @@ private void SetTextTemplateCodeGenerator(EnvDTE.ProjectItem projectItem) item.RunCustomTool(); } - private static void ReferenceDataAnnotations(ProjectItem projectItem) + private static void ReferenceDataAnnotations(EnvDTE.ProjectItem projectItem) { try { ThrowIfNotOnUIThread(); - + const string dataAnnotations = "System.ComponentModel.DataAnnotations"; ThrowIfNotOnUIThread(); @@ -269,4 +270,4 @@ private static void SetCustomToolCodeGenerator(EnvDTE.ProjectItem projectItem, C projectItem.SetCustomTool(value.ToString()); } -} \ No newline at end of file +} diff --git a/src/ResXManager.VSIX.Compatibility.x64/DteSolution.cs b/src/ResXManager.VSIX.Compatibility.x64/DteSolution.cs index a60ecd58..f2143e32 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/DteSolution.cs +++ b/src/ResXManager.VSIX.Compatibility.x64/DteSolution.cs @@ -1,4 +1,4 @@ -namespace ResXManager.VSIX; +namespace ResXManager.VSIX.Compatibility.x64; using System; using System.Collections.Generic; @@ -116,7 +116,14 @@ public IEnumerable GetProjectFiles(IFileFilter fileFilter) } // ReSharper disable once SuspiciousTypeConversion.Global - private Solution2? Solution => _dte.Solution as Solution2; + private Solution2? Solution + { + get + { + ThrowIfNotOnUIThread(); + return _dte.Solution as Solution2; + } + } public Globals? Globals { @@ -311,4 +318,4 @@ private void GetProjectFiles(string? projectName, ProjectItem projectItem, IDict return null; } -} \ No newline at end of file +} diff --git a/src/ResXManager.VSIX.Compatibility.x64/DteSourceFilesProvider.cs b/src/ResXManager.VSIX.Compatibility.x64/DteSourceFilesProvider.cs index 3ca99cbf..efb4d66e 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/DteSourceFilesProvider.cs +++ b/src/ResXManager.VSIX.Compatibility.x64/DteSourceFilesProvider.cs @@ -1,4 +1,4 @@ -namespace ResXManager.VSIX; +namespace ResXManager.VSIX.Compatibility.x64; using System.Collections.Generic; using System.Composition; diff --git a/src/ResXManager.VSIX.Compatibility.x64/ErrorListProviderService.cs b/src/ResXManager.VSIX.Compatibility.x64/ErrorListProviderService.cs index d3f6c0c8..709f9976 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/ErrorListProviderService.cs +++ b/src/ResXManager.VSIX.Compatibility.x64/ErrorListProviderService.cs @@ -1,4 +1,4 @@ -namespace ResXManager.VSIX; +namespace ResXManager.VSIX.Compatibility.x64; using System; using System.Collections.Generic; @@ -115,4 +115,4 @@ public void Dispose() { _errorListProvider.Dispose(); } -} \ No newline at end of file +} diff --git a/src/ResXManager.VSIX.Compatibility.x64/ICustomToolRunner.cs b/src/ResXManager.VSIX.Compatibility.x64/ICustomToolRunner.cs index 0b34a276..5f0c902f 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/ICustomToolRunner.cs +++ b/src/ResXManager.VSIX.Compatibility.x64/ICustomToolRunner.cs @@ -1,4 +1,4 @@ -namespace ResXManager.VSIX; +namespace ResXManager.VSIX.Compatibility.x64; using System; using System.Collections.Generic; @@ -6,4 +6,4 @@ public interface ICustomToolRunner : IDisposable { void Enqueue(IEnumerable? projectItems); -} \ No newline at end of file +} diff --git a/src/ResXManager.VSIX.Compatibility.x64/PreBuildService.cs b/src/ResXManager.VSIX.Compatibility.x64/PreBuildService.cs index b4a3e245..57f4f231 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/PreBuildService.cs +++ b/src/ResXManager.VSIX.Compatibility.x64/PreBuildService.cs @@ -1,4 +1,4 @@ -namespace ResXManager.VSIX; +namespace ResXManager.VSIX.Compatibility.x64; using System; using System.Collections.Specialized; @@ -118,4 +118,4 @@ public void Dispose() VS.Events.BuildEvents.SolutionBuildStarted -= BuildEvents_SolutionBuildStarted; } -} \ No newline at end of file +} diff --git a/src/ResXManager.VSIX.Compatibility.x64/Refactorings.cs b/src/ResXManager.VSIX.Compatibility.x64/Refactorings.cs index 3f9eb123..eb598705 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/Refactorings.cs +++ b/src/ResXManager.VSIX.Compatibility.x64/Refactorings.cs @@ -1,4 +1,4 @@ -namespace ResXManager.VSIX; +namespace ResXManager.VSIX.Compatibility.x64; using System; using System.Collections.Generic; @@ -14,7 +14,6 @@ using Microsoft.VisualStudio.Shell; using ResXManager.Model; -using ResXManager.View.Behaviors; using ResXManager.View.Visuals; using ResXManager.VSIX.Compatibility; @@ -23,7 +22,6 @@ using static Microsoft.VisualStudio.Shell.ThreadHelper; -using Settings = View.Properties.Settings; using Resources = Compatibility.Properties.Resources; [Export(typeof(IRefactorings))] diff --git a/src/ResXManager.VSIX.Compatibility.x64/ResXManager.VSIX.Compatibility.x64.csproj b/src/ResXManager.VSIX.Compatibility.x64/ResXManager.VSIX.Compatibility.x64.csproj index 60681644..cf5b80ad 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/ResXManager.VSIX.Compatibility.x64.csproj +++ b/src/ResXManager.VSIX.Compatibility.x64/ResXManager.VSIX.Compatibility.x64.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/ResXManager.VSIX.Compatibility.x64/VsixCompatibility.cs b/src/ResXManager.VSIX.Compatibility.x64/VsixCompatibility.cs index 4cbfa60e..b4ed548c 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/VsixCompatibility.cs +++ b/src/ResXManager.VSIX.Compatibility.x64/VsixCompatibility.cs @@ -1,4 +1,4 @@ -namespace ResXManager.VSIX.Compatibility.Shared; +namespace ResXManager.VSIX.Compatibility.x64; using System; using System.Collections.Generic; @@ -26,7 +26,7 @@ using static Microsoft.VisualStudio.Shell.ThreadHelper; using MessageBox = System.Windows.MessageBox; -using Resources = Properties.Resources; +using Resources = Compatibility.Properties.Resources; [Export(typeof(IVsixCompatibility))] internal sealed class VsixCompatibility : IVsixCompatibility @@ -241,7 +241,7 @@ private static void ActivateWindow(EnvDTE.Window? window) ThrowIfNotOnUIThread(); if (ServiceProvider.GlobalProvider?.GetService(typeof(DTE)) is not DTE2 dte) - return Array.Empty>(); + return []; try { @@ -254,19 +254,19 @@ private static void ActivateWindow(EnvDTE.Window? window) .ToDictionary(window => window.Document); var items = from l in languages - let file = l.FileName - let projectFile = l.ProjectFile as DteProjectFile - let documents = projectFile?.ProjectItems.Select(item => item.TryGetDocument()).Where(doc => doc != null) - let window = documents?.Select(doc => openDocuments?.GetValueOrDefault(doc)).FirstOrDefault(win => win != null) - where window != null - select Tuple.Create(file, window); + let file = l.FileName + let projectFile = l.ProjectFile as DteProjectFile + let documents = projectFile?.ProjectItems.Select(item => item.TryGetDocument()).Where(doc => doc != null) + let window = documents?.Select(doc => openDocuments?.GetValueOrDefault(doc)).FirstOrDefault(win => win != null) + where window != null + select Tuple.Create(file, window); #pragma warning restore VSTHRD010 // Accessing ... should only be done on the main thread. return items.ToArray(); } catch { - return Array.Empty>(); + return []; } } diff --git a/src/ResXManager.VSIX/MyToolWindow.cs b/src/ResXManager.VSIX/MyToolWindow.cs index aecb7af7..486e45f8 100644 --- a/src/ResXManager.VSIX/MyToolWindow.cs +++ b/src/ResXManager.VSIX/MyToolWindow.cs @@ -98,7 +98,7 @@ protected override void OnCreate() var folder = Path.GetDirectoryName(executingAssembly.Location); // ReSharper disable once AssignNullToNotNullAttribute - _tracer.WriteLine(Resources.AssemblyLocation, folder); + _tracer.WriteLine(Resources.AssemblyLocation, $"{folder}, {File.GetCreationTime(executingAssembly.Location)}"); _tracer.WriteLine(Resources.Version, new AssemblyName(executingAssembly.FullName).Version); _tracer.WriteLine(".NET Framework Version: {0} (https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed)", FrameworkVersion()); diff --git a/src/ResXManager.VSIX/Properties/AssemblyInfo.cs b/src/ResXManager.VSIX/Properties/AssemblyInfo.cs index 9eed88ec..8b2e218f 100644 --- a/src/ResXManager.VSIX/Properties/AssemblyInfo.cs +++ b/src/ResXManager.VSIX/Properties/AssemblyInfo.cs @@ -22,6 +22,7 @@ [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Community.VisualStudio.Toolkit.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\DataGridExtensions.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\DocumentFormat.OpenXml.dll")] +[assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\DocumentFormat.OpenXml.Framework.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Microsoft.Bcl.AsyncInterfaces.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\Microsoft.Bcl.HashCode.dll")] diff --git a/src/ResXManager.VSIX/VSPackage.cs b/src/ResXManager.VSIX/VSPackage.cs index 08fed346..71d2acd4 100644 --- a/src/ResXManager.VSIX/VSPackage.cs +++ b/src/ResXManager.VSIX/VSPackage.cs @@ -48,10 +48,10 @@ // This attribute tells the PkgDef creation utility (CreatePkgDef.exe) that this class is a package. [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable", Justification = "Package already handles this.")] [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] -// This attribute is used to register the information needed to show the this package in the Help/About dialog of Visual Studio. -[InstalledProductRegistration(@"#110", @"#112", "ResXManager", IconResourceID = 400)] +// This attribute is used to register the information needed to show this package in the Help/About dialog of Visual Studio. +[InstalledProductRegistration("#110", "#112", "ResXManager", IconResourceID = 400)] // This attribute is needed to let the shell know that this package exposes some menus. -[ProvideMenuResource(@"Menus.ctmenu", 1)] +[ProvideMenuResource("Menus.ctmenu", 1)] // This attribute registers a tool window exposed by this package. [ProvideToolWindow(typeof(MyToolWindow))] [Guid(GuidList.guidResXManager_VSIXPkgString)] From e1bae9484fae4e3cb0ecae5070a392888e060bfe Mon Sep 17 00:00:00 2001 From: tom-englert Date: Sat, 6 Jun 2026 20:38:00 +0200 Subject: [PATCH 4/5] Update dependencies to build and deploy VSIX to experimental instance also win VS2026 --- src/Directory.Build.props | 2 +- src/Directory.Packages.props | 22 +++++++------------ .../ResXManager.Model.csproj | 2 +- .../ResXManager.Translators.csproj | 4 +--- .../ResXManager.VSIX.Compatibility.x64.csproj | 2 +- .../Properties/AssemblyInfo.cs | 3 --- src/ResXManager.VSIX/ResXManager.VSIX.csproj | 1 + src/ResXResourceManager.sln | 6 +++-- 8 files changed, 17 insertions(+), 25 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 939bef83..9ec59a73 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,7 +1,7 @@ - 1.105.0.0 + 1.106.0.0 tom-englert.de ResXManager Copyright (c) .NET Foundation and Contributors. diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 7795981c..ea7613f1 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -1,13 +1,13 @@ true - false + true - + @@ -17,18 +17,15 @@ - - + + - - - - + @@ -36,18 +33,15 @@ - - + - - + - - + \ No newline at end of file diff --git a/src/ResXManager.Model/ResXManager.Model.csproj b/src/ResXManager.Model/ResXManager.Model.csproj index 1b5b842c..0e67e0ca 100644 --- a/src/ResXManager.Model/ResXManager.Model.csproj +++ b/src/ResXManager.Model/ResXManager.Model.csproj @@ -22,7 +22,7 @@ - + diff --git a/src/ResXManager.Translators/ResXManager.Translators.csproj b/src/ResXManager.Translators/ResXManager.Translators.csproj index 39fd8c5e..f1a77502 100644 --- a/src/ResXManager.Translators/ResXManager.Translators.csproj +++ b/src/ResXManager.Translators/ResXManager.Translators.csproj @@ -57,11 +57,9 @@ - + - - diff --git a/src/ResXManager.VSIX.Compatibility.x64/ResXManager.VSIX.Compatibility.x64.csproj b/src/ResXManager.VSIX.Compatibility.x64/ResXManager.VSIX.Compatibility.x64.csproj index cf5b80ad..53fe73a9 100644 --- a/src/ResXManager.VSIX.Compatibility.x64/ResXManager.VSIX.Compatibility.x64.csproj +++ b/src/ResXManager.VSIX.Compatibility.x64/ResXManager.VSIX.Compatibility.x64.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/ResXManager.VSIX/Properties/AssemblyInfo.cs b/src/ResXManager.VSIX/Properties/AssemblyInfo.cs index 8b2e218f..34b48abf 100644 --- a/src/ResXManager.VSIX/Properties/AssemblyInfo.cs +++ b/src/ResXManager.VSIX/Properties/AssemblyInfo.cs @@ -39,10 +39,7 @@ [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Memory.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Numerics.Vectors.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Runtime.CompilerServices.Unsafe.dll")] -[assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Security.Cryptography.Pkcs.dll")] -[assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.ServiceModel.Http.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.ServiceModel.Primitives.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Text.Encodings.Web.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Text.Json.dll")] [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.Threading.Tasks.Extensions.dll")] -// [assembly: ProvideCodeBase(CodeBase = "$PackageFolder$\\System.ValueTuple.dll")] diff --git a/src/ResXManager.VSIX/ResXManager.VSIX.csproj b/src/ResXManager.VSIX/ResXManager.VSIX.csproj index 4cb7e7b8..0927004d 100644 --- a/src/ResXManager.VSIX/ResXManager.VSIX.csproj +++ b/src/ResXManager.VSIX/ResXManager.VSIX.csproj @@ -5,6 +5,7 @@ net472 16.0 ..\ResourceManager.ico + true Program diff --git a/src/ResXResourceManager.sln b/src/ResXResourceManager.sln index 730098db..205cf596 100644 --- a/src/ResXResourceManager.sln +++ b/src/ResXResourceManager.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.32014.148 +# Visual Studio Version 18 +VisualStudioVersion = 18.7.11822.327 insiders MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8FE641FD-9430-4433-88D3-ABDD487E4397}" ProjectSection(SolutionItems) = preProject @@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Directory.Build.props = Directory.Build.props Directory.Build.targets = Directory.Build.targets Directory.Packages.props = Directory.Packages.props + Nuget.config = Nuget.config ..\README.md = ..\README.md ..\Release notes.md = ..\Release notes.md Resources.Designer.t4 = Resources.Designer.t4 @@ -131,6 +132,7 @@ Global {32935FC5-1F28-419C-B67F-12D2014F8A8B}.Release|Any CPU.Build.0 = Release|Any CPU {41E0911D-7C82-4B4F-B905-BF0B549BC9C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {41E0911D-7C82-4B4F-B905-BF0B549BC9C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {41E0911D-7C82-4B4F-B905-BF0B549BC9C4}.Debug|Any CPU.Deploy.0 = Debug|Any CPU {41E0911D-7C82-4B4F-B905-BF0B549BC9C4}.Release|Any CPU.ActiveCfg = Release|Any CPU {41E0911D-7C82-4B4F-B905-BF0B549BC9C4}.Release|Any CPU.Build.0 = Release|Any CPU {40BE4188-6658-4DAC-B44E-DE4B7D0EE3A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU From 7512abc23f1a5c8c149dfa92a4f9d285260022ee Mon Sep 17 00:00:00 2001 From: tom-englert Date: Sun, 7 Jun 2026 09:40:13 +0200 Subject: [PATCH 5/5] Fix typos --- Documentation/Topics/Automatic-Translations.md | 4 ++-- src/ResXResourceManager.sln | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/Topics/Automatic-Translations.md b/Documentation/Topics/Automatic-Translations.md index 939f669d..9edcfdd1 100644 --- a/Documentation/Topics/Automatic-Translations.md +++ b/Documentation/Topics/Automatic-Translations.md @@ -31,7 +31,7 @@ The API URL for Deepl is https://api.deepl.com/v2/translate, but for the free ve #### Configuration - Add a new Azure OpenAI resource using the portal or CLI. -- Model availability may vary depending on e.g. region, check the model availabilty [here](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-4-and-gpt-4-turbo-preview-model-availability) +- Model availability may vary depending on e.g. region, check the model availability [here](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-4-and-gpt-4-turbo-preview-model-availability) - Deploy one of the supported models (see below). - Copy the API key, URL to the endpoint, deployment name, and model name into the settings of the translator. @@ -39,7 +39,7 @@ The API URL for Deepl is https://api.deepl.com/v2/translate, but for the free ve - **Model Name**: This is the base model identifier used by OpenAI (e.g., "gpt-3.5-turbo", "gpt-4", "gpt-4o"). This is used internally for tokenization and determining which API endpoint to use. - **Model Deployment Name**: This is the custom name YOU chose when deploying the model in Azure (e.g., "my-gpt4-deployment"). This is what Azure uses to route your API requests. -> A list of supported models names can be found [here](https://github.com/dotnet/machinelearning/blob/4c8b3579d1053257b213ca54be2681359b66cf65/src/Microsoft.ML.Tokenizers/Model/TiktokenTokenizer.cs#L1069-L1146) +> A list of supported model names can be found [here](https://github.com/dotnet/machinelearning/blob/4c8b3579d1053257b213ca54be2681359b66cf65/src/Microsoft.ML.Tokenizers/Model/TiktokenTokenizer.cs#L1069-L1146) **Supported Models**: - **GPT-3.5 Models**: diff --git a/src/ResXResourceManager.sln b/src/ResXResourceManager.sln index 205cf596..cee71baf 100644 --- a/src/ResXResourceManager.sln +++ b/src/ResXResourceManager.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 18 -VisualStudioVersion = 18.7.11822.327 insiders +VisualStudioVersion = 18.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8FE641FD-9430-4433-88D3-ABDD487E4397}" ProjectSection(SolutionItems) = preProject