{"id":1321,"date":"2014-10-12T06:40:18","date_gmt":"2014-10-12T06:40:18","guid":{"rendered":"https:\/\/docs.wpgeodirectory.com\/?p=1321"},"modified":"2018-01-13T18:59:10","modified_gmt":"2018-01-13T18:59:10","slug":"translating-themes","status":"publish","type":"post","link":"https:\/\/wpgeodirectory.com\/docs\/translating-themes\/","title":{"rendered":"Translating themes (including GeoDirectory themes)"},"content":{"rendered":"<p><i class=\"fa fa-lightbulb-o fa-2x\" style=\"color: green;\"><\/i> This article is about translating your theme, and making sure that your translations are not lost when there is an update to your theme.<br \/>\nThe example used is the <em><strong>GeoDirectory Framework Theme<\/strong><\/em>, but the instructions apply for all themes.<\/p>\n<p>The first thing you should have done after deciding to use the GDF theme is to <a href=\"http:\/\/codex.wordpress.org\/Child_Themes\" target=\"_blank\">use a child theme<\/a>, this way you won&#8217;t lose your changes when the main theme is updated.<br \/>\nYou can download both the <em><strong><a href=\"https:\/\/wpgeodirectory.com\/downloads\/geodirectory-framework-theme\/\">GeoDirectory Framework Theme<\/a><\/strong><\/em> and its child theme, and the <a href=\"https:\/\/wpgeodirectory.com\/downloads\/gdf-modern-gdf-child-theme\/\"><em><strong>GDF Modern child theme<\/strong><\/em><\/a> from your download area.<\/p>\n<h4><strong>Let\u2019s get started:<\/strong><\/h4>\n<p>1. Download <a href=\"http:\/\/poedit.net\/\" target=\"_blank\">poedit<\/a> or <a href=\"http:\/\/codex.wordpress.org\/Translating_WordPress\" target=\"_blank\">check here for alternatives<\/a><\/p>\n<p>2. Download the main theme&#8217;s\u00a0 language file to your computer using FTP. For the GDF theme that file is at<br \/>\n<em><strong>\/wp-content\/themes\/GeoDirectory_framework\/languages\/en_US.po<\/strong><\/em>.<\/p>\n<p>3. Open poedit and choose<\/p>\n<ol>\n<li><em><strong>Edit a translation<\/strong><\/em> (if you want to keep your site in US English)<\/li>\n<li><em><strong>Create a new translation<\/strong><\/em> (if you are using any other language for your site)<\/li>\n<\/ol>\n<p>4. Select the <em><strong>en_US.po<\/strong><\/em> from your computer.<br \/>\nYou might have to change the type of file displayed from <em><strong>.POT<\/strong><\/em> to <em><strong>.PO<\/strong><\/em>.<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2014\/10\/poedit1.png\" alt=\"\" width=\"671\" height=\"306\" \/><\/p>\n<p><em><strong>Skip step 5 and 6 if you are not translating to another language, but only editing the US English version.<\/strong><\/em><\/p>\n<p>5. If you are translating to another language, then poedit will ask you what language you want to use for your translation.<br \/>\nFor example if you are translating to French you would choose French from the list provided:<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2014\/10\/poedit2.png\" alt=\"\" width=\"336\" height=\"124\" \/><\/p>\n<p>6. Save your translated file in the same format as the original language file:<br \/>\nIn our example that would be <em><strong>fr_FR.po<\/strong><\/em>.<\/p>\n<p>7. Change any of the language strings you want to translate or change.<br \/>\nWhen you then save the <em><strong>.po<\/strong><\/em> file, a <em><strong>.mo<\/strong><\/em> file will automatically be created.<\/p>\n<p>8. Upload the <em><strong>.mo<\/strong><\/em> file (in our case <em><strong>en_US.mo <\/strong><\/em>or <em><strong>fr_FR.mo<\/strong><\/em>) to your child theme languages folder.<br \/>\nIf there is no languages folder in your child theme just create one.<br \/>\nThe result should look like this <em><strong>\/wp-content\/themes\/GDF_child\/languages\/en_US.mo <\/strong><\/em>or\u00a0<strong><strong>\/wp-content\/themes\/GDF_child\/languages\/<strong>fr_FR.mo<\/strong><\/strong><\/strong>.<br \/>\n<img loading=\"lazy\" class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2014\/10\/trans4.png\" alt=\"\" width=\"681\" height=\"265\" \/><\/p>\n<p>9. If you have not set the language of your website yet, you do that by going to your <em><strong>wp-admin<\/strong><\/em> area, and then go to <em><strong>Settings &gt; General &gt; Site language<\/strong><\/em> and select your language there.<br \/>\nIf your language is not available there, then you can <a href=\"http:\/\/wpcentral.io\/internationalization\/\" target=\"_blank\">download your WordPress language file here<\/a>.<\/p>\n<p>10. Go to your homepage and refresh to see your changes <img src=\"https:\/\/wpgeodirectory.com\/docs\/wp-includes\/images\/smilies\/icon_smile.gif\" alt=\":)\" \/>.<\/p>\n<p><strong>Protect your files during theme updates<\/strong><br \/>\nWordPress 4.6 introduced a new option to all you to store your theme translation in the following location:<\/p>\n<p>\/wp-content\/languages\/themes\/my-theme-en_US.mo<\/p>\n<p>When you store your translation in this folder, it will not be overwritten. The file should be named the same as the theme folder name.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is about translating your theme, and making sure that your translations are not lost when there is an update to your theme. The example used is the GeoDirectory Framework Theme, but the instructions apply for all themes. The first thing you should have done after deciding to use the GDF theme is to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/wpgeodirectory.com\/docs\/translating-themes\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Translating themes (including GeoDirectory themes)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1676,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,13],"tags":[],"amp_validity":null,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts\/1321"}],"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\/1676"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/comments?post=1321"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts\/1321\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/media?parent=1321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/categories?post=1321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/tags?post=1321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}