这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@belcirelk
Copy link
Contributor

When a reminder is set and the language is set to French, the reservation pdf can't be generated because the template does not escape for javascript after translation. In French the default string contains an apostrophe and this is breaking the javascript code. It also makes the update of the reservation impossible since the javascript code generate an error. Adding "|escape:'javascript'" to ReminderBeforeStart and ReminderBeforeEnd fix the problem. The code also fix the French translation.

Closes: #584

When a reminder is set and the language is set to French, the reservation pdf
can't be generated because the template does not escape for javascript after
translation. In French the default string contains an apostrophe and this is
breaking the javascript code. It also makes the update of the reservation
impossible since the javascript code generate an error. Adding
"|escape:'javascript'" to ReminderBeforeStart and ReminderBeforeEnd
fix the problem. The code also fix the French translation.

Closes: LibreBooking#584
@JohnVillalovos JohnVillalovos requested a review from Copilot July 17, 2025 04:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a PDF generation error in French due to unescaped apostrophes in reminder strings, and corrects several French translations.

  • Escape translated reminder strings for JavaScript context in pdf.tpl
  • Update French translations for ReminderBeforeEnd and correct typos in fr_fr.php

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tpl/Reservation/pdf.tpl Add `
lang/fr_fr.php Correct ReminderBeforeEnd semantics and fix typos in several strings
Comments suppressed due to low confidence (2)

lang/fr_fr.php:414

  • The semantics of ReminderBeforeEnd were changed from "après l'heure de fin" to "avant l'heure de fin"; verify that this matches the intended behavior for end-time reminders.
        $strings['ReminderBeforeEnd'] = 'avant l\'heure de fin';

tpl/Reservation/pdf.tpl:262

  • Consider adding a unit or integration test to validate PDF generation with French reminder strings containing apostrophes to prevent regressions.
		{ content: '{$ReminderTimeEnd} {translate key=$ReminderIntervalEnd} {$ReminderBeforeEnd|escape:'javascript'}'},

@belcirelk
Copy link
Contributor Author

For information, my first try was the cleaner version {translate key=ReminderBeforeStart|escape:'javascript'} as suggested by copilot, but it had no effect.

Copy link
Contributor

@JohnVillalovos JohnVillalovos left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @belcirelk

@JohnVillalovos JohnVillalovos merged commit ba5a6fa into LibreBooking:develop Jul 17, 2025
11 checks passed
@belcirelk belcirelk deleted the fix/resolve-pdf-generation-when-reminder-is-set branch July 17, 2025 14:15
@JohnVillalovos
Copy link
Contributor

@belcirelk Feel free to join us in our Discord channel if you like https://discord.gg/4TGThPtmX8 Come by and say hi.

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.

French version of the reservation page do not completely load when a reminder is set.

2 participants