Created
December 7, 2019 15:58
-
-
Save theodesp/b740e303eb1660190f630197edcda2bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\AppBundle; | |
use Symfony\Bundle\FrameworkBundle\Translation\Translator as BaseTranslator; | |
class PhraseTranslator extends BaseTranslator | |
{ | |
public function trans($id, array $parameters = array(), $domain = "messages", $locale = null) | |
{ | |
$prefix = "{{__phrase_"; | |
$suffix = "__}}"; | |
if (null === $domain) { | |
$domain = 'messages'; | |
} | |
// Return ID of translation key with pre- and suffix for PhraseApp | |
return $prefix.$id.$suffix; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment