How to Translate Custom Fields with WPML
If your site is in more than one language, you can use the WPML plugin to manage translations and translated content. The instructions below may vary slightly with different versions of WPML. The String Translation module is only available in the Multilingual CMS version of the plugin.
Translating Custom Fields using WPML's String Translation module
The String Translation module is only available in the WPML Multilingual CMS version
- Make sure you have selected to use String Translation, use one of the two options:
- Create your custom field, and enter description, front end title etc. For this example we are creating a text field:
- Then go to GeoDirectory > Status > Tools > DB text translation:
- This will scan the database for custom fields and copy them to a file in your geodirectory plugin folder called db-language.php
- WPML will now be able to scan this file and allow you to translate the custom fields. Go to WPML > Theme and plugins localization > Strings in the plugins > GeoDirectory > Scan selected plugins for strings
- To translate them go to WPML > String Translation, where you will see the new fields added:
- Now you can translate them and save:
- This would be the result on the Add Listing page: FrenchEnglishDutch
Translating Custom Fields without WPML's String Translation module
- If you are only using the WPML Multilingual blog plugin, then first follow steps 2 and 3 as explained above.
- That will create a file called db-language.php that you will find in your geodirectory folder on the server.
- Copy all files in the geodirectory folder to your computer:
- Open the /wp-content/plugins/geodirectory/geodirectory-languages/geodirectory-en_US.po file with poEdit:
- From the catalogue menu, choose Update from sources ...:
- That will re-build the geodirectory-en_US.po file:
- Save the file.
- You now have a new base language file including the new custom fields. You can now use that file to create your other language files, read more at How To Translate Or Localize GeoDirectory