Golo WordPress
  • Introduction
  • Getting Started
  • Changelog
  • Installation
    • Step 1 - Download Theme
    • Step 2 - Install Theme
    • Step 3 - Install Plugins
    • Step 4 - Import Demo Data
      • Import Demo V2
    • Step 5 - Create Pages
    • Step 6 - Permalink Setup
  • Update Theme
  • Theme Options
  • Listings
    • Country
    • Cities
    • Categories
    • Place Type
    • Amenities
    • Add a new place
    • Booking
  • Setup Menubar
  • Header/Footer Builder
  • Customize
  • Widget Sidebar
  • Woocommerce
  • Blog
  • Golo Core
    • Claim Listing
    • Custom Fields
  • FAq's
    • How to add new string in Polylang
    • How to use Google Reviews
    • Fixing Outdated WooCommerce Templates
    • Why don't i see the Claim Listing with the latest version?
    • Additional fields for the listing details
    • How to add a Search Tool to find an Articles on the Blog Page
    • How to create an API Key for Mapbox
    • How to create an API Key for OpenStreetMap
    • How to create Google Maps API For Free 2020
    • How to config URL Slug
    • How to setup Login via Facebook & Google
    • How to translate/edit texts/words?
    • How to edit footer?
    • Why the site lost footer after updated?
    • How to create/edit a pricing package?
    • Why Does Google PageSpeed Insights Show Such Low Scores?
    • How to Configure WordPress to Use SMTP For Sending Emails?
    • How to setup Open/Close Status of Places?
    • How to import/ export WordPress Site?
    • How to remove pages from frontend dashboard menu?
    • How to use Video Background, Slideshow on Homepage?
    • How to edit the Template Golo Framework?
    • Why is the pricing plan page not showing the table?
    • How to Increase PHP Time Limit for a WordPress Site?
    • How long time get Support?
    • Why lose sections in the Place detail after update version 1.4.6?
    • Cloudflare Auto Minify Feature
    • How To Submit Ticket?
    • Missing demo images
  • TIPS & TRICKS
    • WordPress Hosting
    • Support
    • Resource Credits
    • Theme License
Powered by GitBook
On this page

Was this helpful?

  1. FAq's

How to add new string in Polylang

PreviousCustom FieldsNextHow to use Google Reviews

Last updated 3 years ago

Was this helpful?

In order for Polylang to know what to translate, it is necessary to register the words that need to be translated. Polylang, by default, withdraws all the words that it believes should be translated and placed in Strings Translations. However, the problem is the words that Polylang does not see as the words to be translated.

Here is an example of the words that I added in Strings Translations, which Polylang did not immediately withdraw, can be seen to be important words that should also be translated:

Here’s what you need to do. Find the string that you need to be registered. I need to register Sign Out, so I went to header.php (file in the child theme) and found the row containing:

<?php _e('Sign Out', 'golo-framework'); ?>

Therefore, you need to register Sign Out. When you find out, go to functions.php (file in the theme) and add the following line to the bottom:

pll_register_string('golo-framework', 'Sign Out', 'true');

From that moment, the Sign Out string is located in Strings Translations and you can add translations for the languages that you have set up in Polylang.

Insert translation for registered strings

Go to Strings Translations and add translations for the new string:

Quite simply, but that’s not enough. Now we have made Polylang aware of what the words should offer the translation we have inserted, but Polylang still does not know where to show these words. You need to do the following.

Calling for translated strings

Return to the header.php file and replace:

<?php _e('Sign Out', 'golo-framework'); ?>

Instead, place:

<?php echo pll_e('Sign Out')?>

And that is that. Now you have informed Polylang that the Sign Out option should change depending on the language that is selected on the site.

This procedure should be repeated for each word-string to be translated. Keep in mind that strings are in different theme files, and all the strings can be registered through the functions.php file.