Tutorials

What Is a String in Translation and How It Is Counted

wordpresstranslationstringsgettextlocalization

Learn what translation strings are, how they're counted in WordPress localization, and why understanding string counts matters for your translation budget.

What Is a String in Translation and How It Is Counted

If you've ever worked with WordPress translation or localization, you've probably heard the term "string" thrown around. But what exactly is a translation string, and how does POForge count them when calculating credits?

Let me break it down in plain English.

What Is a Translation String?

In simple terms, a string is a single piece of text that needs to be translated. It's not measured by words, sentences, or characters—it's a discrete unit of translatable content.

Think of it like this: Every time your WordPress theme or plugin has a piece of text that can appear to users, that's a string.

Examples of Strings:

"Welcome to our site"           → 1 string
"Submit"                         → 1 string
"Please enter your email"        → 1 string
"Error: Invalid credentials"     → 1 string

Even if one string is four words and another is just one word, they each count as one string.

How Strings Appear in POT/PO Files

When you open a POT or PO file, each string is represented as a msgid entry. Here's what it looks like:

#: functions.php:42
msgid "Welcome to our site"
msgstr ""

In this example:

  • msgid is the source string (the original English text)
  • msgstr is where the translation goes

Each msgid = 1 string to translate.

Why String Counting Matters

When you use POForge to translate your WordPress project, we charge credits based on the number of strings, not words or characters. Here's why this is fair:

  • A 3-word string costs the same as a 20-word string because each requires one translation call
  • Simple and predictable: You know exactly how many credits you'll need before you start
  • No surprises: Unlike word-based pricing, you don't get shocked by an inflated count

Let's compare:

String Word Count String Count
"Submit" 1 word 1 string
"Please enter your email address" 5 words 1 string
"Error: Could not process request" 5 words 1 string

If we charged by words, you'd pay 11 credits. With string-based pricing, you pay 3 credits—simple and transparent.

Plural Forms Count Separately

Here's a gotcha that catches some people: plural forms count as additional strings.

In WordPress localization, some strings have plural forms to handle different quantities properly. For example:

msgid "%d comment"
msgid_plural "%d comments"
msgstr[0] ""
msgstr[1] ""

This counts as 2 strings because there are two variations that need translation:

  • Singular: "1 comment"
  • Plural: "5 comments"

Why? Because the AI has to translate both forms independently, especially in languages with complex plural rules.

Context Strings: Do They Count Extra?

Some strings in WordPress have context to help translators understand the meaning:

msgctxt "Button label"
msgid "Submit"
msgstr ""

Good news: Context doesn't increase the count. This still counts as 1 string, even though it has extra information.

The context is metadata that helps with translation quality, but it doesn't require extra AI work.

How POForge Counts Your Strings

When you upload a POT file to POForge, we instantly show you the total string count before you commit to translation. This gives you full transparency.

Here's what gets counted:

✅ Each msgid entry = 1 string
✅ Each plural form = 1 additional string
✅ Even blank or empty strings (if present) = 1 string

Here's what doesn't get counted extra:

❌ Comments and metadata
❌ Context information
❌ File headers

Real-World Example

Let's say you have a small WordPress plugin with these strings:

msgid "Settings"
msgstr ""

msgid "Save Changes"
msgstr ""

msgid "Are you sure you want to delete this?"
msgstr ""

msgid "%d item"
msgid_plural "%d items"
msgstr[0] ""
msgstr[1] ""

Total String Count: 5 strings

  • "Settings" → 1
  • "Save Changes" → 1
  • "Are you sure..." → 1
  • "%d item" → 1 (singular)
  • "%d items" → 1 (plural)

If you translate this into Spanish, you'll need 5 credits (assuming you have no existing translation memory).

Translation Memory: The Game Changer

Here's where POForge becomes incredibly cost-effective: Translation memory is free and unlimited.

If you translate "Submit" once, POForge remembers it forever. The next time any of your projects has "Submit", it costs 0 credits.

This means:

  • First-time translation of 1,000 strings: 1,000 credits
  • Re-translating the same project with updates: Maybe 50 credits (only new strings)
  • Third time: Maybe 10 credits (only the newest additions)

Over time, your cost per project drops dramatically because most strings are reused across WordPress themes and plugins.

Common Questions

Q: If I have a 10,000-word document, how many strings is that?

A: It depends on how the text is structured. If it's one long paragraph marked as a single msgid, it's 1 string. If it's broken into 100 separate entries, it's 100 strings. WordPress POT files naturally break content into logical, translatable units.

Q: Do HTML tags inside strings increase the count?

A: No. A string like "Click <strong>here</strong> to continue" is still counted as 1 string.

Q: What if my POT file has 5,000 strings but only 500 are new?

A: POForge checks your translation memory automatically. If 4,500 strings have been translated before, you only pay for the 500 new ones. That's 500 credits instead of 5,000.

Why This Matters for Your Budget

Understanding string counts helps you:

  1. Estimate costs accurately before starting translation
  2. Plan updates knowing only new strings will cost credits
  3. Budget effectively for multilingual WordPress projects
  4. Avoid surprises with transparent, predictable pricing

POForge's string-based pricing is designed to be fair, simple, and developer-friendly. You're not paying for inflated word counts or being charged multiple times for strings you've already translated.

Final Thoughts

A translation string is the basic unit of localization work. Whether it's a single word button label or a multi-sentence error message, it counts as one string—and in POForge, it costs one credit (unless it's already in your translation memory).

Now that you know how strings are counted, you can confidently upload your POT files, knowing exactly what to expect. No hidden fees, no confusing math—just transparent, fair pricing based on actual work done.

Ready to translate your WordPress project? Upload your POT file to POForge and see your exact string count before you spend a single credit.

What Is a String in Translation and How It Is Counted - POForge Blog