[PR #1460] [MERGED] fix: certificate translations #1644

Closed
opened 2026-02-26 19:34:08 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1460
Author: @dguyen
Created: 11/11/2024
Status: Merged
Merged: 11/12/2024
Merged by: @Mythie

Base: mainHead: fix/certificate-translations


📝 Commits (1)

  • 4b626e2 fix: certificate translations

📊 Changes

5 files changed (+30 additions, -7 deletions)

View changed files

📝 apps/web/src/app/(dashboard)/documents/[id]/logs/document-logs-page-view.tsx (+1 -0)
📝 apps/web/src/app/(dashboard)/documents/[id]/logs/download-certificate-button.tsx (+3 -1)
📝 apps/web/src/app/(teams)/t/[teamUrl]/settings/preferences/document-preferences.tsx (+3 -3)
📝 packages/lib/server-only/document/seal-document.ts (+5 -1)
📝 packages/lib/server-only/htmltopdf/get-certificate-pdf.ts (+18 -2)

📄 Description

Description

Currently certificate translations on production sometimes does not show the required language.

This could not be replicated when creating certificates on staging (Browserless.io) and local development (Chromium), which means this fix ultimately cannot be tested unless on live.

This is an attempt to fix it by isolating the certificate generation into it's own context, and applying a cookie to define the required language.

This fix is based on the assumption that there is some sort of error which pushes the certificate to be generated on the client side, which ultimately will render in English due to constraints on nextjs.

Changes Made

  • Apply language into cookie instead purely dynamically on SSR
  • Minor unrelated fixes

Testing Performed

Tested to ensure certificates could still be generated

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a teamId prop to the DownloadCertificateButton, enhancing its functionality by allowing team context during certificate downloads.
    • Introduced language support in certificate PDF generation, ensuring documents respect the specified language settings.
  • Bug Fixes

    • Improved string formatting in the TeamDocumentPreferencesForm for better clarity in user messages.
  • Chores

    • Enhanced resource management in the PDF generation process by properly handling browser context.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/1460 **Author:** [@dguyen](https://github.com/dguyen) **Created:** 11/11/2024 **Status:** ✅ Merged **Merged:** 11/12/2024 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `fix/certificate-translations` --- ### 📝 Commits (1) - [`4b626e2`](https://github.com/documenso/documenso/commit/4b626e223e40f5990f5bfaf83bae5962d30f7a5c) fix: certificate translations ### 📊 Changes **5 files changed** (+30 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/src/app/(dashboard)/documents/[id]/logs/document-logs-page-view.tsx` (+1 -0) 📝 `apps/web/src/app/(dashboard)/documents/[id]/logs/download-certificate-button.tsx` (+3 -1) 📝 `apps/web/src/app/(teams)/t/[teamUrl]/settings/preferences/document-preferences.tsx` (+3 -3) 📝 `packages/lib/server-only/document/seal-document.ts` (+5 -1) 📝 `packages/lib/server-only/htmltopdf/get-certificate-pdf.ts` (+18 -2) </details> ### 📄 Description ## Description Currently certificate translations on production sometimes does not show the required language. This could not be replicated when creating certificates on staging (Browserless.io) and local development (Chromium), which means this fix ultimately cannot be tested unless on live. This is an attempt to fix it by isolating the certificate generation into it's own context, and applying a cookie to define the required language. This fix is based on the assumption that there is some sort of error which pushes the certificate to be generated on the client side, which ultimately will render in English due to constraints on nextjs. ## Changes Made - Apply language into cookie instead purely dynamically on SSR - Minor unrelated fixes ## Testing Performed Tested to ensure certificates could still be generated <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes - **New Features** - Added a `teamId` prop to the `DownloadCertificateButton`, enhancing its functionality by allowing team context during certificate downloads. - Introduced language support in certificate PDF generation, ensuring documents respect the specified language settings. - **Bug Fixes** - Improved string formatting in the `TeamDocumentPreferencesForm` for better clarity in user messages. - **Chores** - Enhanced resource management in the PDF generation process by properly handling browser context. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:34:08 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1644
No description provided.