Skip to content

fix(#8541): add missing print.storycontext.title translation key#10049

Open
BacLuc wants to merge 1 commit into
ecamp:develfrom
BacLuc:print-storycontext-translation
Open

fix(#8541): add missing print.storycontext.title translation key#10049
BacLuc wants to merge 1 commit into
ecamp:develfrom
BacLuc:print-storycontext-translation

Conversation

@BacLuc

@BacLuc BacLuc commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

fix(#8541): align print story title key with pdf implementation

The pdf service correctly derives the Story summary page title from a
'type' prop ('Story') which resolves to the translation key
'print.story.title'. The print service was deriving the same title from
the API content type name ('Storycontext'), which produced the key
'print.storycontext.title' - a key that did not exist in the locales.

History of the inconsistency:

  • Originally both services used the same hardcoded key.
  • When the generic 'summary' page was refactored (a6578ee), the title
      key became dynamically based on the content type name.
  • The pdf service later cleanly separated the API query parameter
      (contentType='Storycontext') from the display translation key
      (type='Story'). (commit: 2386503).
  • The print service never received this separation, so it continued to
      conflate the two, leading to the wrong key being looked up.

Instead of adding a new 'print.storycontext.title' translation to every
locale (the workaround that PR #10049 originally proposed), fix the root
cause by adding a 'type' prop to the print SummaryPeriod component and
passing it from Story and SafetyConsiderations config components.

This makes the print implementation consistent with the pdf one:

  • PDF: uses camelCase(content.type)  -> 'story'
  • Print: now uses camelCase(type)    -> 'story'

Also restored the scout-specific 'Roter Faden' translation in
de-CH-scout.json under print.story.title.

Fixes #8541

@BacLuc BacLuc requested a review from a team June 14, 2026 09:05
@BacLuc BacLuc added the deploy! Creates a feature branch deployment for this PR label Jun 14, 2026
@BacLuc BacLuc temporarily deployed to feature-branch June 14, 2026 09:08 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown

Feature branch deployment ready!

Name Link
😎 Deployment https://pr10049.ecamp3.ch/
🔑 Login test@example.com / test
🕒 Last deployed at Sun Jun 14 2026 18:17:07 GMT+0200
🔨 Latest commit 6666af24f93df8b22a7a70b8aa132617f140f340
🔍 Latest deploy log https://github.com/ecamp/ecamp3/actions/runs/27504644169/job/81293778965
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

@BacLuc BacLuc added deploy! Creates a feature branch deployment for this PR and removed deploy! Creates a feature branch deployment for this PR labels Jun 14, 2026
@BacLuc BacLuc temporarily deployed to feature-branch June 14, 2026 09:43 — with GitHub Actions Inactive

@carlobeltrame carlobeltrame left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd rather we make things consistent instead of quick fixes. Why is a different key used between the two prints?

@BacLuc

BacLuc commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

print uses:

{{ $t('print.' + camelCase(contentType) + '.title') }}:

pdf uses

return this.$tc('print.' + this.camelCase(this.content) + '.title')

Will decide later which one was first and use that.

The pdf service correctly derives the Story summary page title from a
'type' prop ('Story') which resolves to the translation key
'print.story.title'. The print service was deriving the same title from
the API content type name ('Storycontext'), which produced the key
'print.storycontext.title' - a key that did not exist in the locales.

History of the inconsistency:
- Originally both services used the same hardcoded key.
- When the generic 'summary' page was refactored (a6578ee), the title
  key became dynamically based on the content type name.
- The pdf service later cleanly separated the API query parameter
  (contentType='Storycontext') from the display translation key
  (type='Story'). (commit: 2386503).
- The print service never received this separation, so it continued to
  conflate the two, leading to the wrong key being looked up.

Instead of adding a new 'print.storycontext.title' translation to every
locale (the workaround that PR ecamp#10049 originally proposed), fix the root
cause by adding a 'type' prop to the print SummaryPeriod component and
passing it from Story and SafetyConsiderations config components.

This makes the print implementation consistent with the pdf one:
- PDF: uses camelCase(content.type)  -> 'story'
- Print: now uses camelCase(type)    -> 'story'

Also restored the scout-specific 'Roter Faden' translation in
de-CH-scout.json under print.story.title.

Fixes ecamp#8541

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: BacLuc <lucius.bachmann@clubpage.ch>
@BacLuc BacLuc force-pushed the print-storycontext-translation branch from 1a97af7 to 6666af2 Compare June 14, 2026 16:12
@BacLuc BacLuc requested a review from carlobeltrame June 14, 2026 16:13
@BacLuc BacLuc deployed to feature-branch June 14, 2026 16:15 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy! Creates a feature branch deployment for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nuxt print shows raw translation key

2 participants