How to translate addresses and other fields using WPML?

Translation guideline for your store locator is available in this article here.

Address field and generic fields and do not require translation in WPML, however if you wish to translate addresses, you can edit ssf-wp-xml.php and search for the following code:

$row['ssf_wp_store']=ssf_to_wmpl_translate($row['ssf_wp_store']);

Add the code below after a new line of code above.

$row['ssf_wp_address']=ssf_to_wmpl_translate($row['ssf_wp_address']);
$row['ssf_wp_city']=ssf_to_wmpl_translate($row['ssf_wp_city']);
$row['ssf_wp_state']=ssf_to_wmpl_translate($row['ssf_wp_state']);
$row['ssf_wp_zip']=ssf_to_wmpl_translate($row['ssf_wp_zip']);

Refresh your store locator page and go to WP Admin >  WPML > String Translations, search for the address keyword and you should be able to translate it.

* To translate telephone number, fax, external url, etc you can paste below code at the same line above.

$row['ssf_wp_phone']=ssf_to_wmpl_translate($row['ssf_wp_phone']);
$row['ssf_wp_fax']=ssf_to_wmpl_translate($row['ssf_wp_fax']);
$row['ssf_wp_ext_url']=ssf_to_wmpl_translate($row['ssf_wp_ext_url']);
1+

Users who have LIKED this post:

  • Sofia Moss