the problem
Contact Form 7 stores form markup in post_content — labels, placeholders, select options,
and mail templates live outside the gettext/.mo pipeline. WPML and Polylang solve it by
duplicating the entire form post per language. Sites using Flavor for content translation
have no bridge to CF7 without falling back to one of those heavy plugins.
the approach
A lightweight addon that hooks Flavor’s public filters to extend translation coverage to CF7:
- Form labels / placeholders / select options — translated via
Flv_Translator::translate_string()and stored in Flavor’s String Translations table - Validation messages — translated by intercepting CF7’s
wpcf7_messagesarray - Mail templates (subject, body, recipient overrides) — translated post-meta lookup against Flavor’s storage
- Request language — Flavor learns the form-submission language via the
_wpcf7_localefield through theflv/detect_request_languagefilter - Form post type — Flavor sees
wpcf7_contact_formposts aspost_title-only (CF7 stores shortcodes inpost_content, never to be translated)
Uses only Flavor’s public API. CF7 strings are auto-registered on save and become translatable from Flavor’s String Translations admin.
stack
- WordPress 6.0+, PHP 8.0+
- Flavor (active) — public filter API
- Contact Form 7 (active)