Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit languages for emails #416

Closed
hakito opened this issue Sep 17, 2024 · 2 comments · Fixed by #423 or #450
Closed

Limit languages for emails #416

hakito opened this issue Sep 17, 2024 · 2 comments · Fixed by #423 or #450

Comments

@hakito
Copy link
Contributor

hakito commented Sep 17, 2024

When extending the templates with additional information, it is difficult or impossible for my client to update all translations.

We came up with the idea to restrict the languages to a certain set at least for the email templates. Users with a language setting that is not within the set, will fall back to the default translation.

I will come up with a PR soon to address this issue.

hakito pushed a commit to hakito/LibreBooking that referenced this issue Sep 29, 2024
..but only when custom template is available for default lang.

refs LibreBooking#416
@lucs7
Copy link
Contributor

lucs7 commented Oct 16, 2024

Unfortunately, this commit seems to break the resource view causing:

PHP Fatal error: Access level to ResourceStatusChangeEmail::$email must be protected (as in class EmailMessage) or weaker in /var/www/html/lib/Email/Messages/ResourceStatusChangeEmail.php on line 5

I tried to backtrack where the current development branch breaks, and in the previous commit, it did not occur.
It seems to be caused by the change from private to protected for the $email in EmailMessage.php

I guess the Email/Messages would have to be adjusted to the same visibility, but I am not really into php to be of help here

hakito pushed a commit to hakito/LibreBooking that referenced this issue Nov 2, 2024
* Remove *-custom.tpl from repo - should only be provided by the user
* Ignore custom translation files
* defaultPath is a fallback path - The name is misleading, as it's not the default.language setting
* Remove dead code
  * DisplayLocalized in SmartyPage was never called
  * DisplayLocalized in Page was only a copy, which is still called, but the languageCode parameter is not used.
* Fix save custom email template for selected language - fixes LibreBooking#424
* Fallback to default lang for missing custom templates ..but only when custom template is available for default lang.
* Add config description
* Change ReservationShareMail property name - It conflicts with the now protected email property
* Fix unit test for updating email template
* closes LibreBooking#416
hakito pushed a commit to hakito/LibreBooking that referenced this issue Nov 2, 2024
* Remove *-custom.tpl from repo - should only be provided by the user
* Ignore custom translation files
* defaultPath is a fallback path - The name is misleading, as it's not the default.language setting
* Remove dead code
  * DisplayLocalized in SmartyPage was never called
  * DisplayLocalized in Page was only a copy, which is still called, but the languageCode parameter is not used.
* Fix save custom email template for selected language - fixes LibreBooking#424
* Fallback to default lang for missing custom templates ..but only when custom template is available for default lang.
* Add config description
* Change ReservationShareMail property name - It conflicts with the now protected email property
* Fix unit test for updating email template
* closes LibreBooking#416
@hakito
Copy link
Contributor Author

hakito commented Nov 2, 2024

@lucs7 I created a new PR that addresses the issue and renames the private fields of the derived classes.

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 a pull request may close this issue.

2 participants