Skip to content

Commit

Permalink
renamed Nette\Localization\ITranslator -> Translator, added class alias
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Sep 3, 2020
1 parent 044d1fa commit 262685a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Utils/ITranslator.php → src/Utils/Translator.php
Expand Up @@ -13,7 +13,7 @@
/**
* Translator adapter.
*/
interface ITranslator
interface Translator
{
/**
* Translates the given string.
Expand All @@ -22,3 +22,6 @@ interface ITranslator
*/
function translate($message, ...$parameters): string;
}


interface_exists(Nette\Localization\ITranslator::class);
11 changes: 11 additions & 0 deletions src/compatibility.php
Expand Up @@ -17,3 +17,14 @@ interface IHtmlString
class_alias(\Nette\HtmlStringable::class, IHtmlString::class);
}
}

namespace Nette\Localization {
if (false) {
/** @deprecated use Nette\Localization\Translator */
interface ITranslator
{
}
} elseif (!interface_exists(ITranslator::class)) {
class_alias(Translator::class, ITranslator::class);
}
}

0 comments on commit 262685a

Please sign in to comment.