Created
April 1, 2014 15:43
-
-
Save Ocramius/9916793 to your computer and use it in GitHub Desktop.
This file contains 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 | |
class AggregateTranslator implements YADDATranslator | |
{ | |
/** @var YADDATranslator[] */ | |
private $translators = []; | |
// ... | |
public function translate($string) | |
{ | |
foreach ($this->translators as $translator) { | |
if ($string !== ($translated = $translator->translate($string))) { | |
return $string; | |
} | |
} | |
return $string; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks Marco! My problem is a little different but I think it comes down to this: