Translation

Introduction | What you need to know
Translation Files | Core | Addons | Themes | Download
Translation process | Setup | Edit | PoEdit
More information | Resources | FAQ

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.

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_duplicatealert-en_US.mo
BuddyPress Integration /wp-content/languages/plugins/gdbuddypress-en_US.mo
Claim Listing /wp-content/languages/plugins/geodirclaim-en_US.mo
Custom Google Maps /wp-content/languages/plugins/geodir_customgmaps-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
Location Manager /wp-content/languages/plugins/geodirlocation-en_US.mo
Markercluster /wp-content/languages/plugins/geodir_markercluster-en_US.mo
Payment Manager /wp-content/languages/plugins/geodir_payments-en_US.mo
Review Rating Manager /wp-content/languages/plugins/geodir_reviewratings-en_US.mo
Name /wp-content/languages/plugins/geodir_sagepay-en_US.mo
Social Importer /wp-content/languages/plugins/geodir_socialimporter-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:

  • Download an existing translation or create a new file. In either case, save the translation .po file to the desktop.
  • Open the file with PoEdit and select the new language.
  • Save the file with PoEdit on to the desktop with the new locale.
  • Find the .po and .mo files on the desktop.
  • 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:

  • Login to the site with FTP and navigate to the appropriate languages folder.
  • Download the appropriate .po file from the site folder, and save a backup copy in another location.
  • Open with PoEdit, Translate with PoEdit, Save with PoEdit.
  • Identify the new .po and .mo files in your local save location.
  • 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 🙂

 

Resources

  1.  GeoDirectory Addons Translation Project
  2. Translators Handbook

 

FAQ – Frequently Asked Questions about Translation

  • Can I change “Place Title” and “Place Description”?
  • To change Place Title and Place Description on the Add Listing page, you need to use the language file and look for %s Title and %s Description.
    %s refers to the singular name of the custom post type, which you can set using the Custom Post Types addon, or by translating Place and Places in the language file.
    For example to change Place Title to Business Name, you would translate %s Title to %s Name, and change Place to Business.
  • How do I translate the “New” and “Featured” banners.
  • To translate the “New” and “Featured” banners used for GD listings, you can copy and paste the blank images below, adjust them as required and upload to your website. Then add the following CSS:
    [css].geodir_new_listing {
    background: url(‘http://reference to your new image’) no-repeat scroll left top transparent;
    }
    ul li .geodir_featured_img {
    background: url(‘http://reference to your featured image’) no-repeat;
    }[/css]

    Right-click to download and save:

      

  • Translating the days in the Events Calendar
  • When adding the Events Calendar Widget, you will have 4 options for the format of the day:

    If you want to translate the days on the calendar, you will have to choose another option than the first option.
    In the translation file for the Events Manager, you can then translate the strings that match the option you have chosen.

GD Translator’s Handbook

GeoDirectory Translator's Handbook
Welcome to our Translator’s Handbook. This is where we collect the resources we need to translate GeoDirectory into all the different languages of the world. My name is Ismi and I’m here to help.

Who translates? (Everyone!)
Find your Language Team
Setup
Say Hi/Bonjour/Selamat
Translate some strings
Request Validation
Become a PTE
GD Locale Topics
GD Lead Translators
Additional Resources

Who does translations? Everyone! All the plugin users together!

In 2017 WordPress translations changed completely. First there was a change in where translations are stored, and now the responsibility for who creates the translations has changed, too. Instead of plugin authors, it is now all of us, the plugin users and site managers and everyone together who are responsible for translating plugins into our own language.

It’s a big job, but luckily both WordPress.org and AyeCode are providing us with tools and support to help us get organized. Join us to reach the goal of making GeoDirectory available in 20+ languages in 2018! Read on to find out more about how to join us #polyglots to #makewordpress.

Find Your Language Translation Team on WordPress.org

Every language has a team. If you want to be a translator, you should go find out how to join the team for your language: https://make.wordpress.org/polyglots/teams/

Setup your accounts

Most translation team leaders are on WordPress slack. Here are the steps to quickly setup your WordPress and WordPress Slack accounts.

  1. Login/Register at http://wordpress.org
  2. Login/Register (same account) at https://translate.wordpress.org
  3. Visit https://make.wordpress.org/chat and use the same account to register for Slack
  4. Visit https://gravatar.com to set an image for your new
    @chat.wordpress.com address
  5. Visit https://make.wordpress.org/polyglots/teams/ and find your language, then click on “View Team”

Say Hi and ask to how to join your language team

Once you know where to find your language team, and you have all your accounts setup, it’s time to say hello to your language team.
Introduce yourself on #polyglots
Start with saying “Hi” in the #polyglots channel on WordPress Slack.

  1. Open WordPress Slack
  2. Click the + next to channel
  3. Search for #polyglots
  4. Join the channel
  5. Say “Hello” (or something like it). Introduce yourself, and mention which language team you want to join. For example: “Hello, everyone @here ! I am new, and want to join the language team. @ismiaini @alexrollin”

Say hi to your language team leaders
Next, you can message some of the leaders of the team, to let them know. Visit your language team page, or look through the requests or the GD Translations to find other WordPress users who have validated in the past. Then make a direct message in Slack to say hello to them also:

  1. Open WordPress Slack
  2. Click the plus next to Direct Message
  3. Search for the people from your translation team and add them to the message.
  4. Also add @ismiaini and @alexrollin to share the joy
  5. Enter a message and say “Hi” again and introduce yourself, like you did in the #polyglots channel.

Ask your team at these questions
There are, at least, two (2) questions that you want to ask your language team leaders before you submit a request for help with validation:

  1. “How do I join the team?”
  2. “Is there anything you can tell me before I make a request for validation?”

Note: Be nice to these folks, as they have worked hard at what they do and obviously care a great deal about translation into your own language. They are your new collaborators, and you are their new team member. Enjoy the opportunity to meet these new colleagues and to work together on this great project called WordPress.

Translate some strings

Visit the GeoDirectory page for your language: https://translate.wordpress.org/projects/wp-plugins/geodirectory
The best way to get started is to click on one of the incomplete projects and then click on “untranslated”. This gives you a list of strings that need translation. Double click and add a translation. Easy!

Request Validation

Once you have translated some strings, you can ask your language team for help with validation. You can make your request here: https://make.wordpress.org/polyglots/?resolved=unresolved

Here is a template you can use to make your request. All the users tagged in the request will receive a notification.

Hello #polyglots! I translated some strings with our project language team and we need your help with validation.

o fr_FR @MyUsername @ismiaini @alexrollin

Pleased to answer comments and questions below in the comments.

CAUTION: Your language team will be happier if you contact them by WordPress Slack to say hi, first, BEFORE you request help. Your team may also have additional suggestions or rules about joining their team. Be sure to ask “How do I join the team?” before you ask “Is there anything you can tell me before I make a request for validation?”.

What’s a PTE?

Once you translate some strings, the strings must be validated by someone who is a member of your language team. Remember the person you said “hi” to above? Someone like them. Once you join your language team, and then complete a translation for GeoDirectory, you can ask a leader of your language team to set you up as a PTE for GeoDirectory for your language. A “PTE”, which is an acronym for “Project Translation Editor”. PTEs can validate strings. PTEs are assigned by the WordPress language team to to projects in their language. For example, a person who translates GD into Russian would go and talk to the Russian team members and ask them to validate the new translations. Then, when they finish, the translation team might make them a PTE for the GeoDirectory Russian translation. Being a PTE means that your strings are automatically validated, and you can validate the contributions of others, too.

GD Translation Leads

Are you committed to keeping up GeoDirectory translations for your native language? Here’s the rundown of what goes with the territory:

  • Join the WordPress language team for your native language.
  • Complete and continuously update the translation of GeoDirectory core and readme.txt on WordPress.org for your langage.
  • Complete and continuously update the translations of the GD Addons here.
  • Follow your own WordPress language team’s guidelines for translations and collaboration with other translators.

One lead translator from each language will receive a GeoDirectory membership that will remain active as long as they remain a translation lead on the GD Translation Team.

GD Translation Topics

Join up with others here on GD that speak your language. Some languages have a forum topic they call “home”; if your language doesn’t have one, go ahead and create it in the transations forum.

Existing Locale Forum Topics

Locale (English) Locale (Native) WP Locale Team Topic
Indonesian Bahasa Indonesia id_ID https://wpgeodirectory.com/support/topic/indonesian-locale/
French (France) Français fr_FR https://wpgeodirectory.com/support/topic/french-locale/

Additional Resources

Translating GD Listings in a multilingual site

How do you add a listing in more than one language on your WPML – GeoDirectory site?

Let’s say we want to add an English and a Dutch version of the same listing. These are the steps required:

  1. Add the listing the normal way, yourself or user submission.
  2. Once that is done, login as administrator and navigate to the new listing in the backend.
  3. Once there, click the + sign to add a translation of the listing:
  4. This will open a new listing, and once there, click Overwrite with English content:
  5. Save the Dutch version of the listing. You will now have a listing with two language versions:
  6. Translate the Dutch version as required, or if this was a user submitted listing, notify your user, who now can log in to the Dutch version of your site, and will find his listing in his dashboard, ready for translation:
  7. Now your visitors will be able to switch languages for the listing while looking at the detail page.

Adding two different listings from the frontend will not link them together, even if using the same address. You need to create the listing in the other language in the backend for them to stay connected.

Translating Custom Post Types

Translating Custom Post Types names

  1. If you only want to translate your CPT names (like Place and Places), follow the instructions here. Only the Multilingual Blog plugin is required then.
  2. But if you also want to translate the CPT slugs, you will need to keep reading below.

Translating Custom Post Types slugs

  1. Translate your CPT names (like Place and Places) as explained above.
  2. To translate your CPT slugs (like /places/ or /events/ etc), you will need WPML’s String Translation plugin, and the Translation Management plugin which are part of the Multilingual CMS plugin.
  3. Once the String Translation and Translation Management plugins are activated, go to WPML > Translation Management, and select the Multilingual Content Setup tab. and then select Custom posts slug translation options:

  4. Select and save Translate custom posts slugs (via WPML String Translation):

  5. Now scroll down the page to Custom posts, and select the CPTs to translate and add your translations before saving:

Updating your language files

Sometimes after an update of any of the GD plugins, you will find new words on your website and you cannot find how to translate them when looking in your language files.

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.

Getting Addon Translation Files

This document applies to Addons. GD Core plugin translations are located on WP.org. See the Translators Handbook for more information.

GeoDirectory Addon translations are maintained in the GeoDirectory language project.

In the example below, an Italian translation will added to a multi-lingual GD site. The process for a single language site is the same.

  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, refer here for how to translate strings with PoEdit.

Translating countries and map directions

On this page:

Changing the map language and directions Translating country names 
More information Translating regions or cities

Changing the map language and directions

The default language of your GeoDirectory maps is English, but you can change that to any language supported by Google maps. This is how:

  1. Go to your WP admin  area
  2. Navigate to GeoDirectory > Design > Map
  3. Under default map settings, change the language at Default map language

This will also change the directions given on any listing detail page, when visitors enter their address in the directions field below the map.

To translate other language strings related to your maps (like Enter Your Location below the map on the detail page), review the core translation article.

Translating country names

This only applies if you use the Location Manager (MultiLocations).

  1. Translate the countries in the language file of the core GD plugin (review the core translation article).
  2. In your WP admin area, navigate to GeoDirectory > MultiLocations > Translate Countries.
  3. Select the countries you want to translate, and click Update.
  4. This will change the country name and the country URL site-wide.

More information

Translating regions or cities

  1. Only countries can be translated, regions and cities cannot be translated.
  2. The name and slugs of regions and cities will be added as per the Map API.
  3. If you have a multi-language site with WPML, all regions and cities will have the same name and slug across the different languages.

Translating Custom Fields

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 only available in the Multilingual CMS version of the plugin.

Translating Custom Fields using WPML’s String Translation module

  1. Make sure you have selected to use String Translation, use one of the two options:
  2. Create your custom field, and enter description, front end title etc. For this example we are creating a text field:
  3. Then go to GD > Tools > Load custom fields translation:
  4. This will scan your DB for custom fields and copy them to a file in your geodirectory plugin folder called db-language.php
  5. WPML will then be able to scan this file and allow you to translate them.
  6. To translate them go to WPML > String Translation, where you will see the new fields added:
  7. Now you can translate them and save:
  8. This would be the result on the Add Listing page:
    French

    English

    Dutch

Translating Custom Fields without WPML’s String Translation module

  1. If you are only using the WPML blog version, then first follow steps 2 and 3 as explained above.
  2. That will create a file called db-language.php that you will find in your geodirectory folder on the server.
  3. Copy that file and your GD core language file to your computer and then open the .po file and rescan the project.
  4. This will add the translations to the .po file and you can then follow the normal translation process as explained here.
  5. Below you can learn more about the process for merging the custom field data with the normal language files.

Instructions

  1. 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:
  2. Then open /wp-content/plugins/geodirectory/geodirectory-languages/geodirectory-en_US.po using PoEdit:
  3. From the catalogue menu, choose Update from sources ...:
  4. That will merge db-language.php:
  5. 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].

Translating themes (including GeoDirectory themes)

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 use a child theme, this way you won’t lose your changes when the main theme is updated.
You can download both the GeoDirectory Framework Theme and its child theme, and the GDF Modern child theme from your download area.

Let’s get started:

1. Download poedit or check here for alternatives

2. Download the main theme’s  language file to your computer using FTP. For the GDF theme that file is at
/wp-content/themes/GeoDirectory_framework/languages/en_US.po.

3. Open poedit and choose

  1. Edit a translation (if you want to keep your site in US English)
  2. Create a new translation (if you are using any other language for your site)

4. Select the en_US.po from your computer.
You might have to change the type of file displayed from .POT to .PO.

Skip step 5 and 6 if you are not translating to another language, but only editing the US English version.

5. If you are translating to another language, then poedit will ask you what language you want to use for your translation.
For example if you are translating to French you would choose French from the list provided:

6. Save your translated file in the same format as the original language file:
In our example that would be fr_FR.po.

7. Change any of the language strings you want to translate or change.
When you then save the .po file, a .mo file will automatically be created.

8. Upload the .mo file (in our case en_US.mo or fr_FR.mo) to your child theme languages folder.
If there is no languages folder in your child theme just create one.
The result should look like this /wp-content/themes/GDF_child/languages/en_US.mo or /wp-content/themes/GDF_child/languages/fr_FR.mo.

9. If you have not set the language of your website yet, you do that by going to your wp-admin area, and then go to Settings > General > Site language and select your language there.
If your language is not available there, then you can download your WordPress language file here.

10. Go to your homepage and refresh to see your changes :).

Protect your files during theme updates
WordPress 4.6 introduced a new option to all you to store your theme translation in the following location:

/wp-content/languages/themes/my-theme-en_US.mo

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.

Translating Addons

Translating Addons is much the same as translating core with one exception, the file names differ.
Please see the translating core docs and then when saving your .mo files please see the reference guide below for file names.

You can find some ready made translations in our languages project, find out more here.

Addon name .mo location path (text domain)
CORE /wp-content/languages/plugins/geodirectory-en_US.mo
Advance Search Filters /wp-content/languages/plugins/geodiradvancesearch-en_US.mo
Ajax Duplicate Alert /wp-content/languages/plugins/geodir_duplicatealert-en_US.mo
Autocompleter /wp-content/languages/plugins/geodir_autocompleter-en_US.mo
(Deprecated from core version 1.3 – merged with Advance Search Filters)
BuddyPress Compliments /wp-content/languages/plugins/bp-compliments-en_US.mo
BuddyPress Integration /wp-content/languages/plugins/gdbuddypress-en_US.mo
Claim Listing /wp-content/languages/plugins/geodirclaim-en_US.mo
Custom Google Maps /wp-content/languages/plugins/geodir_customgmaps-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
Location Manager /wp-content/languages/plugins/geodirlocation-en_US.mo
Markercluster /wp-content/languages/plugins/geodir_markercluster-en_US.mo
Payment Manager /wp-content/languages/plugins/geodir_payments-en_US.mo
Review Rating Manager /wp-content/languages/plugins/geodir_reviewratings-en_US.mo
SagePay Payment Gateway /wp-content/languages/plugins/geodir_sagepay-en_US.mo
Social Importer /wp-content/languages/plugins/geodir_socialimporter-en_US.mo