Skip to content

Live Update通知チャンネルおよび通知文言をi18n対応 - #5389

Merged
TinyKitten merged 2 commits into
devfrom
feature/live-updates-i18n
Feb 21, 2026
Merged

TinyKitten merged 2 commits into
devfrom
feature/live-updates-i18n

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Feb 21, 2026 •

Copy link
Copy Markdown
Member

close #5388

Co-Authored-By: Claude Opus 4.6 [email protected]

Summary by CodeRabbit

  • 新機能

    • 駅番号を含む表示に対応(駅名に番号を付けて表示)。
    • 行先表記の細かい整形を追加(語尾の区切りに配慮した表示)。
  • ローカライズ

    • 通知チャネル名・説明をリソースから取得するよう変更(日本語・英語の文字列追加)。
    • 通過・接近・次駅の通知メッセージを言語別の形式文字列で出力。

@TinyKitten TinyKitten self-assigned this Feb 21, 2026
@coderabbitai

coderabbitai Bot commented Feb 21, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

LiveUpdateModule.kt の通知文言と駅名表示ロジックをリソース化・拡張。通知チャンネル名・説明を文字列リソースへ移動し、駅番号対応(stationNumber 等)と表示フォーマット(括弧付与・方面処理)を追加。英語・日本語の strings.xml を追加・更新。

Changes

Cohort / File(s) Summary
Kotlin 実装
android/app/src/main/java/me/tinykitten/trainlcd/LiveUpdateModule.kt
通知チャネル名/説明をハードコードから R.string 参照へ変更。駅番号対応の state フィールド(stationNumber, nextStationNumber, boundStationNumber, passingStationNumber)と formatStationWithNumber を追加。通知タイトル/本文生成ロジックをローカライズ文字列および番号対応フォーマットに更新(passing/approaching/next/停止等)。
日本語リソース
android/app/src/main/res/values/strings.xml
live_update_channel_name, live_update_channel_description, live_update_passing, live_update_approaching, live_update_next を追加(日本語文言)。
英語リソース
android/app/src/main/res/values-en/strings.xml
対応する英語版 live_update_channel_name, live_update_channel_description, live_update_passing, live_update_approaching, live_update_next を新規追加。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 ピョンと来てコードを覗けば
文字が飛び出す国際化の道しるべ
括弧で番号をそっと抱え込み
日本語と英語で知らせるよ
走る電車に拍手を送るラビット 🚆✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning 変更は issue #5388 の要件(通知チャンネルの文言をi18n対応化)に完全に範囲内ですが、commit メッセージで述べられている station numbers の追加とテキスト形式の変更は issue の要件には含まれていません。 station numbers の追加機能と「次は〇〇」への変更が追加で実装されています。これらが issue #5388 に明示的に含まれていないため、別の issue または commit で対応すべき変更です。
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR のタイトルは、ハードコードされた通知チャンネルの文言をi18n対応するという主要な変更を正確に反映しており、明確で簡潔です。
Linked Issues check ✅ Passed PR は issue #5388 のすべての要件を満たしています。通知チャンネル名と説明をリソースファイルに移動し、getString() で取得し、日本語と英語の両方のリソースを追加しています。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/live-updates-i18n

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
android/app/src/main/java/me/tinykitten/trainlcd/LiveUpdateModule.kt (1)

136-137: 駅名が空のときの表示体裁を整える(任意)
Line 136-137 で name が空・number が有る場合に「 (番号)」だけが出るので、必要なら number 単独表示にしておくと見栄えが安定します。

🔧 例: 空名を考慮
-        fun formatStationWithNumber(name: String, number: String): String =
-            if (number.isNotEmpty()) "$name ($number)" else name
+        fun formatStationWithNumber(name: String, number: String): String =
+            when {
+                name.isEmpty() -> number
+                number.isNotEmpty() -> "$name ($number)"
+                else -> name
+            }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@android/app/src/main/java/me/tinykitten/trainlcd/LiveUpdateModule.kt` around
lines 136 - 137, The helper formatStationWithNumber currently returns "
(number)" when name is empty; update formatStationWithNumber(name: String,
number: String) to detect blank/empty name and, if name.isBlank() and
number.isNotEmpty(), return just the number, otherwise keep the existing
behavior (if number.isNotEmpty() return "$name ($number)" else return name) so
the display doesn't show a leading space/paren when the station name is missing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@android/app/src/main/java/me/tinykitten/trainlcd/LiveUpdateModule.kt`:
- Around line 146-155: formattedBoundName currently splits boundStationName by a
delimiter that can be "・" or "/", but always splits boundStationNumber by "/",
causing mismatches; update the logic in the formattedBoundName block to compute
the same delimiter for boundStationNumber as for boundStationName (or split
boundStationNumber by both delimiters) so names and numbers align, i.e., use the
same delimiter variable when calling split on boundStationNumber before mapping
into formatStationWithNumber(name, number).

---

Nitpick comments:
In `@android/app/src/main/java/me/tinykitten/trainlcd/LiveUpdateModule.kt`:
- Around line 136-137: The helper formatStationWithNumber currently returns "
(number)" when name is empty; update formatStationWithNumber(name: String,
number: String) to detect blank/empty name and, if name.isBlank() and
number.isNotEmpty(), return just the number, otherwise keep the existing
behavior (if number.isNotEmpty() return "$name ($number)" else return name) so
the display doesn't show a leading space/paren when the station name is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live Update通知チャンネルの文言をi18n対応する

1 participant