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

オープン 初心者向け
#1,887 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp

調査の方向性

tests/Filee.App.Tests/PortableFirstStartTests.cs の46行目と57行目付近から始めてください。ここではアサーションが portable.import_next の en カタログエントリを読み込んでいます。次に src/Filee.App/Services/LocalizationService.cs の LocalizationService.EarlyText(175~183行)と、CurrentUICulture に従う96行目の Resolve("auto") の経路を読みます。英語以外のシステムカルチャでテストが通れば完了です。テスト内で早期の言語を強制するか、現在の UI カルチャの文字列と照合するかのどちらでも構いません。

索引モデルが issue の本文から書いたものです。

説明

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).

主要言語
C#
スター
3.6k
フォーク
192
平均マージ
14時間 23分
マージ済み PR(30日)
458

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

KnifeLemon/Filee のほかの issue

KnifeLemon/Filee の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。