New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mautic.ERROR: InvalidArgumentException: Unable to choose a translation #8716
Comments
the same bug #8730 |
+1 I have the same problem. The language is also Russian. The version of the mautic is also 2.16.2. Tell me, please, how to fix it? |
to @pospelov-v
In addition to this error, you may encounter some actions in campaigns that are not working (bug #8719), so it's better to cancel the Russian language in the settings for now by clearing the cache. In Russian: |
This issue has been mentioned on Mautic Community Forums. There might be relevant details there: https://forum.mautic.org/t/problem-with-the-russian-language/14263/2 |
Do we know if this is an issue with the translation itself, or a bug within Mautic? @directpromo have you got any insights you could share? |
I am not a programmer, unfortunately. I tried to solve the problem by deleting the translation lines causing the error from the translation files. It helped. Then I deleted these lines in translation at https://www.transifex.com/mautic/mautic/. It does not help. Since the translation files are downloaded again from https://www.transifex.com/mautic/mautic/ and the deleted lines reappear, the same error occurs The translation strings themselves, in my opinion, do not contain errors - they are correctly composed, it is strange that a bug appears. |
see answer in #8719 (comment) |
@RCheesley How to manage translations in order to prevent errors in translation into Mautic? |
@RCheesley If for some reason you want to translate to "ru_RU" instead of "ru", then how to copy all the translations? Who can do it? |
Hi there, as we are only providing fixes for Mautic 3.x going forward, can you confirm if this continues in Mautic 3.0.1? |
It remains to wait for the stable version 3.x |
Please test on mautibox.com - should be possible to test! |
Hi, without any feedback we cannot carry this issue open anymore. I'll close it and in case a new comment justify to re-open it, I'll be glad to do it :) |
hi, just test with Russian lang enabled in Admin as default locale.
and below from logs I think: click to show full error here`/vendor/symfony/translation/MessageSelector.php:89 at /vendor/symfony/translation/Formatter/MessageFormatter.php:46 at Symfony\Component\Translation\MessageSelector -> choose ( 'один: %count% элемент| несколько: %count% элементов', '87', 'ru' ) /vendor/symfony/translation/Translator.php:226 at Symfony\Component\Translation\Formatter\MessageFormatter -> choiceFormat ( 'один: %count% элемент| несколько: %count% элементов', '87', 'ru', array('%count%' => '87') ) /vendor/symfony/translation/LoggingTranslator.php:58 at Symfony\Component\Translation\Translator -> transChoice ( 'mautic.core.pagination.items', '87', array('%count%' => '87'), 'messages', 'ru' ) /vendor/symfony/translation/DataCollectorTranslator.php:61 at Symfony\Component\Translation\LoggingTranslator -> transChoice ( 'mautic.core.pagination.items', '87', array('%count%' => '87'), 'messages', null ) /vendor/symfony/framework-bundle/Templating/Helper/TranslatorHelper.php:42 at Symfony\Component\Translation\DataCollectorTranslator -> transChoice ( 'mautic.core.pagination.items', '87', array('%count%' => '87'), 'messages', null ) /app/bundles/CoreBundle/Views/Helper/pagination.html.php:194 at Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper -> transChoice ( 'mautic.core.pagination.items', '87', array('%count%' => '87') ) /app/bundles/CoreBundle/Templating/Engine/PhpEngine.php:156 at require ( '/var/app/current/code/pulls/staging/app/bundles/CoreBundle/Views/Helper/pagination.html.php' ) /vendor/symfony/templating/PhpEngine.php:78 at Mautic\CoreBundle\Templating\Engine\PhpEngine -> evaluate ( null, array('app' => object(GlobalVariables), 'totalItems' => '87', 'page' => '0', 'limit' => '30', 'baseUrl' => '/staging/s/contacts/fields', 'sessionVar' => 'leadfield', 'mauticContent' => 'leadfield', 'mauticTemplate' => 'MauticCoreBundle:Helper:pagination.html.php', 'view' => object(PhpEngine)) ) /app/bundles/CoreBundle/Templating/Engine/PhpEngine.php:128 at Symfony\Component\Templating\PhpEngine -> render ( 'MauticCoreBundle:Helper:pagination.html.php', array('app' => object(GlobalVariables), 'totalItems' => '87', 'page' => '0', 'limit' => '30', 'baseUrl' => '/staging/s/contacts/fields', 'sessionVar' => 'leadfield', 'mauticContent' => 'leadfield', 'mauticTemplate' => 'MauticCoreBundle:Helper:pagination.html.php') ) /app/bundles/LeadBundle/Views/Field/list.html.php:130 at Mautic\CoreBundle\Templating\Engine\PhpEngine -> render ( 'MauticCoreBundle:Helper:pagination.html.php', array('totalItems' => '87', 'page' => '0', 'limit' => '30', 'baseUrl' => '/staging/s/contacts/fields', 'sessionVar' => 'leadfield', 'mauticContent' => 'leadfield', 'mauticTemplate' => 'MauticCoreBundle:Helper:pagination.html.php') ) /app/bundles/CoreBundle/Templating/Engine/PhpEngine.php:156 at require ( '/var/app/current/code/pulls/staging/app/bundles/LeadBundle/Views/Field/list.html.php' ) /vendor/symfony/templating/PhpEngine.php:78 at Mautic\CoreBundle\Templating\Engine\PhpEngine -> evaluate ( null, array('app' => object(GlobalVariables), 'items' => object(Paginator), 'searchValue' => '', 'permissions' => array('lead:fields:view' => true, 'lead:fields:full' => true), 'tmpl' => 'index', 'totalItems' => '87', 'limit' => '30', 'page' => '0', 'currentRoute' => '/staging/s/contacts/fields', 'mauticContent' => 'leadfield', 'mauticTemplate' => 'MauticLeadBundle:Field:list.html.php', 'view' => object(PhpEngine)) ) /app/bundles/CoreBundle/Templating/Engine/PhpEngine.php:128 at Symfony\Component\Templating\PhpEngine -> render ( 'MauticLeadBundle:Field:list.html.php', array('app' => object(GlobalVariables), 'items' => object(Paginator), 'searchValue' => '', 'permissions' => array('lead:fields:view' => true, 'lead:fields:full' => true), 'tmpl' => 'index', 'totalItems' => '87', 'limit' => '30', 'page' => '0', 'currentRoute' => '/staging/s/contacts/fields', 'mauticContent' => 'leadfield', 'mauticTemplate' => 'MauticLeadBundle:Field:list.html.php') ) /vendor/symfony/templating/DelegatingEngine.php:41 at Mautic\CoreBundle\Templating\Engine\PhpEngine -> render ( 'MauticLeadBundle:Field:list.html.php', array('items' => object(Paginator), 'searchValue' => '', 'permissions' => array('lead:fields:view' => true, 'lead:fields:full' => true), 'tmpl' => 'index', 'totalItems' => '87', 'limit' => '30', 'page' => '0', 'currentRoute' => '/staging/s/contacts/fields', 'mauticContent' => 'leadfield', 'mauticTemplate' => 'MauticLeadBundle:Field:list.html.php') ) /vendor/symfony/framework-bundle/Controller/ControllerTrait.php:262 at Symfony\Component\Templating\DelegatingEngine -> render ( 'MauticLeadBundle:Field:list.html.php', array('items' => object(Paginator), 'searchValue' => '', 'permissions' => array('lead:fields:view' => true, 'lead:fields:full' => true), 'tmpl' => 'index', 'totalItems' => '87', 'limit' => '30', 'page' => '0', 'currentRoute' => '/staging/s/contacts/fields', 'mauticContent' => 'leadfield') ) /app/bundles/CoreBundle/Controller/CommonController.php:381 at Symfony\Bundle\FrameworkBundle\Controller\Controller -> renderView ( 'MauticLeadBundle:Field:list.html.php', array('items' => object(Paginator), 'searchValue' => '', 'permissions' => array('lead:fields:view' => true, 'lead:fields:full' => true), 'tmpl' => 'index', 'totalItems' => '87', 'limit' => '30', 'page' => '0', 'currentRoute' => '/staging/s/contacts/fields', 'mauticContent' => 'leadfield') ) /app/bundles/CoreBundle/Controller/CommonController.php:214 at Mautic\CoreBundle\Controller\CommonController -> ajaxAction ( array('viewParameters' => array('items' => object(Paginator), 'searchValue' => '', 'permissions' => array('lead:fields:view' => true, 'lead:fields:full' => true), 'tmpl' => 'index', 'totalItems' => '87', 'limit' => '30', 'page' => '0', 'currentRoute' => '/staging/s/contacts/fields', 'mauticContent' => 'leadfield'), 'contentTemplate' => 'MauticLeadBundle:Field:list.html.php', 'passthroughVars' => array('activeLink' => '#mautic_contactfield_index', 'route' => '/staging/s/contacts/fields', 'mauticContent' => 'leadfield')) ) /app/bundles/LeadBundle/Controller/FieldController.php:109 at Mautic\CoreBundle\Controller\CommonController -> delegateView ( array('viewParameters' => array('items' => object(Paginator), 'searchValue' => '', 'permissions' => array('lead:fields:view' => true, 'lead:fields:full' => true), 'tmpl' => 'index', 'totalItems' => '87', 'limit' => '30', 'page' => '0', 'currentRoute' => '/staging/s/contacts/fields', 'mauticContent' => 'leadfield'), 'contentTemplate' => 'MauticLeadBundle:Field:list.html.php', 'passthroughVars' => array('activeLink' => '#mautic_contactfield_index', 'route' => '/staging/s/contacts/fields', 'mauticContent' => 'leadfield')) ) /vendor/symfony/http-kernel/HttpKernel.php:151 at Mautic\LeadBundle\Controller\FieldController -> indexAction ( '0' ) /vendor/symfony/http-kernel/HttpKernel.php:68 at Symfony\Component\HttpKernel\HttpKernel -> handleRaw ( object(Request), '1' ) /vendor/symfony/http-kernel/Kernel.php:200 at Symfony\Component\HttpKernel\HttpKernel -> handle ( object(Request), '1', true ) /app/AppKernel.php:104 at Symfony\Component\HttpKernel\Kernel -> handle ( object(Request), '1', true ) /app/middlewares/CORSMiddleware.php:91 at AppKernel -> handle ( object(Request), '1', true ) /app/middlewares/CatchExceptionMiddleware.php:43 at Mautic\Middleware\CORSMiddleware -> handle ( object(Request), '1', true ) /app/middlewares/Dev/IpRestrictMiddleware.php:64 at Mautic\Middleware\CatchExceptionMiddleware -> handle ( object(Request), '1', true ) /app/middlewares/VersionCheckMiddleware.php:67 at Mautic\Middleware\Dev\IpRestrictMiddleware -> handle ( object(Request), '1', true ) /app/middlewares/TrustMiddleware.php:51 at Mautic\Middleware\VersionCheckMiddleware -> handle ( object(Request), '1', true ) /vendor/stack/builder/src/Stack/StackedHttpKernel.php:23 at Mautic\Middleware\TrustMiddleware -> handle ( object(Request), '1', true ) /vendor/stack/run/src/Stack/run.php:13 at Stack\StackedHttpKernel -> handle ( object(Request) ) /index_dev.php:25 at Stack\run ( object(StackedHttpKernel) ) /index.php:6 at require_once ( '/var/app/current/code/pulls/staging/index_dev.php' )` |
In my own instance - fresh installed 3.0.1 and upgraded to 3.1.0 without any errors. in my /var/logs/mautic_prod-2020-09-14.php: click here to open details``` [2020-09-14 16:38:20] mautic.ERROR: Symfony\Component\Translation\Exception\InvalidArgumentException: Unable to choose a translation for "один: %count% элемент| несколько: %count% элементов" with locale "ru" for value "45". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %count% apples"). - in file /var/www/html/vendor/symfony/translation/MessageSelector.php - at line 89 [] [] [2020-09-14 16:42:59] mautic.ERROR: Symfony\Component\Translation\Exception\InvalidArgumentException: Unable to choose a translation for "один: %count% элемент| несколько: %count% элементов" with locale "ru" for value "46". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %count% apples"). - in file /var/www/html/vendor/symfony/translation/MessageSelector.php - at line 89 [] [] [2020-09-14 16:45:41] mautic.ERROR: Symfony\Component\Translation\Exception\InvalidArgumentException: Unable to choose a translation for "один: %count% элемент| несколько: %count% элементов" with locale "ru" for value "47". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %count% apples"). - in file /var/www/html/vendor/symfony/translation/MessageSelector.php - at line 89 [] [] [2020-09-14 16:47:08] mautic.ERROR: Symfony\Component\Translation\Exception\InvalidArgumentException: Unable to choose a translation for "один: %count% элемент| несколько: %count% элементов" with locale "ru" for value "47". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %count% apples"). - in file /var/www/html/vendor/symfony/translation/MessageSelector.php - at line 89 [] [] [2020-09-14 16:50:02] mautic.ERROR: Symfony\Component\Translation\Exception\InvalidArgumentException: Unable to choose a translation for "один: %count% элемент| несколько: %count% элементов" with locale "ru" for value "47". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %count% apples"). - in file /var/www/html/vendor/symfony/translation/MessageSelector.php - at line 89 [] [] [2020-09-14 16:50:30] mautic.ERROR: Symfony\Component\Translation\Exception\InvalidArgumentException: Unable to choose a translation for "один: %count% элемент| несколько: %count% элементов" with locale "ru" for value "47". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %count% apples"). - in file /var/www/html/vendor/symfony/translation/MessageSelector.php - at line 89 [] [] [2020-09-14 16:50:47] mautic.ERROR: Symfony\Component\Translation\Exception\InvalidArgumentException: Unable to choose a translation for "один: %count% элемент| несколько: %count% элементов" with locale "ru" for value "47". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %count% apples"). - in file /var/www/html/vendor/symfony/translation/MessageSelector.php - at line 89 [] []
|
@npracht please can you open it again? |
@npracht also in v 3.1.1 |
@npracht please reopen this issue - russian (ru) lang have this bug in 3.1.x versions. |
i fix it in translifex |
so now this fixed and translations can be upload to "../translations/ru/" dir? I was try delete this dir, apply settings in Admin, Default System Language to Russian but mautic won't download it again. Was try set lang to Ukrainian - uk_UA translations was downloaded just fine. |
to @zaharovrd Fixes made in Translifex do not remove the error Are you sure you checked? Вы точно проверили? |
Bug Description
On the page https://domain.com/s/contacts or https://domain.com/s/emails and others with a pager I see an error instead of pager:
The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.
System administrators, check server logs for errors.
I have moderator rights in https://www.transifex.com/mautic/mautic Deleting erroneous translation lines in Russian does not help, because the lines still remain in the translation files. When I delete folders with language files it is downloaded again with lines that cause an error
Steps to reproduce
Log errors
[2020-04-23 01:17:10] mautic.ERROR: InvalidArgumentException: Unable to choose a translation for "один: %count% элемент| несколько: %count% элементов" with locale "ru" for value "650". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %count% apples"). - in file /vendor/symfony/translation/MessageSelector.php - at line 81 [] []
The text was updated successfully, but these errors were encountered: