Feature #83075

LanguageService should support placeholders

Added by Stefan Neufeind over 4 years ago. Updated 6 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2017-11-24
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
easy
Sprint Focus:

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

Related to TYPO3 Core - Feature #73234: The ability to use plural in xlf filesUnder Review2016-02-11

Actions
#1

Updated by Stefan Neufeind over 4 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.

#2

Updated by Simon Schaufelberger 6 months 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.

#3

Updated by Simon Schaufelberger 6 months ago

  • Complexity set to easy
#4

Updated by Stefan Neufeind 6 months 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?

#5

Updated by Simon Schaufelberger 6 months ago

  • Related to Feature #73234: The ability to use plural in xlf files added

Also available in: Atom PDF