Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax & execution CSharpRepl exceptions shouldn't be translated #312

Closed
marcinsmialek opened this issue Oct 13, 2023 · 1 comment · Fixed by #324
Closed

Syntax & execution CSharpRepl exceptions shouldn't be translated #312

marcinsmialek opened this issue Oct 13, 2023 · 1 comment · Fixed by #324
Assignees
Labels
bug Something isn't working

Comments

@marcinsmialek
Copy link

marcinsmialek commented Oct 13, 2023

Version

0.6.5

What happened?

Exceptions from CSharpRepl are translated, and they shouldn't be.
This happens when you try running code, which wouldn't be compiled, for example missing semicolon, no such variable.

Exceptions from the code itself aren't translated, which is expected.

Example:

> System.Threading.Thread.CurrentThread.CurrentCulture
pl-PL
> System.Threading.Thread.CurrentThread.CurrentUICulture
en-US
> throw new Exception();
┌────────────────────Exception─────────────────────┐
│ Exception of type 'System.Exception' was thrown. │
└──────────────────────────────────────────────────┘

> AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName
".NETCoreApp,Version=v7.0"
> show translation issue
┌───────────────────Exception───────────────────┐
│ (1,18): error CS1002: Oczekiwano średnika (;) │
└───────────────────────────────────────────────┘

When I have the same code in a .cs file, and try compiling it either with Visual Studio 2022, or via dotnet build / dotnet run, I'm getting this message in English:

C:\Dev\TestApp\TestApp\Program.cs(7,38): error CS1002: ; expected [C:\Dev\TestApp\TestApp\TestApp.csproj]

The proper native .cs code, when run, shows the same culture values - pl-PL / en-US.

Running Windows 11, English United States with Polish language pack added.
Windows Display Language is set to English.
Preferred languages are English (United States), Polish.
Country or region: United States
Regional format: Polish (Poland)
Even the keyboard language was set to English (United States), with Polish Programmer's layout

.cs files tested with both .NET 7.0.12 / 7.0.402 and 8.0.0-rc.1.23419.4 / 8.0.100-rc.1.23455.8

I haven't tested CSharpRepl with #241 / #296 fix.

@waf
Copy link
Owner

waf commented Nov 24, 2023

Thanks for well-put-together bug report. This should be fixed in #324 and will be available in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants