Feature #83075
closedLanguageService should support placeholders
0%
Description
It's common to have support for placeholders like %1 in translation-strings. Currently LanguageService can just fetch a string, but there is no tool-functionality for placeholders.
(In addition to that also singular/plural-strings might be worth to consider in the same go.)
Updated by Stefan Neufeind almost 7 years ago
That's how it's done in Symfony:
https://symfony.com/doc/current/components/translation/usage.html
They use named placeholders like name. In general you are free in naming placeholders, but that's the recommended way.
They also have a way to choose a translation based upon a number which allows "no apples|one apple|%count% apples" in one translation-string.
Updated by Simon Schaufelberger almost 3 years ago
Use the LocalizationUtility and you are good to go as this one supports placeholderes. The only thing that is still missing is singular and plural.
Updated by Stefan Neufeind almost 3 years ago
Thanks for pointing that out. Going back in history I wonder if my original issue was filed with TYPO3 v7 in mind. It seems LocalizationUtility arrived with v8.
So should we close the old issue with "use LocalizationUtility" and just make this one a smaller, separate enhancement for LocalizationUtility then? Maybe there are other enhancements which might make sense, that you'd want to propose in that same go?
Updated by Simon Schaufelberger almost 3 years ago
- Related to Feature #73234: The ability to use plural in xlf files added
Updated by Georg Ringer 5 months ago
- Status changed from New to Closed
hey stefan! closing the issue now - hope that is ok for you!