Skip to content

[Translation] Allow to use false as domain for translatableMessage #60935

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

Open
wants to merge 1 commit into
base: 7.4
Choose a base branch
from

Conversation

VincentLanglet
Copy link
Contributor

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #...
License MIT

When working with translation, it's "classic" to have library with the following logic:

if ($message instanceof Translatable) {
      $message->trans($translator);
} else {
	 $translator->trans($message, domain: OpenSourceBundle);
}

Then if the user doesn't want the text to be translated, he cannot.

A useful and simple way would be to support new TranslatableMessage($text, domain: false)

@carsonbot

This comment has been minimized.

@VincentLanglet VincentLanglet marked this pull request as ready for review June 28, 2025 07:15
@carsonbot carsonbot added this to the 7.4 milestone Jun 28, 2025
@carsonbot carsonbot changed the title Allow to use false as domain for translatableMessage [Translation] Allow to use false as domain for translatableMessage Jun 29, 2025
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

can you please add a line in the changelog ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy