{"id":902,"date":"2025-03-24T14:27:59","date_gmt":"2025-03-24T14:27:59","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-to-translate-or-localize-geodirectory\/"},"modified":"2025-04-03T15:24:19","modified_gmt":"2025-04-03T14:24:19","slug":"how-to-translate-or-localize-geodirectory","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/how-to-translate-or-localize-geodirectory\/","title":{"rendered":"How To Translate Or Localize GeoDirectory"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">GeoDirectory, by default, comes in English. (en_US)<\/h2>\n\n\n\n<div class=\"wp-block-blockstrap-blockstrap-widget-alert d-flex align-items-center fade show alert alert-info mb-3\" role=\"alert\"><span class=\"fas fa-info-circle me-2\"><\/span><span class=\"flex-grow-1\">Our users fully translated GeoDirectory into <a href=\"https:\/\/translate.wordpress.org\/projects\/wp-plugins\/geodirectory\/\" target=\"_blank\" rel=\"noreferrer noopener\">several languages<\/a>. If yours is incomplete or you want to edit a language, you can by following the steps in this document.<\/span><\/div>\n\n\n\n<p>There are 2 options, creating a translation file or using an existing translation file.<\/p>\n\n\n\n<div class=\"wp-block-blockstrap-blockstrap-widget-container mb-3 bg-image-fixed list-group list-group-flush list-group-numbered\">\n<div class=\"wp-block-blockstrap-blockstrap-widget-container mb-0 border-0 bg-image-fixed list-group-item\">\n<p><strong> Create a translation file.<\/strong><\/p>\n\n\n\n<p>Download and install <a href=\"http:\/\/www.poedit.net\/\" target=\"_blank\" rel=\"noopener\">POEdit<\/a>. Launch it to open this file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">geodirectory\/languages\/geodirectory-en_US.po<\/pre>\n\n\n\n<p><strong>Add your translations<\/strong> and once you finish, <strong>click <\/strong><strong>File &gt; Compile to MO&#8230;<\/strong><\/p>\n\n\n\n<p><strong>Change the file name<\/strong> to reflect your <strong>Locale<\/strong> (the Locale is a unique code for each language). For example, if your <strong>translation is to&nbsp;<\/strong><strong>Italian<\/strong>, the locale is&nbsp;<strong>it_IT.<\/strong>&nbsp;<\/p>\n\n\n\n<p>The file name should be:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">geodirectory-it_IT.mo<\/pre>\n\n\n\n<p>Here you can find the full list of <a href=\"https:\/\/translate.wordpress.org\/\">Locale<\/a> codes.<\/p>\n\n\n\n<p id=\"1\">Inside the wp-content folder, create the folder \/languages\/<\/p>\n\n\n\n<p>Inside the&nbsp;languages&nbsp;folder, create the folder \/plugins\/<\/p>\n\n\n\n<p><strong style=\"background-color: initial;\">Transfer the .mo file<\/strong> via FTP into the newly created folder:<\/p>\n\n\n\n<p>The complete path should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp-content\/languages\/plugins\/geodirectory-it_IT.mo<\/pre>\n<\/div>\n\n\n\n<div class=\"wp-block-blockstrap-blockstrap-widget-container mb-0 border-0 bg-image-fixed list-group-item\">\n<p><strong>Using an existing translation file<\/strong><\/p>\n\n\n\n<p><strong>Download<\/strong> the desired language file from the <a href=\"https:\/\/translate.wordpress.org\/projects\/wp-plugins\/geodirectory\/\" target=\"_blank\" rel=\"noopener\">GeoDirectory GlotPress page<\/a>.<\/p>\n\n\n\n<p>You can download the file as .po file and modify it following point 1 of this doc or download it directly as .mo file, skip editing with POEdit \/ compiling the mo file, and follow the steps from point 1.<\/p>\n\n\n\n<div class=\"wp-block-blockstrap-blockstrap-widget-alert d-flex align-items-center fade show alert alert-warning mb-3\" role=\"alert\"><span class=\"fas fa-exclamation-triangle me-2\"><\/span><span class=\"flex-grow-1\">If you save the translation file in the wp-content\/plugins\/geodirectory\/languages\/ folder, you will lose your translation with each plugin update.<\/span><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-blockstrap-blockstrap-widget-container mb-0 border-0 bg-image-fixed list-group-item\">\n<p><strong><strong>Change WordPress language<\/strong><\/strong><\/p>\n\n\n\n<p>From your WordPress dashboard, go to Settings > General > Site Language. Change it to your language. WordPress and GeoDirectory will start using the translation files for your language.\u00a0<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-bvICK8x5RI-1024x176.jpg\" alt=\"\"\/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Translating Add-ons<\/h2>\n\n\n\n<p><strong>to translate the add-ons<\/strong> the procedure is <strong>identical<\/strong>. Only the location of the translation files changes:<\/p>\n\n\n\n<p>They can be downloaded from our website and not from wordpress.org.&nbsp;<\/p>\n\n\n\n<p>The URL is <a href=\"https:\/\/wpgeodirectory.com\/translate\/projects\">https:\/\/wpgeodirectory.com\/translate\/projects<\/a>.<\/p>\n\n\n\n<p>Once you are ready to <strong>load your translation file<\/strong>, the&nbsp;path for example for the Location Manager should look <strong>like this<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/wp-content\/languages\/plugins\/geodirlocation-en_US.mo<\/pre>\n\n\n\n<p>Let&#8217;s take another example. For the Advanced search add-on the path should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/wp-content\/languages\/plugins\/geodiradvancesearch-en_US.mo<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Translating themes<\/h2>\n\n\n\n<p><strong>The translation file for themes<\/strong> is found in the\u00a0<strong>languages folder<\/strong> of the theme.<\/p>\n\n\n\n<p>When you are ready with the translation file, <strong>create the folder \/themes\/<\/strong> inside the&nbsp;&nbsp;wp-content\/languages&nbsp;folder<\/p>\n\n\n\n<p><strong>Transfer the .mo file via FTP<\/strong> into the newly created folder:<\/p>\n\n\n\n<p>For example, the complete path for the Directory Starter theme should look <strong>like this<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/wp-content\/languages\/themes\/directory-starter-en_US.mo<\/pre>\n\n\n\n<p>For the Supreme Directory child theme,&nbsp;the complete path&nbsp;should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/wp-content\/languages\/themes\/supreme-directory-en_US.mo<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Updating Translations<\/h2>\n\n\n\n<p>sometimes, a new release comes out with new features, and in some cases, these new features require new text strings.<\/p>\n\n\n\n<p>When this happens, you&#8217;ll need to merge your translated PO file with the new language file provided with the update.<\/p>\n\n\n\n<p>To do so, you need to have both files on your desktop. For example:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">geodirectory-it_IT.po (your translated PO file)<br>&amp;<br>geodirectory-en_US.po (the new translation file shipped with the plugin update)<\/pre>\n\n\n\n<p><strong>Open the first file<\/strong>&nbsp;(geodirectory-it_IT.po) with <b style=\"background-color: initial;\">POEdit<\/b>&nbsp;<\/p>\n\n\n\n<p>From the PoEdit menu, click <strong>Catalogue<\/strong> and then <strong>Update from POT file\u2026<\/strong><\/p>\n\n\n\n<p>This will not find the PO file, so use the file type option to look for PO files.<br>Browse to the new PO file (geodirectory-en_US.po) and press the open button.<\/p>\n\n\n\n<p>That will merge the new language strings with your translated file. Make any changes as required, save and upload the new&nbsp;MO file with updated translation in the wp-content\/languages\/plugins folder.&nbsp;&nbsp; &nbsp;<\/p>\n\n\n\n<p>POEdit<\/p>\n\n\n\n<p>Use POEdit&#8217;s built in tools like the &#8216;Find&#8217; tool to find the string you want to change.<\/p>\n\n\n\n<p>POEdit looks like this<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-z3enjQIa3g.png 347w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-z3enjQIa3g-300x201.png 300w\" width=\"347\" height=\"233\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-z3enjQIa3g.png\" alt=\"\"><br>hide a variable with CSS<\/p>\n\n\n\n<p>You can hide a variable in the output of the translation with some CSS like this.<br><br>Be sure to pay attention to syntax errors. POEdit will infom you if the string needs to end with a period or is missing a variable. Referring back to the original will usually clarify errors if they sound obscure.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">My new string&lt;span style='display: none;'>%s &lt;\/span>.<\/pre>\n\n\n\n<p><br>The %s is the variable, and the CSS around it hides that variable from the output\/display.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Translating Custom Fields<\/h3>\n\n\n\n<p><a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/translations\/translating-custom-fields\/\" target=\"_blank\" rel=\"noopener\">Translate Custom Fields without WPML<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/translations\/how-to-translate-custom-fields-with-wpml\/\" target=\"_blank\" rel=\"noopener\">Translate Custom Fields with WPML<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>GeoDirectory, by default, comes in English. (en_US) There are 2 options, creating a translation file or using an existing translation file. Translating Add-ons to translate the add-ons the procedure is identical. Only the location of the translation files changes: They can be downloaded from our website and not from wordpress.org.&nbsp; The URL is https:\/\/wpgeodirectory.com\/translate\/projects. Once [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[211,432],"class_list":["post-902","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-tips-tricks-more","gd_placecategory-how-tos"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=902"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/902\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=902"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=902"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}