skip to Main Content

I’m working on a personal site that I’m developing directly on a test hosting. The site is made in WordPress and I’m creating the theme. At this point I want to translate the theme but until now I’ve made it only on local’site with poedit. The translation plugin that I’m using is Polylang. Is it possible to do this whit a site that is online?

Thanks

2

Answers


  1. Yes, it is possible, for that you’ve to assign a textdomain in load_theme_textdomain() function that is using for translate.

    <?php
    /**
     * Create textdomain in you themes/theme-name/lang/ folder
     */
    function load_textdomain(){
        load_theme_textdomain( 'YOUR_TEXTDOMAIN', get_template_directory() . '/lang' );
    
    }
    add_action( 'after_setup_theme', 'load_textdomain' );
    ?>
    

    Then if you use translating plugin that has the functionalities of generating POT file otherwise I suggest using Loco Translate plugin for generating POT files.

    After generating POT file in different languages you can update the theme to other servers and translations should reflect there also.

    Login or Signup to reply.
  2. Poedit can connect to a live WordPress site with FTP, yes.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search