Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
187 additions
and
68 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yiisoft\I18n; | ||
|
||
interface TranslatorInterface | ||
{ | ||
public function translate(?string $message, string $category = null, string $locale = null): ?string; | ||
/** | ||
* Translates a message to the specified language. | ||
* If a translation is not found, a {{@see \Yiisoft\I18n\Event\MissingTranslationEvent} event will be triggered. | ||
* | ||
* @param string $id the id of the message to be translated. It can be either artificial ID or the source message. | ||
* @param array $parameters An array of parameters for the message | ||
* @param string $category the message category | ||
* @param string $locale the target locale | ||
* @return string|null the translated message or false if translation wasn't found or isn't required | ||
*/ | ||
public function translate( | ||
string $id, | ||
array $parameters = [], | ||
string $category = null, | ||
string $locale = null | ||
): ?string; | ||
} |
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