How to translate Business Hours Indicator for your multi-lingual site

If you’re running a multilingual site with WPML or Polylang, it is possible to translate the plugin. This article walks you through how to do just that.

What do you have to translate?

We’ve already translated the day and month names for you in more than 20 languages. These are: Dutch, German, English, Greek, Spanish, Italian, French, Bulgarian, Swedish, Danish, Slovakian, Slovenian, Lithuanian, Croatian, Russian, Czech, Norwegian, Finnish, Icelandic, Polish, and Hungarian.

Any other strings should be translated by you. They are mostly messages for when your business is open or closed.

How to translate with WPML?

Go to WPML → String Translation and find all strings for the domain admin_texts_mb-bhipro-settings. You’ll see most strings are straightforward to translate, but there is one exception:

This odd looking string is a collection of all your locations data, including opening hours, special dates, and holidays. The only thing you may want to translate here are names for special dates and holidays (highlighted in yellow in the image above). Translate the names between the quotes.

Other ways to translate

When you’re using any of our shortcodes, you can also overwrite settings by passing in parameters. For example, consider this shortcode:

[mbhi location="test location" openmessage="We are now open"]

See how we’ve included the openmessage into the shortcode. It will overwrite the open message you defined in the plugin’s setting page.

This has the added benefit that you can write different shortcodes for your different languages. For example, this shortcode goes into your English pages:

[mbhi location="test location" openmessage="Your English translation"]

And this one into your Spanish pages:

[mbhi location="test location" openmessage="Your Spanish translation"]

For a full list of shortcode arguments, check this document.

Was this article helpful?

Related Articles