dotnet / ResXResourceManager

Manage localization of all ResX-Based resources in one central place.
MIT License
1.29k stars 211 forks source link

"Move to Resource" not replacing string with Code + not adding the value (cshtml - VS Community 2022 64-bit) #603

Closed MashhorSoftware closed 8 months ago

MashhorSoftware commented 8 months ago

Describe the bug 1 - "Move to Resource" not replacing string with Code. 2 - "Move to Resource" not adding the value.

resxmanagercodebug

Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.7.6 Programing language: cshtml

To Reproduce 1 - Right click the string. 2 - Click on "Move to Resource" 3 - Choose any type of Code template. 4 - Type in any value. 5 - Click Ok.

Expected behavior 1 - String is replaced with Code. 2 - Value is added to the key values.

tom-englert commented 8 months ago

Is there any message in the output window?

MashhorSoftware commented 8 months ago

Yes, here is the output from ResX Resource Manager:

Error: System.ArgumentException: Language is not defined: "Neutral". at ResXManager.Model.ResourceTableValues`1.SetValue(Object culture, T value) in D:\a\1\s\src\ResXManager.Model\ResourceTableValues.cs:line 46 at ResXManager.VSIX.Refactorings.d7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at ResXManager.VSIX.VsPackage.d31.MoveNext() in D:\a\1\s\src\ResXManager.VSIX\VSPackage.cs:line 386

tom-englert commented 8 months ago

You don't have a neutral resource in your project

MashhorSoftware commented 8 months ago

Thank you so much! it was true, I had to rename my Index.en.resx file to Index.resx, now it's recognized in the plugin as "Neutral" as it was "English [en]" just like in the picture below. it's working perfectly now! Screenshot 2023-11-04 160817