Contents
Multilingual (WPML / Polylang) — Plugixa Recipe
Plugixa Recipe supports multilingual sites using WPML or Polylang — both work out of the box with no extra configuration.
Recipes, categories, cuisines, and custom fields all follow the same pattern:
- Each record has a
language_codecolumn (e.g.,en,fr,es). - Each record has a
translation_groupUUID. - Records sharing a
translation_groupare treated as translations of each other.
How it works
The plugin bundles a thin abstraction (includes/class-multilingual.php) that detects which multilingual plugin is active and reads the current language via:
apply_filters('wpml_current_language', null) // WPML
pll_current_language() // Polylang
All REST endpoints and shortcodes honour the active language — visitors in French see only French recipes by default.
Adding a translation
From the recipe editor
Open any recipe. The sidebar includes a Translations panel listing the current languages. Click + Add translation next to a missing language. A new recipe is created:
- In the target language (
language_codeset). - Linked via the same
translation_groupUUID. - Pre-filled with a duplicate of the source recipe that you can translate.
From the recipes list
Use the language filter at the top to switch contexts. The list shows only recipes in the active language — plus a “missing translation” chip for recipes that don’t have one yet.
Language-aware shortcodes
[plugixarecipe language="fr"]
[plugixarecipe language="all"]
all disables language filtering — useful on a “browse everything” page.
Archive pages in translation
The rewrite rules register the archive base in a language-aware form. With WPML, /fr/recette-categorie/desserts/ works as expected; with Polylang, /fr/recipe-category/desserts/ (depending on your Polylang URL mode).
Custom fields
Custom field definitions can be translated too — create the definition in English, then add a French translation linked by translation_group. The editor / frontend automatically show the label in the active language.
Fallback behavior
If a recipe has no translation in the current language, you can configure fallback:
- Hide — the recipe doesn’t appear.
- Show in source language — the recipe appears with its original text (with a small “Only available in English” hint).
Configure fallback in Settings → General → Multilingual.
JSON-LD schema
Schema output includes the inLanguage property when multilingual is active, matching the page language.
WPML compatibility file
The plugin ships wpml-config.xml which declares:
- Translatable fields on recipes, categories, cuisines, and custom fields.
- String translation keys for plugin-level UI strings.
Paste it into WPML → Theme and plugins localization once if WPML doesn’t pick it up automatically.
Performance
Language filtering adds a single AND language_code = … clause — no JOIN, negligible impact. The language_code column is indexed on every localizable table.