Placeholders store dynamic values in software, like names and dates. Learn how PTC detects common placeholder formats during translation and lets you add custom ones.
PTC detects placeholders in strings and keeps them unchanged during translation.Since different resource file formats have their own placeholder syntax, PTC:
Recognizes common placeholder formats using predefined regex patterns
Applies format-specific rules to correctly identify and handle placeholders
Here are examples of commonly used supported placeholder formats, along with the regular expressions (regex) used to detect them:
Placeholder Example
%service%
%{service}
:service:
${service}
$service$
''service''
[service]
@[service]
{{service}},{{service_name}}
{service},{service_name}
Placeholder Example
%service%
%{service}
:service:
${service}
$service$
''service''
[service]
@[service]
{{service}},{{service_name}}
{service},{service_name}
Placeholder Example
Regular Expression (Regex)
%service%
\%\w+\%
%{service}
\%\{\w+\}
:service:
\:\w+\:
${service}
\$\{\w+\}
$service$
\$\w+\$
''service''
\'\'\w+\'\'
[service]
\[\w+\]
@[service]
\@\[\w+\]
{{service}}, {{service_name}}
\{\{[\w_-]+\}\}
{service}, {service_name}
\{[\w_-]+\}
Adding Custom Placeholders
Your resource files may have non-standard placeholders or ones PTC doesn’t recognize. You can add custom placeholders to make sure PTC detects and preserves them during translation.
On the Settings → String Placeholders page, PTC lists predefined placeholders based on the detected project structure and the types of resource files in your project.
Here, you can:
Edit or remove existing placeholders for the whole project or for a specific resource file type.
Add new placeholder formats if your project or resource files use a unique structure that isn’t recognized by default
After making any changes, save your settings to apply the updates.
Best Practices For Custom Placeholders
When adding custom placeholders, follow these best practices to prevent translation issues:
Keep placeholders simple
Overly complex placeholder formats are harder for systems to recognize and interpret correctly. For example:
Preferred:<name>
Overly complex:<user-name&role-123>
Use unique formats
When two placeholders share parts of their structure, translation tools often can’t distinguish between them. For example, take a look at this complex and simple placeholder that unintentionally overlap:
Complex placeholder: {user_details}
Simple placeholder: {user}
In this example, {user_details} might be mistakenly detected as {user} because {user} is part of the complex placeholder.
Use words between placeholders for context
Surrounding words provide context that helps PTC understand how placeholders fit within a sentence. Don’t rely on human notes to clarify placeholders, as PTC doesn’t process them. Instead, make placeholders clear from the string.
Preferred:"Hello, <name>! Your order number is <order_number>."
Not recommended: "<name> <order_number>"
What Happens if PTC Encounters Issues with Your Placeholders?
PTC flags strings that are unclear for different reasons, such as:
Having too many placeholders with not enough context
Containing ambiguous text
Being single-word strings
If this happens, you’ll see a recommended action in your PTC dashboard prompting you to review unclear strings. To address strings with unclear placeholders, you can:
Update the string directly in your project—for example, by simplifying or reordering the placeholder formats.
Follow prompts from PTC to provide more information about the placeholders’ purpose.
Start typing and press enter to search
Manage your privacy
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.