1. Home
  2. Translation
  3. Overview

Overview


Introduction
What you need to know
Core Translation Files
Addon Translation Files
Themes Translation Files
Download Existing Translations for a Plugin
Translation process
Translating with PoEdit
Updating Translations by Merging
Resources
FAQ – Frequently Asked Questions

Introduction

Wordpress and GeoDirectory both are configured with English by default, but can easily be translated into other languages. In this document we will introduce the how translated strings are stored, edited, and loaded to a site to display a new translation.

If you haven’t already, check out the Translator’s Handbook. We need your help to translate GeoDirectory into more languages. Translate GD and addons to receive a free membership! See details in the Translator’s Handbook.

The goal of this guide is not just to help you become familiar with translation. Once the new translations are setup in the GD site, you can edit and update your translation files any time. Once you start translating, and even changing the default text, you will probably find many ways to make the text ‘speak’ to your community of users.

What you need to know

  1. .po and .mo files are the standard method for storing “translated strings”.
  2. .po files are for doing translations.
  3. .mo files are for showing translations on your site.
  4. .po files can be edited with PoEdit, the free cross-platform desktop translation app.
  5. When you edit a .po file in PoEdit, and then save the file, PoEdit will also create/update a matching .mo file.
  6. Store BOTH the .po and the .mo files in the the proper site folder.
  7. GeoDirectory Core Translations are maintained at https://translate.wordpress.org/projects/wp-plugins/geodirectory, so go there if you want to download existing translations of GD Core.
  8. GeoDirectory Addon Translations are maintained at https://wpgeodirectory.com/translate/projects, so go there if you want to download existing translations of GD Addons.
  9. Finished translation files for plugins are stored in wp-content/languages/plugins/
  10. Finished translations for themes are stored in wp-content/languages/themes/

Core Translation Files

GeoDirectory Core plugin translations are maintained at https://translate.wordpress.org/projects/wp-plugins/geodirectory. If you are looking for existing translations of the GeoDirectory Core plugin in additional languages, you can go there to see which languages are available.

If your language is not currently available or at less than “100%” then consider joining the GeoDirectory translation team where members work together to make excellent, accurate translations available in every language. Visit the Translators Handbook to find out more.

GeoDirectory Core Languages Folder Location

Once you have completed your translation of GeoDirectory core plugin into a new language, the .po and .mo files must be transferred to your GD Site, usually by FTP. On your GD Site, the translation files for GeoDirectory core are stored in “wp-content/languages/plugins/”.

Use the following table to “check your work”. The most common reasons that a translation file won’t load is because it is named incorrectly or because it is stored in an improper folder.

Name .po/.mo folder path and file name (text domain)
GeoDirectory Core /wp-content/languages/plugins/geodirectory-en_US.mo

 

Addon Translation Files

GeoDirectory Addon translations are maintained https://wpgeodirectory.com/translate/projects. If you are looking for existing translations of addons you should go there to see if your desired language is available.

If your language is not currently available or at less than “100%” then consider joining the GeoDirectory translation team where members work together to make excellent, accurate translations available in every language. Visit the Translators Handbook to find out more.

GeoDirectory Addons Languages Folder Location

Translated files for GeoDirectory Addons are stored in “wp-content/languages/plugins/”. Use the following table to “check your work”. The most common reasons that a translation file won’t load is because it is incorrectly named or because it is stored in an improper folder.

Addon/Theme name .po/.mo folder path (text domain)
Advance Search Filters /wp-content/languages/plugins/geodiradvancesearch-en_US.mo
Ajax Duplicate Alert /wp-content/languages/plugins/geodir-duplicate-alert-en_US.mo
BuddyPress Integration /wp-content/languages/plugins/geodir_buddypress-en_US.mo
Claim Listing /wp-content/languages/plugins/geodir-claim-en_US.mo
Custom Google Maps /wp-content/languages/plugins/geodir-custom-google-maps-en_US.mo
Custom Post Types /wp-content/languages/plugins/geodir_custom_posts-en_US.mo
Event Manager /wp-content/languages/plugins/geodirevents-en_US.mo
Franchise Manager /wp-content/languages/plugins/geodir-franchise-en_US.mo
List Manager /wp-content/languages/plugins/gd-lists-en_US.mo
Location Manager /wp-content/languages/plugins/geodirlocation-en_US.mo
Markercluster /wp-content/languages/plugins/geodir_markercluster-en_US.mo
Pricing Manager /wp-content/languages/plugins/geodir_pricing-en_US.mo
Review Rating Manager /wp-content/languages/plugins/geodir_reviewratings-en_US.mo
Social Importer /wp-content/languages/plugins/gd-social-importer-en_US.mo
Google Analytics /wp-content/languages/plugins/geodir-ga-en_US.mo

 

Theme Translation Files

Only the default English translation is available for AyeCode’s GeoDirectory themes. You can find the default file inside the languages folder of the theme.

GeoDirectory Themes Language Folder Location

Translated files for GeoDirectory themes are stored in “wp-content/languages/themes/”. Use the following table to “check your work”. The most common reasons that a translation file won’t load is because it is incorrectly named or because it is stored in an improper folder.

Addon/Theme name .po/.mo folder path (text domain)
Directory Starter Theme /wp-content/languages/themes/directory-starter-en_US.mo
Supreme Directory Child Theme /wp-content/languages/themes/supreme-directory-en_US.mo

 

Download Existing Translations for a Plugin

Here we provide an example of how to download an existing translation.

In the example below, we will download an Italian translation of GeoDirectory Core, and then add the translation file to the GD site.

  1. Navigate to the GeoDirectory language project pages.
  2. Select the language and addon of your choice.
  3. Example: Italian:
  4. Select the language file you want:
  5. Scroll to the bottom of the page and Export the file (accept the defaults so you download the whole PO file):
  6. Load the file to the proper folder (See Translating Addons for more information).
    Change the file extension, if necessary, for your locale. Example: -it to -it_IT.
  7. Create the MO file using PoEdit or download from the same page where you downloaded the PO file:
  8. Review the translations on your site. If you find untranslated strings, continue to the next section for information about how to edit the translation files.

Translation Process

Setup New Language Translation Files on the Site

First, the translations need to be setup on the site. Here is the overview of that process:

  1. Download an existing translation or create a new file. In either case, save the translation .po file to the desktop.
  2. Open the file with PoEdit and select the new language.
  3. Save the file with PoEdit on to the desktop with the new locale.
  4. Find the .po and .mo files on the desktop.
  5. Transfer the .mo and .po files via FTP to the proper site folder.

Edit an existing language translation

Once your translation files are setup, then you can edit them any time you want with this process:

  1. Login to the site with FTP and navigate to the appropriate languages folder.
  2. Download the appropriate .po file from the site folder, and save a backup copy in another location.
  3. Open with PoEdit, Translate with PoEdit, Save with PoEdit.
  4. Identify the new .po and .mo files in your local save location.
  5. Transfer the .mo and .po files via FTP to the proper site folder.

Translating with PoEdit

This example is for translation of the core plugin. The process is the same for any plugin or theme, with the notable exception that the files are stored in the site in different folders.

  1. Download POedit and install the free program.
  2. Download the default translation. Each plugin or theme comes with English language .po and .mo files. Use FTP or cPanel to download the default language .po file to your local machine. You only need the .po file. PoEdit will create a new .mo file upon save.
  3. Open Poedit and select Create new translation:
  4. Navigate to the .po file and open it:
  5. Select the new language:
  6. Make sure to select exactly the same language you have at WP > Settings > General:
  7. Now save the file:
    1. Poedit will give you the correct extension, in our example that will be nl_BE.po.
    2. Make sure the filename matches the default translation filename. Example: geodirectory-nl_BE.po.
    3. PoEdit saves the .po and the .mo files: geodirectory-nl_BE.po and geodirectory-nl_BE.mo
    4. transfer BOTH the .po and the .mo files via FTP to the proper folder on the site.
    5. Save a backup of the files on your desktop and in your personal cloud, just in case of emergency.
  8. Translate the remaining strings. Now that the workflow is setup, you can Now translate any language string you want, and save the file once finished:
  9. When you are ready, upload both the .mo and .po file to the /wp-content/languages/plugins/ folder on the server.
    Create the folder if it does not exist yet:
  10. Go to your website and refresh to see your changes 🙂

Updating

Sometimes after an update of any of the GD plugins, you will find new strings on the site in the default language of English. You might then take a look in your existing language file, search for the strings, and not find the strings at all. In this case, it is because there are new strings that have become available with the latest version of the plugin.

This is because when a GD plugin is updated, the language file will have new language strings added.

This article explains how to merge the new language file with your PO and MO files already translated.

For this example, we will use a French GD core language file we need to update.

  1. Download the latest language file from the plugin:
  2. Navigate to your existing translate PO file:
  3. Open the geodirectory-fr_FR.po file with PoEdit:
  4. From the PoEdit menu, click Catalogue and then Update from POT file … :
  5. Browse to the PO file you downloaded at step 1, and Open:
  6. That will merge the new language strings with your translated file. Make any changes as required, save and upload.

Resources

  1. GeoDirectory Core Translations on WordPress.org
  2. GeoDirectory Addons Translations on WPGeoDirectory.com
  3. PoEdit
  4. Blog post – GeoDirectory Translation in 2018
  5. Blog post – Loading Translation Files Correctly

FAQ – Frequently Asked Questions

How can I translate custom fields?

Use the DB text translation tool. You can find a description here at this link.

How can I disable Automatic Update overwriting my translation files with Translation Files from WordPress.org

When translation files are place in the /wp-content/languages/ folder, they will not be overwritten by a manual update of the plugin, but they may still be overwritten by updates to the translations stored on wordpress.org.

All single WordPress self-hosted installs come with settings at Dashboard – Updates. These settings will download the official translations of the Core plugin (only) from wordpress.org. You can use these settings to download new versions of translation files for all plugins or themes on your site that are hosted with WordPress.org.

However, downloading the files in this way will overwrite files that are already located in the

wp-content/languages

folder. If you do not want to overwrite your local translation files, then do not use these Dashboard Settings to update translation files.

In addition to the Dashboard settings, if your site’s language(s) have translations of GD plugins or themes on wordpress.org, there is a good chance that your site will download those translations automatically when you update a plugin or theme. Some installation of WordPress also automatically download plugin translations, and automatically overwrite files in the

wp-content/languages

folder. If you have made custom changes to your translation files, and you don’t want those files overwritten by automatic updates by WordPress during plugin updates, you can use the following snippet to stop automatic updates of translation files during plugin updates.


add_action( 'upgrader_process_complete', function() {
	remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
}, 1 );
Was this helpful to you? Yes 3 No 1