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

Use correct translation placeholder syntax for error messages #38

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

jensschuppe
Copy link
Collaborator

The LoggerInterface method receives translatable strings and should therefor use the same placeholder syntax as t(). Translation template extraction will also complain about that.

@jensschuppe jensschuppe added bug Something isn't working status:needs review Code needs review and testing labels Sep 30, 2024
@jensschuppe jensschuppe added this to the 1.1.x milestone Sep 30, 2024
Copy link
Contributor

@dontub dontub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.php-fig.org/psr/psr-3/ says:

Placeholder names MUST be delimited with a single opening brace { and a single closing brace }. There MUST NOT be any whitespace between the delimiters and the placeholder name.

@jensschuppe
Copy link
Collaborator Author

Well, there's a mix of two concepts here. First, Drupal's interface translation chimes in and replaces Drupal-style placeholders, before the message is being passed to the actual logger implementation, see https://drupalize.me/blog/how-log-messages-drupal-8

@jensschuppe jensschuppe merged commit 33dc2f0 into 1.1.x Oct 1, 2024
17 checks passed
@jensschuppe jensschuppe added status:fixed The issue has been resolved (usually by committing/merging code) and removed status:needs review Code needs review and testing labels Oct 1, 2024
@jensschuppe jensschuppe deleted the loggerTranslatable branch October 1, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status:fixed The issue has been resolved (usually by committing/merging code)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants