Multiple instances of ITranslator

3 years ago

Etruska
Member | 25
+
0
-

Hi,
I have created wrapper class around Kdyby Translator, which allows me to automatically save not translated expressions into all of the corresponding .neon files and adds other features. All works well, but I have two services implementing Nette\Localization\ITranslator – translation.default by KdybyExtension and mine NeonTranslator. When I try to use IPub/VisualPaginator, which wants to include ITranslator service, expected exception gets thrown:

Service 'visualPaginator.paginator': Multiple services of type Nette\Localization\ITranslator found: translation.default, 90_App_Model_Translate_NeonTranslator

Is there any way to fix it without altering vendor files?

3 years ago

David Matějka
Moderator | 5764
+
+1
-
services:
    translation.default:
        autowired: false

3 years ago

Etruska
Member | 25
+
0
-

Thank you, I didn't even hope for such nice and clean solution :)