{"id":14939,"date":"2015-04-03T17:39:26","date_gmt":"2015-04-03T17:39:26","guid":{"rendered":"https:\/\/docs.wpgeodirectory.com\/?p=14939"},"modified":"2019-01-02T09:06:34","modified_gmt":"2019-01-02T09:06:34","slug":"translating-custom-fields","status":"publish","type":"post","link":"https:\/\/wpgeodirectory.com\/docs\/translating-custom-fields\/","title":{"rendered":"Translating Custom Fields"},"content":{"rendered":"<h3>Introduction<\/h3>\n<p>If your site is only in one language, you create your custom fields in the language used on your site.<\/p>\n<p>But if your site is in more than one language, you will need to use <a href=\"https:\/\/wpgeodirectory.com\/docs\/useful-plugins\/#wpml\">WPML<\/a>. The instructions below are different depending on the version of WPML you use. The <em><strong>String Translation<\/strong><\/em> module is only available in the\u00a0<em><strong>Multilingual CMS<\/strong><\/em> version of the plugin.<\/p>\n<h3>Translating Custom Fields using WPML&#8217;s String Translation module<\/h3>\n<ol>\n<li>Make sure you have selected to use String Translation, use one of the two options:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2015\/04\/pub9.png\" alt=\"\" width=\"756\" height=\"248\" \/><\/li>\n<li>Create your custom field, and enter description, front end title etc. For this example we are creating a text field:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2015\/04\/pub1.png\" alt=\"\" width=\"543\" height=\"329\" \/><\/li>\n<li>Then go to <em><strong>GD &gt; Tools &gt;\u00a0Load custom fields translation<\/strong><\/em>:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2015\/04\/pub2.png\" alt=\"\" width=\"763\" height=\"242\" \/><\/li>\n<li>This will scan your DB for custom fields and copy them to a file in your geodirectory plugin folder called\u00a0<em><strong>db-language.php<\/strong><\/em><\/li>\n<li>WPML will then be able to scan this file and allow you to translate them.<\/li>\n<li>To translate them go to <em><strong>WPML &gt; String Translatio<\/strong><\/em>n, where you will see the new fields added:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2015\/04\/pub3.png\" alt=\"\" width=\"483\" height=\"208\" \/><\/li>\n<li>Now you can translate them and save:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2015\/04\/pub4.png\" alt=\"\" width=\"481\" height=\"329\" \/><\/li>\n<li>This would be the result on the Add Listing page:<br \/>\n<em><strong>French<\/strong><\/em><br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2015\/04\/pub8.png\" alt=\"\" width=\"529\" height=\"75\" \/><br \/>\n<em><strong>English<\/strong><\/em><br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2015\/04\/pub7.png\" alt=\"\" width=\"529\" height=\"79\" \/><br \/>\n<em><strong>Dutch<\/strong><\/em><br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2015\/04\/pub6.png\" alt=\"\" width=\"529\" height=\"83\" \/><\/li>\n<\/ol>\n<h3><a name=\"merge\"><\/a>Translating Custom Fields without WPML&#8217;s\u00a0String Translation module<\/h3>\n<ol>\n<li>If you are only using the\u00a0<a href=\"https:\/\/wpgeodirectory.com\/docs\/useful-plugins\/#wpml\">WPML blog version<\/a>, then first follow steps 2\u00a0and 3\u00a0as explained above.<\/li>\n<li>That will create a file called\u00a0<em><strong>db-language.php<\/strong><\/em>\u00a0that you will find in your <em><strong>geodirectory<\/strong><\/em> folder on the server.<\/li>\n<li>Copy that file and your <a href=\"https:\/\/wpgeodirectory.com\/docs\/translate-core\/\">GD core language file<\/a> to\u00a0your computer and then open the .po file and <em><strong>rescan<\/strong><\/em> the project.<\/li>\n<li>This will add the translations to the .po file and you can then <a href=\"\/docs\/translate-core\/\">follow the normal translation process as explained here<\/a>.<\/li>\n<li>Below you can learn more about the process for merging the custom field data with the normal language files.<\/li>\n<\/ol>\n<h4>Instructions<\/h4>\n<ol>\n<li>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:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2015\/04\/trans10.png\" alt=\"\" width=\"572\" height=\"330\" \/><\/li>\n<li>Then open <em><strong>\/wp-content\/plugins\/geodirectory\/geodirectory-languages\/geodirectory-en_US.po<\/strong><\/em> using PoEdit:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2015\/04\/trans11.png\" alt=\"\" width=\"569\" height=\"158\" \/><\/li>\n<li>From the <em><strong>catalogue<\/strong><\/em> menu, choose <em><strong>Update from sources ..<\/strong><strong>.<\/strong><\/em>:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2015\/04\/trans12.png\" alt=\"\" width=\"301\" height=\"75\" \/><\/li>\n<li>That will merge db-language.php:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2015\/04\/trans13.png\" alt=\"\" width=\"375\" height=\"139\" \/><\/li>\n<li>Save the file and then follow the instructions for <a href=\"https:\/\/wpgeodirectory.com\/docs\/translate-core\/\">translating your core language file [first time translation]<\/a> or <a href=\"https:\/\/wpgeodirectory.com\/docs\/updating-your-language-files\/\">updating your language file [if already translated earlier]<\/a>.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Introduction 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 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/wpgeodirectory.com\/docs\/translating-custom-fields\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Translating Custom Fields&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1670,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[],"amp_validity":null,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts\/14939"}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/users\/1670"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/comments?post=14939"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts\/14939\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/media?parent=14939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/categories?post=14939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/tags?post=14939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}