Bug #46092

The f:translate ViewHelper does nothing if a integer is provided as argument

Added by Benno Weinzierl over 8 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
ViewHelpers
Start date:
2013-03-07
Due date:
% Done:

0%

Estimated time:
Has patch:
No

Description

Here is an Example...

in Translation:

<trans-unit id="mylabel">
    <source>A test list with {0} results</source>
</trans-unit>

In Template:

{f:translate(id: 'mylabel', arguments: {0: "{dynamic.integer}"} )}

This returns "mylabel" in the template because an integer is provided as argument.
This works:

{f:translate(id: 'mylabel', arguments: {0: "{dynamic.integer} "} )}

(Notice the blank an the end of the dynamic argument... the argument is a string and the translation works as expected)


Related issues

Is duplicate of TYPO3.Flow - Bug #45062: TranslateViewHelper fails if an array with a single number is passed as argumentsResolved2013-02-01

Actions
#1

Updated by Alexander Berl over 8 years ago

I think the problem lies within TYPO3\Flow\I18n\Translator->getPluralForm($quantity, array $arguments, Locale $locale), which assumes a single numeric argument denotes the count number for the quantity.
However, this is a very brave assumption and in this case, causes the translation process to fail.

#2

Updated by Karsten Dambekalns about 8 years ago

  • Target version changed from 2.0 to 2.0.1
#3

Updated by Alexander Berl over 7 years ago

  • Status changed from New to Resolved

Applied in changeset commit:98748f8b10bf6746daa2594dc069ff0b473982de.

Also available in: Atom PDF