Skip to main content
Upcoming discountNext discount: 10% off — today 19:00.starts in--:--:--Get a quote →
Client Login
Home News What Is a Placeholder? Working with Variables in Software Strings

Software and Game Localisation 5 August 2026

What Is a Placeholder? Working with Variables in Software Strings

In software text, the abbreviations that begin with a percent sign are not something to translate but gaps that are filled in at run time. We explain how to preserve these gaps and where they set traps.

In software text you often see odd-looking abbreviations: %s, %d, n. These are not typing mistakes. Known as placeholders, they mark the gaps that the program will fill in as it runs. The translator’s job is to understand them and to preserve them exactly as they are.

Contents

A placeholder is, by definition, a set of characters that follows a percent sign and is replaced by another word, value or string while the application is running. Such expressions turn up not only in desktop software but also in games, in mobile applications and in the scripts behind web applications.

Below we set out the most common types, the escape sequences, the numbered formats and the situations in which these expressions make translation harder. The subject looks technical, but what it produces is the very sentence the user reads.

What is a placeholder and why does it exist?

A program cannot always know in advance the whole sentence it is going to show the user. The number of files deleted, the name of the server being contacted or the amount of disk space left becomes clear only at run time. So the developer writes the sentence with a gap in it and marks that gap with a placeholder.

In Java, for instance, a string defined as “hello %s!” appears on screen as “hello world!” once the variable is given the value “world” on the second line. The same logic works in PHP, C, Python and many other languages, with small differences of syntax. The name changes; the principle does not.

These expressions are carried over untouched during localisation. The reason is not only technical: the value a placeholder will take also affects how the text around it should be translated. As Savourel points out, variables have a direct bearing on the form of the sentence that surrounds them.

Translation tools usually flag these expressions as protected elements. Even so, not every tool recognises every format. In files edited by hand, the most frequent error is a space slipping in between the percent sign and the letter, or the letter changing case.

The most common types of placeholder

Placeholders differ according to the kind of data they expect. The list below summarises the common types compiled by Esselink. Knowing this distinction lets you predict, as you read a string, how the sentence will be completed; a gap that expects a number in particular brings the plural problem with it.

PlaceholderExpected value
%sText string
%dDecimal integer
%ldLong decimal integer
%xNumber in hexadecimal form
%gFloating-point value
%uUnicode character
%pPage number

In an error message that comes from Windows, several of these types can sit on the same line. A security error string, for example, contains both %s and %d, with an escape sequence tacked on at the end. In a line like that you have to preserve three separate elements at once.

The string “%d home(s) found” that you meet in the Apple environment shows another trap. The value here can be any whole number, positive or negative. The plural ending in brackets does the job in English; in Turkish the same trick does not work the same way.

Reading the type information also steers the translation decision. Around a gap that expects a number you can build a pattern that announces a number; around a gap that expects text you have to keep the sentence as neutral as you can. Drawing this distinction while you read the source string heads off a large share of the agreement errors that would otherwise surface later.

Escape sequences: line break and tab

Escape sequences are markers that do not stand for themselves inside a string but correspond to a character that is hard to type directly. They begin with a backslash. They came out of C and C++ and passed from there into languages such as Java and PHP. They often appear on the same line as placeholders.

The most common is \n, the new line. \t is a horizontal tab, \r a carriage return, \b a backspace, and \\ the backslash itself. None of these is visible on screen; what is visible is the way the text is laid out. Delete them and the message is squeezed onto a single line.

The point to watch when translating into Turkish is that sentence length changes. A warning split over two lines in English may not sit naturally at the same break point in Turkish. Moving the break is possible; the sequence itself, though, is never deleted, only shifted.

Another detail is the invisible spaces at the end of a string. A space left after a word in the source may signal that a value will be inserted there at run time. Clearing that space makes the words run into each other on screen. Working in an editor that displays invisible characters prevents errors of this kind.

Numbered placeholders and freedom of word order

In some programming languages placeholders can be numbered. Written as %1$s and %2$s in PHP, these expressions pin down which value goes where. A similar structure is used on the Android side: in a welcome message %1$s may carry the user name and %2$d the number of messages.

This numbering gives the translator room to breathe. Because the numbers identify the values, you can change the order in the target language. A subject that comes first in English can be moved somewhere else in the Turkish sentence; the program still puts the right value in the right gap.

With unnumbered placeholders the order is fixed. Two %s in succession are filled in the order they appear in the file. Changing the word order here can turn the meaning on its head. If you see two unnumbered placeholders in the source, keeping the order is the first rule.

This difference matters particularly for Turkish. English and Turkish sentence structures rarely follow the same order; the verb goes to the end and the complements change places. In a string that does not use numbered placeholders, building a natural Turkish sentence becomes difficult. In such cases it is worth passing a request for numbering back to the development team.

What happens if a placeholder is touched?

The outcome depends on the kind of error. Sometimes a raw fragment of code appears on screen, sometimes the value is never inserted at all, and sometimes the application crashes on that screen. Quality control tools catch most of these errors; the ones they miss go straight to the user.

The cost of an error grows with the stage at which it is found. A missing placeholder spotted during translation is fixed in a few seconds. The same error found in a compiled build means updating the file, rebuilding the package and running the test again. Found after release, it turns into a fix that has to enter the release plan.

A few rules therefore never change for strings that contain placeholders. The list below sets out the most basic checks that can be applied during translation.

  1. The number of placeholders in the source and the number in the target must be exactly the same.
  2. Letters are preserved case-sensitively; %S and %s are not the same thing.
  3. No space is put between the percent sign and the letter.
  4. In numbered placeholders the number is not changed; only the position may change.
  5. Escape sequences are not deleted; if need be, their place in the sentence is changed.

Running these checks automatically before delivery shortens review time appreciably. As you plan the scope, you can take a look at our software localisation services.

The context problem: when do you ask the developer?

Esselink’s by now classic example is the string “%s to %s”. This line holds two variables, and days of the week, numbers or file locations can go into them. The preposition between them has to be translated differently depending on the value that arrives. Looked at on its own, the correct translation cannot be settled.

A similar situation shows up in the line “%1 already exists. nDo you want to replace it?”. The equivalent of the pronoun in the second sentence depends on the value %1 takes. With lines like this the right course is not to guess but to find out from the developer what the variable carries.

The string “This is not a valid %s” puts adjective agreement under strain. In some language pairs the solution is to build the sentence so that no agreement is called for. Rewriting the area around the placeholder is often a faster and safer solution than waiting for the developer.

There is a method to asking questions, too. Asking a developer “what does this string mean” rarely gets you anywhere. What you need to ask instead is which values the variable can take, on which screen the string appears and what is written before the sentence. A concrete question brings a concrete answer.

The Türkiye context

Turkish offers harder ground than English for strings that contain placeholders. Because the language is agglutinative, the value the variable takes determines the form of the suffix that follows it. The vowel harmony of the suffix differs between “%s dosyasını” and “%s belgesini”; without knowing the word that will land in the variable you cannot pick the right suffix.

The practical answer to this problem is to build the sentence so that it does not depend on a suffix. Moving the variable to the end of the sentence, putting a colon in front of it or choosing a pattern that needs no suffix are all common practice. Experienced localisers record this adjustment not as an error but as an adaptation decision.

The second issue is case conversion. The dotted İ and the dotless ı of Turkish produce unexpected results in systems that work to English rules. If the value carried by the variable is converted to upper case in a heading, you need the developer to confirm that the output is generated according to Turkish rules.

The third issue is number and date formats. If the value arriving in the placeholder is a date or a decimal number, the formatting is set by the locale of the operating system. For Türkiye the decimal separator is the comma and dates are written in day-month-year order. You need to see during testing that these settings are tied to the correct locale.

What does this mean for you?

If you are having your product’s interface text translated, the strings that contain placeholders are the most fragile part of the project. An error here does not look like a spelling slip; it turns up as a screen that simply does not work. It is worth treating these strings as a quality step of their own.

  1. Extract a separate list of the strings that contain variables before translation begins.
  2. Have what each variable stands for added to the file as a comment line.
  3. Provide screenshots or access to a working environment where you can.
  4. Make an automated placeholder check a condition of delivery.
  5. Report to the development team the patterns that cause suffix problems in Turkish.

These five steps noticeably reduce the bug reports that come in after the first release. To talk through the scope of your project, get in touch with us.

Frequently asked questions

Are placeholders translated?

No. Expressions such as %s and %d hold the place of the value the program will insert at run time. Changing the letter or putting a space in the middle breaks the string.

What is the difference between %s and %d?

%s is used for any text or number. %d is for decimal integers; that is, whole values such as 1, 5 and -3.

Can I move a placeholder within the sentence?

Yes, if numbered placeholders are used. Because expressions such as %1$s and %2$s bind the order, they can be repositioned to suit the syntax of the target language.

How do I find out what a placeholder stands for?

You look at the comment line in the source file and at the screenshot, if there is one. If it is still unclear, the right course is to ask the developer; guessing usually produces a faulty translation.

Sources

  • Jiménez-Crespo, M. A. (2024). Localization in Translation. Routledge, pp. 154–156.
  • Esselink, B. (2000). A Practical Guide to Localization. John Benjamins, pp. 68, 73–75.
  • Android developer documentation, “String resources” section (online document).
Share

Document ready? See your price in minutes

Get an Instant Quote
See your price in 2 minutes Get an Instant Quote
Chat on WhatsApp