Project

General

Profile

Actions

Feature #83075

closed

LanguageService should support placeholders

Added by Stefan Neufeind almost 7 years ago. Updated 5 months ago.

Status:
Closed
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 1 (1 open0 closed)

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

Actions
Actions #1

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.

Actions #2

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.

Actions #3

Updated by Simon Schaufelberger almost 3 years ago

  • Complexity set to easy
Actions #4

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?

Actions #5

Updated by Simon Schaufelberger almost 3 years ago

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

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!

Actions

Also available in: Atom PDF