If your site is only in one language, you create your custom fields in the language used on your site.
But if your site is in more than one language, you will need to use WPML. The instructions below are different depending on the version of WPML you use. The String Translation module is only available in the Multilingual CMS version of the plugin.
Translating Custom Fields using WPML’s String Translation module
- 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 GD > Tools > Load custom fields translation:
- This will scan your DB for custom fields and copy them to a file in your geodirectory plugin folder called db-language.php
- WPML will then be able to scan this file and allow you to translate them.
- 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:
- If you are only using the WPML blog version, 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 that file and your GD core language file to your computer and then open the .po file and rescan the project.
- This will add the translations to the .po file and you can then follow the normal translation process as explained here.
- Below you can learn more about the process for merging the custom field data with the normal language files.
- After you scanned the database for custom fields, download a copy of the GD core plugin from your server to your local computer using FTP:
- Then open /wp-content/plugins/geodirectory/geodirectory-languages/geodirectory-en_US.po using PoEdit:
- From the catalogue menu, choose Update from sources ...:
- That will merge db-language.php:
- Save the file and then follow the instructions for translating your core language file [first time translation] or updating your language file [if already translated earlier].