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

fix: 言語の表示を正しくする #311

Merged
merged 2 commits into from
Mar 28, 2025
Merged

Conversation

yamakeeeeeeeeen
Copy link
Collaborator

#308
言語表示がen & jaとなっているのを、セッションの情報に合わせてJapaneseEnglishと表示するよう修正

Copy link
Member

@kinoppyd kinoppyd left a comment

Choose a reason for hiding this comment

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

In conclusion, this is a bug embedded in this PR.
#293

The Language string(e.g., JA) should be transformed to downcase and compared using Schedule.languages.has_key?, but isn't.
Do not fix this by adding a new method language_text in Schedule model, it should be corrected by comparing downcased string in the seed file.

結論から言うと、このPRでエンバグしてました。
#293

シードファイルに書かれてるJAみたいな文字列を、downcaseしてから Schedule.languages#has_key? にかける必要があるんですが、そうなってないですね。
Scheduleモデルに新しい文字列をはやして対処するのではなく、seedの取り込み段階で修正する必要があります。

@@ -106,7 +106,11 @@
schedule.update!(
title: presentation['title'],
description: presentation['description'],
language: presentation['language'].then { Schedule.languages.has_key?(_1) ? _1 : "en & ja" }.downcase
language: case presentation['language']
Copy link
Member

@kinoppyd kinoppyd Mar 28, 2025

Choose a reason for hiding this comment

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

Suggested change
language: case presentation['language']
language: presentation['language'].then(&:downcase).then { Schedule.languages.has_key?(_1) ? _1 : "en & ja" }

Copy link
Member

@kinoppyd kinoppyd left a comment

Choose a reason for hiding this comment

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

I know what this fix must be applied as soon as possible, so I approve it.
Fix details later.

割とすぐに入れないといけないことは理解しているので、いったんこれで行きましょう。
詳細は後日修正で。

@kinoppyd
Copy link
Member

Fix conflict plz

@yamakeeeeeeeeen yamakeeeeeeeeen merged commit 17d932a into 2025 Mar 28, 2025
2 checks passed
@yamakeeeeeeeeen yamakeeeeeeeeen deleted the fix-language-text branch March 28, 2025 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants