Bug #46092

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

Added by Benno Weinzierl over 2 years ago. Updated over 1 year ago.

Status:Resolved Start date:2013-03-07
Priority:Should have Due date:
Assigned To:- % Done:

0%

Category:ViewHelpers
Target version:TYPO3 Flow Base Distribution - 2.0.1
Has patch:No Affected Flow version:Git master

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

duplicates TYPO3.Flow - Bug #45062: TranslateViewHelper fails if an array with a single numbe... Resolved 2013-02-01

History

#1 Updated by Alexander Berl over 2 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 almost 2 years ago

  • Target version changed from 2.0 to 2.0.1

#3 Updated by Alexander Berl over 1 year ago

  • Status changed from New to Resolved

Applied in changeset commit:98748f8b10bf6746daa2594dc069ff0b473982de.

Also available in: Atom PDF