Skip to content

Conversation

@tommyvange
Copy link

@tommyvange tommyvange commented Oct 27, 2025

Description

This pull request:

  • Adds internationalization (i18n) support to the static pages (about.html, contact.html, and faq.html) by introducing i18n data attributes to headings, navigation links, section labels, and other key text elements. It also injects a main JavaScript module for handling dynamic language switching. The changes ensure that all user-facing text can be translated and that a language switcher component can be dynamically added to the navigation menus.
  • Adds internationalization (i18n) support to all the tools including errors and alerts.
  • Adds support for the English and Norwegian language, with English being the default.

Fixes #28

I have published the docker images if anyone wants to try it out, provide feedback or use it for testing.

ghcr.io/tommyvange/bentopdf-simple:latest
ghcr.io/tommyvange/bentopdf:latest

Do not use these packages for production deployment, they are meant as a proof of concept.

I have created the following languages to start with:

  • English
  • Norwegian
  • Spanish
  • French
  • German

These are AI generated files, so the translations may be wrong. They are just there to show the translation working.

My fork of the repo and the docker images will be deleted once @alam00000 decides weather to merge or make his own solution, I do not intent to keep and maintain my own version of BentoPDF.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

🧪 How Has This Been Tested?

Deployed with NPM and tested.

Checklist:

  • Verified output manually

Expected Results:

Be able to change the language between English (default) and Norwegian by using a switcher in the header.

This also lays the groundwork for adding more languages in the future by just creating a new translation file and adding it to the translation service.

Actual Results:

Worked as expected.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

- Added support for JSON module imports in TypeScript.
- Created translation files for English and Norwegian languages.
- Developed i18n module to handle language detection and translations.
- Updated HTML to include data attributes for translation.
- Enhanced main application to initialize i18n and manage dynamic translations.
- Documented the i18n system and usage guidelines in I18N.md and TRANSLATION_SUMMARY.md.
…ssing features

- Updated user-facing messages to utilize translation keys for better localization support.
- Added new translation keys in English and Norwegian for various alerts and processing messages.
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.

(Feature) Add Multi-language Support (i18n).

1 participant