---
title: "String Translation - PerfLocale"
description: "Translate any text string from any plugin or theme without code changes. File-based or database mode with built-in string scanner."
canonical: "https://perflocale.com/features/string-translation/"
source: "https://perflocale.com/features/string-translation/"
format: "markdown"
---
# String Translation

Translate any text string from any plugin or theme without touching code.

plugins/woocommerce/templates/cart.php

```
// Original plugin code — untouched
echo __( 'Add to basket', 'woocommerce' );
```

Rendered output

-   🇩🇪de\_DEIn den Warenkorb
-   🇫🇷fr\_FRAu panier
-   🇪🇸es\_ESAñadir al carrito
-   🇯🇵ja\_JPカートに追加

## No Code Changes Required

PerfLocale intercepts any translatable text from your plugins and themes automatically. Just find the string and provide your translation — no edits to plugin or theme files.

### Files

Recommended

Compiled `.l10n.php` served natively by WordPress.

wp-content/languages/perflocale/

-   PHPde\_DE-woocommerce.l10n.php
-   PHPfr\_FR-woocommerce.l10n.php
-   PHPes\_ES-default.l10n.php

-   Zero filter overhead
-   Cached by OPcache
-   Best for production

### Database

Lazy Load

Pulled from MySQL on demand via the `gettext` filter.

wp\_perflocale\_strings

| de_DE | "Add to basket" | → | "In den Warenkorb" |
| --- | --- | --- | --- |
| fr_FR | "Sale!" | → | "Soldes !" |
| es_ES | "Free shipping" | → | "Envío gratis" |

-   Edit live in admin
-   No file generation
-   Best for development

## Two Storage Modes

Choose file-based storage for maximum speed on production sites, or database storage for team-managed translations from the admin interface. Pick once, switch any time — zero data loss.

 ![String Translations close-up: two language columns side-by-side — 'English (GB)' and 'Deutsch' — with three rows: 'Add to basket' / 'In den Warenkorb', 'Sale!' / 'Angebot!', 'Free delivery over £50' / 'Versandkostenfrei ab 50 €'. Click to open the wider four-language view with more rows.](https://perflocale.com/assets/shots/03-strings--cells.png)

Every locale for a string in one row — Tab to the next cell, Enter to save. No modal, no separate page. Edit every locale side-by-side — gaps stay highlighted

## Built-in String Scanner

Analyze your active plugins and theme to discover all translatable strings automatically. Get a complete list of every piece of text you can translate.

### Singular

One source string, one translation.

`__( 'Add to basket', 'woocommerce' )`

-   de\_DEIn den Warenkorb

### Plurals

Full CLDR plural rules — Russian uses 3 forms, Arabic 6.

`_n( '%d item', '%d items', $n, 'wc' )`

-   n = 11 товар
-   n = 33 товара
-   n = 77 товаров

### Context

Same English word, different meaning — translated correctly per context.

`_x( 'Post', 'verb', 'app' )`

-   de\_DEVeröffentlichen

`_x( 'Post', 'noun', 'app' )`

-   de\_DEBeitrag

## Full Translation Support

Handle singular strings, full CLDR plural rules for languages like Arabic (6 forms) and Russian (3 forms), and context-aware strings that distinguish identical text used differently. Import plural forms from any PO file or edit every form directly in the Strings screen.

MT to: 🇩🇪 Deutsch 🇫🇷 Français 🇪🇸 Español

 Overwrite

Selected **(3)** Filtered **(47)** All

Translating… 0%

Above threshold? Dispatched as a background job ▼

`bulk_string_translate` running

1,860 of 3,000 translations 62%

Live progress Cancel Retry

## Bulk Machine Translation

Send rows to your MT provider straight from the Strings admin page — pick specific rows with checkboxes, every row matching the active filter (any combination of domain, context, search, status, or language), or the entire strings table. Target languages are chip selectors, so multi-language dispatches are one click each.

Small dispatches run inline; large ones queue automatically as a `bulk_string_translate` background job — live progress, cancel, and retry on the Jobs page. A 5,000 string × target pairs ceiling per dispatch keeps a misclick on a 100,000-row table from quietly draining your provider credits. Placeholders like `%s`, `%1$d` and inline HTML are masked before the provider call and restored after; any translation that loses a placeholder is rejected rather than shipped to every visitor with broken formatting. [How background jobs work →](https://perflocale.com/docs/background-jobs/)

[← Back to Features](https://perflocale.com/features/)
