-
Notifications
You must be signed in to change notification settings - Fork 3
[feat] 国際団体向け英語版物品貸出表の実装 #1997
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
base: gm3/develop
Are you sure you want to change the base?
[feat] 国際団体向け英語版物品貸出表の実装 #1997
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
このPRは国際団体向けの英語版物品貸出表PDF出力機能を実装してるよ〜✨ 管理者画面から英語版をダウンロードできるようにして、国際団体のみをフィルタリングして出力する機能が追加されてるっ💪
Changes:
- Rails i18nを使った英語・日本語の多言語対応(locale切り替え機能)
locale=enパラメータで国際団体(is_international: true)のみフィルタリング- 管理画面に英語版PDF専用ダウンロードボタンを追加
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| api/config/locales/all_groups_rental_items/ja.yml | 日本語版の翻訳ファイル新規追加 - テンプレートで使用する文言を定義 |
| api/config/locales/all_groups_rental_items/en.yml | 英語版の翻訳ファイル新規追加 - 国際団体向け英訳を定義 |
| api/app/views/print_pdf/output_all_groups_rental_items.pdf.erb | ハードコードされた日本語文字列をi18nのt()ヘルパーに置き換え、時間表記と単位記号の修正も含む |
| api/app/controllers/print_pdf_controller.rb | localeパラメータ処理と国際団体フィルタリング、I18n.with_localeでのレンダリング制御を追加 |
| api/app/views/print_pdf/output_rental_items_pdf.css | CSSネスト記法からフラットなセレクタに修正(技術的な改善) |
| admin_view/nuxt-project/pages/print/index.vue | 英語版PDF専用のダウンロードボタンとハンドラー関数を追加 |
| - "Check in at the headquarters when returning items." | ||
| - "Use the designated pickup and return locations." |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
英語の注意事項の順番が日本語版と違っちゃってるよ💦 日本語版は「場所を間違えない→チェックを受ける→綺麗にする」なのに、英語版は「本部でチェック→場所を守る→綺麗にする」になってて内容も微妙に変わってる😵 翻訳ミスっぽいから、日本語版と同じ順番と意味にした方がいいと思う〜✨
| - "Check in at the headquarters when returning items." | |
| - "Use the designated pickup and return locations." | |
| - "Use the designated pickup and return locations." | |
| - "Check in at the headquarters when returning items." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これは対応して――
| en: | ||
| print_pdf: | ||
| output_all_groups_rental_items: | ||
| title: "Participating Organization Information Management Chart" |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
英訳がちょっと違うかもっ💦 "Participating Organization Information Management Chart"って長すぎるし、元の日本語「物品貸出表」は"Rental Items List"とか"Equipment Rental Form"の方がピッタリじゃね?🤔 Managementって管理って意味だけど、この表は管理用じゃなくて貸出用だから意味がズレちゃってるよ〜😅
| title: "Participating Organization Information Management Chart" | |
| title: "Equipment Rental Form" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rental Items Listでよさそう。
| locale = params[:locale].presence&.to_sym || :ja | ||
| @groups = @groups.where(is_international: true) if locale == :en |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
localeの取得処理が2回書かれてて重複しちゃってるっ😅 output_all_groups_rental_items_pdfメソッド(16行目)とprint_pdfメソッド(112行目)の両方で同じことやってるから、DRYじゃないよね💦 16-17行目のlocale取得とフィルタリング処理は残して、print_pdfメソッドに渡す方がスッキリするかもっ✨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これ一旦いらない。
他のpdf出力もlocaleを使うなら引数としてlocaleを渡すようにしたいけどとりあえずはこのままでコメント残しておくとかでもいい。
## 今後の実装によってprint_pdfにlocaleの引数を持たせる。
| def output_all_groups_rental_items_pdf | ||
| @groups = Group.where(fes_year_id: params[:fes_year_id]).order(:group_category_id) | ||
| locale = params[:locale].presence&.to_sym || :ja | ||
| @groups = @groups.where(is_international: true) if locale == :en | ||
| print_pdf('output_all_groups_rental_items', 'output_rental_items_pdf', '物品貸出表', 'Not Landscape') | ||
| end |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新しいlocaleパラメータとis_internationalフィルタリング機能にテストがないっぽいよ〜💦 output_all_groups_rental_items_pdfアクションのテストを追加して、locale=enの時に正しく国際団体だけフィルタリングされるかとか、I18n.with_localeが正しく動くかチェックした方がいいと思う!🧪 他のコントローラーにはテストあるし、このPRはけっこう重要な機能だからテストカバレッジ欲しいな〜✨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
できたらあついけどテスト固めてないからなーー
hikahana
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
purhaceListの配列直したら動いたーー
出力されるpdfはよさそう~~
| def output_all_groups_rental_items_pdf | ||
| @groups = Group.where(fes_year_id: params[:fes_year_id]).order(:group_category_id) | ||
| locale = params[:locale].presence&.to_sym || :ja | ||
| @groups = @groups.where(is_international: true) if locale == :en | ||
| print_pdf('output_all_groups_rental_items', 'output_rental_items_pdf', '物品貸出表', 'Not Landscape') | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
できたらあついけどテスト固めてないからなーー
| ● 借用および返却時は貸出場所にいる実行委員のチェックを受けてください。<br> | ||
| ● 備品等は絶対に汚さないように使用し、綺麗にしてから返却してください。 | ||
| <%= t('.precautions.title') %><br><br> | ||
| <% t('.precautions.items').each do |note| %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18nは配列ではなくて文字列らしいので.eachで配列処理をするとエラーになるらしい。
ので配列だよっていうのを明示しておく必要があるって。はえーって感じ。
| <% t('.precautions.items').each do |note| %> | |
| <% Array(t('.precautions.items')).each do |note| %> |
一応印刷したやつ載せとくーー
物品貸し出し表まとめ(国際団体・英語版) (4).pdf
| en: | ||
| print_pdf: | ||
| output_all_groups_rental_items: | ||
| title: "Participating Organization Information Management Chart" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rental Items Listでよさそう。
| - "Check in at the headquarters when returning items." | ||
| - "Use the designated pickup and return locations." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これは対応して――
| locale = params[:locale].presence&.to_sym || :ja | ||
| @groups = @groups.where(is_international: true) if locale == :en |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これ一旦いらない。
他のpdf出力もlocaleを使うなら引数としてlocaleを渡すようにしたいけどとりあえずはこのままでコメント残しておくとかでもいい。
## 今後の実装によってprint_pdfにlocaleの引数を持たせる。
|
あ、団体のカテゴリの英語対応も必要かも |
対応Issue
resolve #1992
概要
実装詳細
画面スクリーンショット等
テスト項目
備考