Theme and plugin strings
The words around your content come from the theme and from plugins: "Read more", "Search", "Leave a comment", the labels of a form. In easyi18n each of them is a key. The plugin finds them as the site renders, sends them to the project and, once you publish their translations, writes the files WordPress loads as native translations.
Switch on a text domain
Themes and plugins label their strings with a text domain, usually the slug of the theme or plugin. The plugin handles only the themes and plugins you choose, so with none chosen it collects no theme or plugin text.
Choose them under Keys in What to translate, in the setup assistant or in easyi18n → Settings:
- Theme lists the active theme and its parent theme, each with an example of its own text when the plugin finds one. On a new install the assistant's step comes with them ticked.
- Plugins lists each active plugin that declares a text domain. Choose a plugin only if visitors see its text on the site.

For a domain that belongs to no listed theme or plugin, such as one used by a code snippet, type it in Other text domains under easyi18n → Settings → Advanced. A saved domain then appears in What to translate.
Two domains are refused: default, which belongs to WordPress itself, and
easyi18n, the plugin's own. WordPress translates its own strings through
language packs.
Choose only what the site renders. Every domain adds its strings to the collected text described below, the ones wp-admin screens show as well as the public ones, and one file for each language. Saving sends nothing: what you add is sent once you confirm it in Sync.
From the page to the project
When a page renders a string of a managed domain, the plugin records it in a table of the site's database, which the admin screens call Collected text. Recording does not slow the page down with network calls: the strings of one request are written once, as the request ends.
After the first send is confirmed in Sync, a pass every 15 minutes sends the strings the project has not confirmed yet, in batches of up to 200, while Send changes automatically is on. A project accepts 5,000 new captured keys a day; past that, the rest waits for a later pass.
The collected text holds 10,000 strings that visitors were seen to read and 10,000 that they were not. When one of the two is full, new strings of that kind stop being recorded. Diagnostics shows the count.
Sending a string does not translate it and spends no credits. Strings arrive in the project as captured keys.
Which strings are sent
A theme's text domain also covers text no visitor reads, such as its options screens in wp-admin. Each string that is sent becomes a key that counts against the project, so the plugin records everything and sends a part of it. The site always sends the text visitors see on public pages. Three boxes under Keys to send, in easyi18n → Settings → Advanced, add more:
| Box | Adds |
|---|---|
| Text processed but not shown | Text prepared during a public visit without appearing on the page, such as a form confirmation. Some of it you may not find on the site |
| Pages for signed-in users | Account and member pages, and REST responses to those users. Text these visits process without showing is included too, even when public pages also process it |
| WordPress admin screens | The admin screens of the themes and plugins you chose. Leave it off to translate only the site |
Setup ticks the first box and leaves the other two clear. With the three boxes clear, the plugin sends the strings the site's public pages print.
To know what a page prints, the plugin requests pages of its own site: the home page, the newest item of each public post type, the most used term of each public taxonomy, a search with results and one without, and an address that does not exist. That is one page for each template. A page is read again after a day. Until a page has been read, text that public visits process without showing it is sent too, as if the first box were ticked.
AJAX and REST
Text in AJAX responses, and in REST responses to visitors who are not signed in, is included regardless of these choices, whether the request comes from the website or the administration area. REST responses to signed-in users are included with Pages for signed-in users or WordPress admin screens.
Published translations are used when the response's language can be
determined. An AJAX request answers in the language of the page that sent it.
A REST read (GET or HEAD) from a visitor who is not signed in answers in
the language of its address, such as /es/wp-json/. Other REST requests
answer in the site's language: a write, such as a form sent with POST, and
any request from a signed-in user.
Cron and WP-CLI
Text that only cron or WP-CLI processes is not one of the choices. A site that sent everything before these choices existed keeps sending that text while the three boxes stay ticked. Saving with one of them clear asks for a confirmation first, and no choice sends that text again.
Sites updated from an earlier version
A site that chose what to send before these choices existed keeps sending what it sent until someone saves Advanced. Until then the boxes show that earlier selection under a notice, and saving them applies the choices with AJAX and REST text included.
What changing a choice does
New strings sent count toward the project's limit; strings already sent remain in the project. A change sends or holds back strings already recorded, and nothing is visited again. A string that is not sent gets no translation, in wp-admin either, unless the project already has it.
Translate and publish
In the dashboard, the captured strings are keys of the project like any other. Translate them with AI or by hand, review them, and publish a version. The site keeps showing the source text until a version that includes the translation is published.
From the project to the site
Every 15 minutes a pass asks the project whether a newer version was
published. If nothing changed, the answer is short and the pass ends. If a
language changed, the plugin downloads it and writes one file for each text
domain and WordPress locale, named {domain}-{locale}.l10n.php, in
wp-content/languages/plugins/. WordPress loads those files the way it loads
any translation, with no work for each string on each request.
easyi18n names a language es, and WordPress names a locale es_ES or
es_MX. The plugin writes a file for each WordPress locale of that language
that the site has installed.
The plugin can only translate a string it has recorded on this site. A key that exists in the project and that the site has not rendered yet is left out until a page shows it.
If the directory is not writable, the pass writes nothing, the site keeps showing the source language and the next pass tries again. Diagnostics reports it on the Downloading row of Keys.
Three filters adjust this for a developer:
| Filter | Changes |
|---|---|
easyi18n_managed_domains | The list of managed domains. Code can add one or drop one the screen switched on; the screen says which |
easyi18n_lang_dir | The directory the files are written to. WordPress has to be told to load that directory |
easyi18n_wp_locales | The WordPress locales a language is written for |
On a multisite network every site shares wp-content/languages. Two sites
that use different projects for the same text domain and locale overwrite each
other's file unless each points easyi18n_lang_dir at its own directory.
Text that is not in the code
Some text is typed by an editor and stored in the database, so no text domain
covers it. The plugin collects it under a domain of its own,
easyi18n-site, with no box to tick:
- menu labels;
- the site title and tagline;
- names and descriptions of categories, tags and other terms;
- author biographies;
- alt text of images in the media library;
- widget titles, and the body of text and custom HTML widgets;
- text in blocks that render outside the post body, such as a template part of a block theme or a block widget.
These strings are recorded only on pages a visitor loads in the source language, and they are translated only under a language URL. wp-admin always shows what you typed, so editing a menu never saves a translation over it.
A theme or plugin that ships a wpml-config.xml file tells the plugin which
of its options, shortcode attributes and block attributes hold text. The
plugin reads that file and needs no setting for it.
Mark text in a template
Text you write in a header, a footer or a page builder element, outside a block, is invisible to the plugin until you mark it:
[ei]All rights reserved[/ei]
[ei ctx="footer"]Contact us[/ei]
ctx tells two identical texts apart and gives the translator a hint. The
marked text is captured and translated like the strings above.
If another plugin already uses the [ei] shortcode, Site Health says so.
Use the long form, [easyi18n]…[/easyi18n], which works the same.
Switch a domain off
Unticking a theme or plugin that was saved asks first, in Stop translating these?. Once saved, the site stops collecting its text, and the next sync removes the translation files delivered for it. Ticking it again delivers them again.
It does not undo what was collected. Text already recorded for it can still be sent to the project, still counts against it, and keeps its place in the collected text. To free that room, clear its collected text.
Page caches
When a pass writes or removes a translation file, the plugin fires the
easyi18n_translations_updated action with the languages that changed. Hook
your cache plugin's purge to it so cached pages pick up the new text:
add_action( 'easyi18n_translations_updated', function ( array $languages ) {
// Purge the page cache here.
} );
The same action fires when the translation of a post is updated.