Is it possible to translate a theme of a Wordpress online site?

187 Views Asked by At

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

There are 2 best solutions below

0
Akhtarujjaman Shuvo On

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.

0
Václav Slavík On

Poedit can connect to a live WordPress site with FTP, yes.