Skip to content

Commit 10e8d62

Browse files
committed
renamed Nette\Localization\ITranslator -> Translator, added class alias
1 parent 412039b commit 10e8d62

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/Utils/ITranslator.php renamed to src/Utils/Translator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* Translator adapter.
1515
*/
16-
interface ITranslator
16+
interface Translator
1717
{
1818
/**
1919
* Translates the given string.
@@ -22,3 +22,6 @@ interface ITranslator
2222
*/
2323
function translate($message, ...$parameters): string;
2424
}
25+
26+
27+
interface_exists(Nette\Localization\ITranslator::class);

src/compatibility.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,14 @@ interface IHtmlString
1717
class_alias(\Nette\HtmlStringable::class, IHtmlString::class);
1818
}
1919
}
20+
21+
namespace Nette\Localization {
22+
if (false) {
23+
/** @deprecated use Nette\Localization\Translator */
24+
interface ITranslator
25+
{
26+
}
27+
} elseif (!interface_exists(ITranslator::class)) {
28+
class_alias(Translator::class, ITranslator::class);
29+
}
30+
}

0 commit comments

Comments
 (0)