Feature #83075
closed
LanguageService should support placeholders
Added by Stefan Neufeind almost 7 years ago.
Updated 5 months ago.
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.)
Related issues
1 (1 open — 0 closed)
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.
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.
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?
- Related to Feature #73234: The ability to use plural in xlf files added
- Status changed from New to Closed
hey stefan! closing the issue now - hope that is ok for you!
Also available in: Atom
PDF