[Bug]: PortableFirstStart import-confirmation test compares English text while the dialog follows the system language

Aperta Adatta ai principianti
#1,887 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp

Direzione di ricerca

Inizia da tests/Filee.App.Tests/PortableFirstStartTests.cs intorno alle righe 46 e 57, dove l'asserzione carica la voce del catalogo en per portable.import_next. Poi leggi LocalizationService.EarlyText in src/Filee.App/Services/LocalizationService.cs (righe 175-183) e il percorso Resolve("auto") alla riga 96, che segue CurrentUICulture. Il lavoro è completato quando il test passa su una cultura di sistema non inglese, forzando la lingua anticipata nel test oppure verificando la stringa della cultura dell'interfaccia corrente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
What happened?

On a Chinese-language Windows this test fails stably (3/3 reruns):

Assert.Contains() Failure: Filter not matched in collection
   at Filee.App.Tests.PortableFirstStartTests.Import_confirmation_shows_the_profile_and_portable_destination()
   in tests\Filee.App.Tests\PortableFirstStartTests.cs:line 57
What did you expect?

Either the dialog shows the string the test looks up, or the test follows the language the dialog actually uses.

Steps to reproduce
  1. Chinese (zh-CN) Windows, Get-UICulture = zh-CN
  2. dotnet test tests/Filee.App.Tests -c Release --filter "FullyQualifiedName~Import_confirmation_shows_the_profile_and_portable_destination"
Why it fails

The test compares the rendered text with catalog["portable.import_next"] loaded explicitly from en (PortableFirstStartTests.cs:46,57). The bubble's text, however, comes from PortableFirstStart.cs:132 → LocalizationService.EarlyText("portable.import_next"), and EarlyText (src/Filee.App/Services/LocalizationService.cs:175-183) resolves the language with Resolve("auto") → UserLanguage = CultureInfo.CurrentUICulture.Name (LocalizationService.cs:96) — i.e. the system language, ignoring TestServices.EnsureInitialized("en").

On this machine that renders the zh-CN string (复制后使用所选数据继续。…) instead of the English one, so the assertion can never match. On an English CI runner it passes.

Suggestion: let the test force the early language (an injectable OS-language provider, or a test override in EarlyText), or assert against the string for the current UI culture.

Filee version

v2.4.0-137-g5b91b379 (main @ 5b91b379)

Operating system

Windows 11 10.0.26300 (zh-CN), i9-14900HX, 32 GB

Engines page status

Not relevant: no engine is used; engines/ present (ffmpeg 9.0.2, 7zip 26.05).

Lingua principale
C#
Stelle
3.6k
Fork
192
Merge medio
14h 23m
PR unite (30g)
458

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di KnifeLemon/Filee

Tutte le issue di KnifeLemon/Filee

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.