Skip to content
Snippets Groups Projects
Commit 016afcdd authored by Claus Due's avatar Claus Due Committed by Christian Kuhn
Browse files

[TASK] Improve LocalizationUtility logic and feedback

This patch does two things to improve the translation
flow in LocalizationUtility::translate:

* Early return null on empty $key (would cause null anyway)
* Feedback message on failure to sprintf

In order to provide failure feedback for formatted
strings, vsprintf had to be replaced with sprintf and
array unrolling, since vsprintf does not return false
on errors and sprintf does. The error is returned as
translation result so even if an unexpected failure
occurs, at least a partially meaningful text is shown.

Change-Id: I568be30b701f0c374289ed44fc5b31b13f492483
Resolves: #82453
Releases: master
Reviewed-on: https://review.typo3.org/54118


Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 852ad1d9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment