Bug #45062

TranslateViewHelper fails if an array with a single number is passed as arguments

Added by Timo Dödtmann over 8 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
I18n
Target version:
-
Start date:
2013-02-01
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

If the TranslateViewHelper will passed "arguments" and this is now an array of a single number [array(0 => 123)], for example to tell that the password is too short, the Translator (\TYPO3\Flow\I18n\Translator) try's to find the plural form of this number (take a look in \TYPO3\Flow\I18n\Translator->translateById() which is called \TYPO3\Flow\I18n\Translator->getPluralForm()).
Normally this fails and the ViewHelper returns the passed "id" or "value".

The following line returns "Password must have x characters.", even if "myMessageId" is set correctly.

{f:translate(id:'myMessageId', arguments:{0:123}, value:'Password must have x characters.')}

If "myMessageId" use the placeholder {1} and

{f:translate(id:'myMessageId', arguments:{0:1, 1:123}, value:'Password must have x characters.')}

is called, then "myMessageId" wil be returned with "123" for the placeholder.


Related issues

Has duplicate TYPO3.Fluid - Bug #46092: The f:translate ViewHelper does nothing if a integer is provided as argumentResolved2013-03-07

Actions
Has duplicate TYPO3.Flow - Bug #49545: Non-plural translations are not found if arguments are usedClosed2013-07-01

Actions
#1

Updated by Gerrit Code Review over 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20130

#2

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20130

#3

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20130

#4

Updated by Gerrit Code Review over 8 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20130

#5

Updated by Gerrit Code Review over 8 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20130

#6

Updated by Adrian Föder over 8 years ago

  • Project changed from TYPO3.Fluid to TYPO3.Flow
  • Category deleted (ViewHelpers)

moved to TYPO3.Flow as this is more appropriate

#7

Updated by Adrian Föder over 8 years ago

  • Category set to I18n
#8

Updated by Gerrit Code Review over 7 years ago

Patch set 6 for branch master of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at https://review.typo3.org/20130

#9

Updated by Gerrit Code Review over 7 years ago

Patch set 1 for branch 2.1 of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at https://review.typo3.org/27811

#10

Updated by Alexander Berl over 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF