You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you fetch messages using MessageCatalogue::all() from a MessageCatalogue, it automatically merges domain and domain+intl-icu messages. However, MessageCatalogue::getMetadata does NOT do this, causing messages to exist but metadata missing.
This gets more serious as ->getDomains() returns the plain domains (without +intl-icu), causing metadata being dropped in most things that loops over messages (such as \Symfony\Component\Translation\Bridge\Crowdin\CrowdinProvider)
How to reproduce
<?phprequire_once'./vendor/autoload.php';
$catalog = new \Symfony\Component\Translation\MessageCatalogue("en");
$catalog->add(["key" => "The text"], domain: "messages+intl-icu");
$catalog->setMetadata("key", ['notes' => [['content' => "This will disappear"]]], domain: "messages+intl-icu");
foreach ($catalog->getDomains() as$domain) {
foreach ($catalog->all($domain) as$key => $value) {
// Shouldn't be null here!if($catalog->getMetadata($key, $domain) == null) {
echo"Woe and despair, my metadata is hiding from me!\n";
}
}
}
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Symfony version(s) affected
7.2.6
Description
If you fetch messages using
MessageCatalogue::all()
from a MessageCatalogue, it automatically mergesdomain
anddomain+intl-icu
messages. However,MessageCatalogue::getMetadata
does NOT do this, causing messages to exist but metadata missing.This gets more serious as
->getDomains()
returns the plain domains (without +intl-icu), causing metadata being dropped in most things that loops over messages (such as\Symfony\Component\Translation\Bridge\Crowdin\CrowdinProvider
)How to reproduce
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: