Skip to content

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Feb 1, 2025

Instead of relying on a (insecure!) dependency we can reuse our already implemented logic for translations.
So we reuse the app translation logic also for the gettext based translations.

  1. Allow to pass the translation bundle to our translation functions
  2. Convert gettext JSON format to our Nextcloud translation format in the GettextBuilder.
  3. Wrap the translation function within out gettext wrapper class

For the enduser this should not change anything (except that we do not have the debug messages node-gettext provided).

@susnux susnux added type: dependencies 🔗 update or change of dependency 3. to review 3️⃣ Waiting for reviews type: refactor ♻️ Refactor code (not a bug fix, not a feature just refactoring) labels Feb 1, 2025
…tion logic

Instead of relying on a (insecure!) dependency we can reuse our already
implemented logic for translations.
So we reuse the app translation logic also for the gettext based
translations.

1. Allow to pass the translation bundle to our translation functions
2. Convert gettext JSON format to our Nextcloud translation format in
   the GettextBuilder.
3. Wrap the translation function within out gettext wrapper class

For the enduser this should not change anything (except that we do not
have the debug messages `node-gettext` provided).

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Grigorii K. Shartsev <grigorii.shartsev@nextcloud.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux force-pushed the refactor/drop-node-gettext branch from 7fd1ec5 to 5e82a6e Compare February 6, 2025 01:01
@susnux susnux merged commit a958c04 into main Feb 6, 2025
14 checks passed
@susnux susnux deleted the refactor/drop-node-gettext branch February 6, 2025 01:03
@susnux susnux mentioned this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review 3️⃣ Waiting for reviews type: dependencies 🔗 update or change of dependency type: refactor ♻️ Refactor code (not a bug fix, not a feature just refactoring)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Library depends on a vulnerable version of node-gettext

4 participants