Documentation · Integration Guide
Translation and Poedit Guide
This document explains how the ADP Car Market Hub plugin handles multilingual WordPress sites, what translation files are provided with the plugin, and how to translate or update plugin strings using Poedit or equivalent tools.
When to use this document
Use this document if you are:
- Setting up the plugin on a site whose WordPress language is not English and want to confirm that translations are loaded.
- A dealer or agency adding or correcting translations for a language already included with the plugin.
- A developer contributing a new language file for a locale not yet bundled with the plugin.
- Troubleshooting plugin text that appears in English when the site language is set to another locale.
The audience is a WordPress administrator or a developer comfortable with the WordPress internationalisation workflow and basic command-line usage.
Overview
The plugin uses the standard WordPress localisation mechanism. All user-facing strings in the plugin's PHP code are wrapped in WordPress translation functions (__(), _e(), esc_html__(), and similar) with the text domain adp-car-market-hub. WordPress loads the corresponding translation file from the plugin's languages/ folder when the site language is set in Settings → General → Site Language.
The following language files are bundled with the plugin at the time of this writing:
| Locale code | Language |
|---|---|
de_AT | German (Austria) |
de_CH | German (Switzerland) |
de_DE | German (Germany) |
de_DE_formal | German (Germany, formal address) |
fr_FR | French (France) |
it_IT | Italian (Italy) |
es_ES | Spanish (Spain) |
nl_NL | Dutch (Netherlands) |
Verify the current list by checking the languages/ directory inside the plugin folder (wp-content/plugins/adp-car-market-hub/languages/). Each locale has a .po source file (human-editable) and, where a compiled .mo file is present, that file is what WordPress actually loads at runtime.
If the site is running a locale that is not in the list above, the plugin displays all strings in the fallback language, which is English.
Prerequisites
- WordPress administrator access.
- For editing translations: Poedit (https://poedit.net/) or an equivalent
.po/.mofile editor, or the Loco Translate WordPress plugin (https://wordpress.org/plugins/loco-translate/). - For generating a new POT file: WP-CLI version 2.6 or higher, or the
make-pot.shscript inbin/make-pot.sh. - For compiling
.mofiles from the command line: the GNU gettextmsgfmtutility, or WP-CLI'swp i18n make-mocommand.
How the plugin loads translations
The plugin calls load_plugin_textdomain() on the plugins_loaded action at priority 1. This means the translation file for the current site language is loaded before any other plugin code runs at the default priority, so all admin and frontend strings are available for translation from the moment the plugin initialises.
WordPress resolves the language file in the following order:
wp-content/languages/plugins/adp-car-market-hub-{locale}.mo(translation files installed by WordPress itself or by a translation management tool).wp-content/plugins/adp-car-market-hub/languages/adp-car-market-hub-{locale}.mo(files bundled with the plugin).
Files in wp-content/languages/plugins/ take priority. If you update a bundled translation using a plugin such as Loco Translate, the updated file is typically stored at the first path, which protects your changes from being overwritten when the plugin updates.
Step by step instructions
Using an existing bundled translation
- In WordPress, open Settings → General.
- Set Site Language to the desired locale (for example German (Switzerland) for
de_CH). - Save the settings.
- Navigate to any plugin admin page or visit the frontend vehicle archive. The plugin strings (labels, buttons, error messages) should appear in the selected language.
- If strings still appear in English, see Troubleshooting below.
Editing or correcting an existing translation with Poedit
- Download and install Poedit from https://poedit.net/.
- Locate the
.pofile for the locale you want to edit, inside the plugin'slanguages/directory. For example:wp-content/plugins/adp-car-market-hub/languages/adp-car-market-hub-de_CH.po. - Open the
.pofile in Poedit. - Find the string you want to change in the string list. The Source text column shows the English original and the Translation column shows the current translated value. Click a row to edit the translation in the editing pane below.
- Save the file. Poedit automatically compiles the corresponding
.mofile in the same directory. - Recommended: Copy the updated
.poand.mofiles towp-content/languages/plugins/so plugin updates do not overwrite them: -wp-content/languages/plugins/adp-car-market-hub-de_CH.po-wp-content/languages/plugins/adp-car-market-hub-de_CH.mo - Clear any WordPress caching that may serve stale output, then verify the change on the relevant plugin page.
Editing an existing translation with Loco Translate
- Install and activate the Loco Translate plugin from the WordPress plugin directory.
- In WordPress, navigate to Loco Translate → Plugins.
- Find ADP Car Market Hub in the list and click it.
- Select the language you want to edit.
- Edit strings in the Loco Translate editor and save. Loco Translate compiles the
.mofile automatically and stores your changes inwp-content/languages/plugins/, protecting them from plugin updates.
Creating a translation for a new language
- Open the POT template file:
wp-content/plugins/adp-car-market-hub/languages/adp-car-market-hub.pot. The POT file contains all translatable strings in the plugin without any translations. - In Poedit, choose File → New from POT/PO file, select the
.potfile, and choose the target language. - Translate the strings.
- Save as
adp-car-market-hub-{locale}.poand compile toadp-car-market-hub-{locale}.mo. Use the exact locale code that WordPress uses for that language (for examplefr_CHfor French Switzerland). Verify the code in Settings → General → Site Language. - Place both files in
wp-content/languages/plugins/so they are not overwritten by plugin updates. - Set the site language and verify that the new translation loads correctly.
Updating translation files after a plugin update
When the plugin is updated, new strings may be added. The bundled .po files are updated by the plugin maintainers, but any custom translations stored outside the plugin directory are not automatically refreshed.
To bring your custom translation file up to date:
- Download the updated POT file from the plugin's
languages/directory. - In Poedit, open your custom
.pofile, then choose Translation → Update from POT file and select the new.potfile. Poedit merges the new strings into your file, marking untranslated strings for attention. - Translate the new strings.
- Save and compile.
If you use WP-CLI, update a .po file with msgmerge:
msgmerge --update languages/adp-car-market-hub-de_CH.po languages/adp-car-market-hub.pot
Compile the updated file:
msgfmt -o languages/adp-car-market-hub-de_CH.mo languages/adp-car-market-hub-de_CH.po
Or compile all .po files at once with WP-CLI:
wp i18n make-mo languages/
Configuration reference
There is no dedicated translation settings page in the plugin admin. Translation is handled entirely through the WordPress site language setting and the standard WordPress localisation system.
| What to configure | Where |
|---|---|
| Site language that determines which translation file is loaded | Settings → General → Site Language |
| Edit bundled translations without losing changes on update | Use Loco Translate, which stores edits in wp-content/languages/plugins/ |
| Generate an updated POT file from the plugin PHP source | Run ./bin/make-pot.sh or wp i18n make-pot (see the i18n README) |
Operational notes
- Text domain. Every translatable string in the plugin uses the text domain
adp-car-market-hub. This text domain is declared in the plugin header and must match the filename prefix of translation files (for exampleadp-car-market-hub-de_DE.mo). A mismatch between text domain and filename is the most common reason strings do not translate. - Compiled
.mofiles are required at runtime. WordPress reads compiled.mofiles, not the human-readable.posource files. Always compile a new or updated.pofile to.mobefore expecting to see changes in the browser. - Formal vs. informal German. The
de_DE_formallocale provides a formal address style (Sie) for German. Choose this locale on sites where formal phrasing is expected. - Frontend and admin strings are both covered. The plugin's text domain includes strings for both admin pages (settings, import status, logs) and frontend output (vehicle labels, filter labels, contact form messages, financing calculator). Both sets of strings are in the same
.po/.mofile. - WordPress language packs. If the WordPress language pack system has a community translation for
adp-car-market-hubfor the selected locale, WordPress may offer to download it automatically. Files obtained this way are stored inwp-content/languages/plugins/and are updated alongside WordPress core. Verify that the community translation is complete before relying on it for production. - Caching. If translations are not appearing after a change, clear any WordPress object cache, page cache, or opcode cache. Cached bytecode of old
.mofiles can survive until the cache is flushed. - Documentation files. The documentation in
docs/is written in English only. There are no translated documentation files. Translation of plugin PHP strings (as described in this guide) and translation of documentation are separate concerns.
Troubleshooting
| Symptom | Likely cause | What to check |
|---|---|---|
| Plugin strings appear in English even though the site language is set correctly. | The .mo file for the selected locale is missing or not compiled. | Check that both .po and .mo files exist in wp-content/plugins/adp-car-market-hub/languages/ or wp-content/languages/plugins/. The .mo file must be present. |
Poedit saves the .po file but strings do not change in WordPress. | Poedit compiled the .mo next to the .po, but WordPress is loading a .mo from a different path. | Check both the plugin languages/ directory and wp-content/languages/plugins/. The file in wp-content/languages/plugins/ takes priority. |
| Some strings translate but others remain in English. | Those strings were added in a version after the translation was last updated. | Update the .po file against the current POT file as described above, translate the new strings, and recompile. |
| After a plugin update, translations revert to English. | The plugin update overwrote the .mo file in the plugin's own languages/ directory. | Move your custom translation files to wp-content/languages/plugins/. Files there are not touched by plugin updates. |
The site language setting shows no compiled .mo file exists for a particular locale. | Only a .po source file is bundled, without a compiled .mo. | Compile the .po file with msgfmt or with Poedit, then place the resulting .mo file in the same directory. |
| Loco Translate shows "no reference" warnings on some strings. | The string exists in the translation but is no longer in the plugin source. | These orphaned strings are harmless; they do not affect runtime behaviour. You can delete them in Loco Translate to keep the file clean. |