-
Notifications
You must be signed in to change notification settings - Fork 8
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
Missing arguments. (ArgumentCountError 9 arguments are required, 3 given) #47
Comments
Since I was collaborating with @vicluber on the project in question, and have just been able to get rid of the error, I have some updates. The root cause appears to have been a combination of the cookieman extension we're using for cookie consent, translatelabels, and a localized URI for the privacy page with Japanese characters. Cookieman is using messages like 'Find more information regarding cookies on our %1$s and regarding us on the %2$s.' that get passed through The (somewhat hacky) fix we are now using is to avoid the link interpolation done by Cookieman, and instead simply hardcode the links to the privacy page in the message label. In that case, one can just leave non-percent-encoded native Japanese characters in the href attribute, since the browser will ultimately percent-encode those when the user follows the link. I do think this is in a certain sense a bug in translatelabels. But I am not sure whether there is much that you can do to avoid this kind of issue, especially if other extensions are involved as well – at least I could imagine that taking care of it in a generic manner could become quite messy quickly, so if you decide to close this as wontfix or invalid I wouldn't be too shocked. ;-) Or you come to the conclusion it's not really a bug on your side. Anyway, this is the info I can give you on how this seems to be playing out, make of it what you will. If you would like additional info, let us know. |
Ok just had another quick look over the way things work together to produce these errors, and maybe it should more appropriately be seen as a cookieman bug, or even one in the basic translation logic... The cookieman templates rendering that piece of content all look like this:
and the dataProtectionDeclarationLink gets resolved from |
Any thoughts on whether this should be considered a translatelabels or a cookieman bug? Or if there is anything you're planning to do about it? (We have worked around the concrete issue, but it's still a bug at some level.) Just curious because there was no reaction whatsoever in almost a year. |
Hi
Our editor has worked happily with translatelabels 2.2.1 under Typo3 11 for a while now.
I have a site with 7 languages without having almost no issues.
But last week we've added a new language (Japanese) and immediately after translating a page to Japanese, just the page, it doesn't have any content elements yet I've gotten this error on visiting that page:
ArgumentCountError
9 arguments are required, 3 given
in /var/www/html/public/typo3conf/ext/translatelabels/Classes/ViewHelpers/TranslateViewHelper.php line 144
if (ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend()) { $id = TranslationLabelUtility::getExtendLabelKeyWithLanguageFilePath($id, $extensionName); $value = TranslationLabelUtility::readLabelFromDatabase($id, $value); if (\is_array($translateArguments) && $value !== null) { $value = sprintf($value, ...array_values($translateArguments)) ?: sprintf('Error: could not translate key "%s" with value "%s" and %d argument(s)!', $key, $value, count($translateArguments)); } if (TranslationLabelUtility::isFrontendWithLoggedInBEUser($id, $extensionName)) { $value = TranslationLabelUtility::renderTranslationWithExtendedInformation($id, $value, $extensionName, $translateArguments, $arguments['languageKey'], $arguments['alternativeLanguageKeys']); } }
Indeed the $translateArguments variable is null. Is this a known issue? Is this a translatelabels issue even? Or am I just missing something?
The text was updated successfully, but these errors were encountered: