[BUG] Culture-sensitive ToLower() breaks generated code, GravatarImageSource and MathExpressionConverter under Turkish culture
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- csharp
- Ambito
- backend, build-system, mobile-dev
Direzione di ricerca
The issue identifies culture-sensitive casing in BindablePropertyAttributeSourceGenerator, AttachedBindablePropertyAttributeSourceGenerator, GravatarImageSource, and MathExpressionConverter. Start by reproducing the failures under tr-TR with the linked test project and inspect the reported casing calls. Done means generated accessibility and property-key names, the Gravatar identicon parameter, and the MIN expression behave as expected under Turkish culture; the issue author says a fix is ready to contribute.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is there an existing issue for this?
- I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
Current Behavior
Several places lower-case enum names or user input with the culture-sensitive ToLower(). Under tr-TR and az-AZ, "I".ToLower() is "ı" (dotless i), so on a machine with Turkish culture:
BindablePropertyAttributeSourceGeneratorandAttachedBindablePropertyAttributeSourceGeneratoremitınternal partial class TestViewfor aninternalclass (DeclaredAccessibility.ToString().ToLower()). The generated file does not compile.- The generated
BindablePropertyKeyfield of a read-only property namedIconbecomesıconPropertyKey(char.ToLower), so the generated code depends on the build machine. GravatarImageSourcewithDefaultImage.Identiconrequestsd=ıdenticon, which Gravatar does not recognize.MathExpressionConverterlower-cases the whole expression, soMIN(x, 3),IF(...)andPIbecomemın,ıfandpıand throw "Can't find operator or value".
Expected Behavior
Generated code and runtime results do not depend on the current culture: internal partial class TestView, iconPropertyKey, d=identicon, and MIN(x, 3) evaluates to 2 for x = 2.
Steps To Reproduce
- Use Turkish culture: build on a machine whose OS culture is
tr-TR, or setCultureInfo.CurrentCulture = new CultureInfo("tr-TR")in a test. - Declare
internal partial class TestView : View { [BindableProperty] public partial string Text { get; set; } }and build. The generated file containsınternal partial class TestView. - Call
new MathExpressionConverter().ConvertFrom(2d, "MIN(x, 3)"). It throwsArgumentException. - Create a
GravatarImageSourcewithImage = DefaultImage.Identicon. ItsUriends withd=ıdenticon.
Link to public reproduction project repository
https://github.com/efeesrefinal/Maui/tree/repro/turkish-culture-casing
(unit tests only, on top of main: 5 tests that fail under tr-TR; run dotnet test in the two UnitTests projects)
Environment
* .NET MAUI CommunityToolkit: main (afa1d0dd)
* OS: Linux (unit tests); the generator issue applies to any build machine with Turkish culture
* .NET MAUI: 10.0 (.NET 10.0.403 SDK)
Anything else?
I have a fix ready: a small Accessibility.ToCSharpKeyword() helper for the generators and ToLowerInvariant in the other places. With it these tests pass, and so do the existing source generator tests (143) and the Gravatar and MathExpression tests (136). Happy to open a PR once this is approved.
- Lingua principale
- C#
- Stelle
- 2.7k
- Fork
- 502
- Merge medio
- 11h 10m
- PR unite (30g)
- 50
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CommunityToolkit/Maui
-
new proposal
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
CommunityToolkit/Maui#3449 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug unverified
Difficoltà 3/5 1-2 giorni Idoneità per principianti 63/100
CommunityToolkit/Maui#3443 ·
I maintainer di solito rispondono entro 1 giorno
-
[Proposal] Keep the device tests on the newest OS releases automaticallyForse già presa @TheCodeTraveler l’ha presa 3 giorni fa. Apertaapproved champion proposal
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
CommunityToolkit/Maui#3438 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
new proposal
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
CommunityToolkit/Maui#3436 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] The popup positioning changing if SetShouldUseStatusBarBehaviorOnAndroidModalPage is trueApertabug unverified
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
CommunityToolkit/Maui#3425 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di CommunityToolkit/Maui
Issue simili
-
area: core bug help wanted ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ZaidX88/sluice#265 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area: remote bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Install a C# EnvironmentAperta📅 Sprint 4 Module-Tools Setup Submit:None 🦔 Size Tiny
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
CodeYourFuture/Module-Tools#712 ·
-
:watch: Not Triaged dotnet-fundamentals/svc
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
A: Mapping P3: Standard T: New Feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
space-wizards/space-station-14#46878 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno