Quick Solution for translations not working for Contact Widget

We were trying the translations for the Contact Widget but getting nothing translated. We were going crazy since everything looks just fine and in the right place.

So we did some digging and found what the problem was:

The .mo and .po files generated at WPMU DEV translations area are in the form:

contact-widget-el.mo, contact-widget-de.mo etc..

But.

According to the contact-form.php on line 38, the plugin is trying to load the textdomain contact_widget

$textdomain_handler('contact_widget', false, basename(dirname(__FILE__)) . '/languages/');

Notice the underscore?

As you understand, nothing loads.

So a quick and very easy solution is this:

Just rename the .mo and .po files to contact_widget-el.mo, contact_widget-de.mo etc…

I hope this will help others as well (till it’s fixed).

Regards,

marikamitsos