How to use this for a multilingual blog
Required Plugins
WordPress does not support multiple languages for the same site by default, so you'll need to make use of a plugin to handle the language switching. We recommend using WPML for a multilingual site. You will need these plugins active to follow the instructions:
- WPML Multilingual CMS
- WPML String Translation
Another option is to use the Polylang plugin.
Recipes in different languages
With WP Recipe Maker, recipes are usually part of a regular post, the parent post for that recipe. When using WPML or Polylang, this post can have a specific language associated with it. This doesn't really affect the recipe in any way. The idea is that you write a separate recipe for each language you need, and add those different recipes to those different posts. The clone recipes feature can help speed things up there, but there will be no automatic translation.
When using WPML, it is also possible to have just 1 recipe object and use their "WPML Advanced Translation Editor" to translate it for the different languages you need.
Once you've added a recipe to a parent post you can enable the "Parent Language" column on the WP Recipe Maker > Manage page. This will allow you to see what the language of the parent post for the recipe is and filter by it as well.
One issue you can run into is that the recipe template will be the same for all languages. That's where our WPML and Polylang integration comes into play, and what's covered in the rest of this documentation.
Recipes as a public post type
There is a special case where you've set the recipe post type to be public instead of adding recipes to a regular post. In those cases you'll be able to set a specific langauge for the recipe itself while editing.
To set this up, make sure to set the wprm_recipe post type as translatable on the WPML > Settings > Post Type Translation page:
Take note that this feature is only available for WPML right now.
Creating different templates for all our languages
You want to create a different recipe template for all the languages on your blog using the Template Editor. The main difference between those templates will usually just be the translation of the labels. For this example we've created a template for English and one for Dutch:
On the WP Recipe Maker > Settings > Recipe Template page, set the Default Recipe Template to the one you've created for your main language:
Now all recipes will be using this custom template.
Showing a different template per language
Next step is to make sure a different template gets displayed for a different language.
Important: make sure to save the settings and open a recipe on your actual website first. Otherwise you might not see the string you need to translate.
WPML
Translating can be done on the WPML > String Translation page. You'll need to change the translation for the string named "Setting - default_recipe_template_modern". You can't search by string name, however, so it's easiest to search for the slug of the default recipe template you have set.
When you've found it, click on the blue "translations" link and set a different template slug for the other language(s). Make sure to mark "Translation is complete" and hit that Save button.
Now a different recipe template (with different labels) should get used for different languages.
Polylang
Translating can be done on the Languages > Strings translations page. You'll need to change the translation for the string named "Setting - default_recipe_template_modern" like in this example:
After saving a different recipe template (with different labels) should get used for different languages.
Using WPML Automatic Translation
Our recommendation for using WP Recipe Maker on a multilingual blog is to create a separate recipe for separate languages. If that's not an option for your site, the WPML Automatic Translation should work reasonably well.
Please take the following in consideration:
- Follow the instructions above to pick a specific template for each language
- Enable the classic WordPress UI for your taxonomies and translate taxonomy terms through the WPML > Taxonomy Translation page
Through the WPML > Translation Management page you can select the recipes that need translating and add them to the queue
Then go to WPML > Translations to access that queue and start translating the recipe.
This will allow you to translate the recipe fields, without having to create a completely seperate recipe: