8000 [Translation] trans, add support of domain in $id message by wtorsi · Pull Request #37769 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Translation] trans, add support of domain in $id message #37769

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

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[ISSUE_37743] trans, add support of domain in $id message
# Conflicts:
#	src/Symfony/Component/Translation/Translator.php
  • Loading branch information
itsd.one committed Aug 8, 2020
commit 9d3c70b069ebb1fc574c09d1a85399ad8fbbe658
8 changes: 5 additions & 3 deletions src/Symfony/Component/Translation/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,11 @@ public function trans(?string $id, array $parameters = [], string $domain = null
return '';
}

$parsed = explode('@', $id);
$id = $parsed[0];
$domain = $parsed[1] ?? $domain ?? 'messages';
if (null === $domain) {
$parsed = explode('@', $id);
$id = $parsed[0];
$domain = $parsed[1] ?? 'messages';
}

$catalogue = $this->getCatalogue($locale);
$locale = $catalogue->getLocale();
Expand Down
0