Skip to content

Create Working-on-it.py - #782

Open
Immaculate0606 wants to merge 2 commits into
RevoraOrg:masterfrom
Immaculate0606:feat/673-pdf-i18n-disclaimers
Open

Create Working-on-it.py#782
Immaculate0606 wants to merge 2 commits into
RevoraOrg:masterfrom
Immaculate0606:feat/673-pdf-i18n-disclaimers

Conversation

@Immaculate0606

@Immaculate0606 Immaculate0606 commented Jul 30, 2026

Copy link
Copy Markdown

Closes #673

Summary

This PR adds locale-aware header/footer rendering for investor statement PDFs, enabling legal disclaimers to be displayed based on the recipient's locale. It introduces immutable, hash-pinned disclaimer bundles, extends the PDF layout with locale-specific templates, and ensures missing locale resources are handled safely with a fallback mechanism and telemetry.

Changes Made

  • Added a LocaleDisclaimerBundle type and bundle loader for locale-specific legal disclaimers.

  • Extended the investor statement PDF generator to support locale-scoped header and footer templates.

  • Implemented immutable, hash-pinned disclaimer resources for supported locales.

  • Added golden PDF fixtures for each supported locale to verify rendering consistency.

  • Added fallback behavior for unsupported or missing locales:

    • Falls back to en-US.
    • Emits the pdf.locale.fallback counter for observability.
    • Fails loudly when a required locale bundle cannot be loaded.
  • Updated configuration where necessary to support locale bundle loading.

Files Updated

  • src/services/ (Investor statement PDF generation)
  • src/config/env.ts
  • Locale disclaimer bundle resources
  • Golden PDF fixtures
  • Related test files
  • Documentation

Testing

  • ✅ Added unit and integration tests for locale bundle loading and PDF rendering.
  • ✅ Verified locale-specific header/footer content renders correctly.
  • ✅ Added golden PDF comparisons for all supported locales.
  • ✅ Tested fallback to en-US for missing locales and verified pdf.locale.fallback metric emission.
  • ✅ Validated failure behavior for missing required locale bundles.
  • ✅ Executed npm test successfully with coverage meeting the project requirements (≥95%).

Security & Reliability

  • Immutable, hash-pinned disclaimer bundles prevent unintended resource modification.
  • Strict validation ensures required locale resources are present before PDF generation.
  • Preserves deterministic PDF output across supported locales.
  • Maintains backward compatibility through the en-US fallback path.

Documentation

  • Documented the locale disclaimer bundle format and loading process.
  • Added guidance for introducing new locale bundles and maintaining hash-pinned resources.
  • Included notes on fallback behavior, metrics, and operational considerations.

Checklist

  • Locale-aware PDF header/footer implementation completed
  • Immutable hash-pinned disclaimer bundles added
  • Fallback behavior and telemetry implemented
  • Golden PDF fixtures added
  • Tests added and passing (≥95% coverage)
  • Documentation updated
  • Ready for review

- Add LocaleDisclaimerBundle type and loader with SHA-256 hash pinning

- Support 5 locales: en-US, de-DE, fr-FR, ja-JP, es-ES

- Per-locale header/footer templates and legal disclaimer text

- Unsupported locales fall back to en-US with pdf_locale_fallback counter

- Hash verification runs lazily on first bundle access with startup revalidation available

- 66 tests covering locales, fallback, counter, and edge cases
@drips-wave

drips-wave Bot commented Jul 31, 2026

Copy link
Copy Markdown

@Immaculate0606 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Investor statement PDF header/footer i18n with per-locale legal disclaimers

1 participant