how importing words and phrases wrapped with gettext?

[ad_1]

Plugin Author
Tim W

(@timwhitlock)

Show me the code where you have defined this sentence as a translatable string.

<?php
/*
Plugin Name: MySite-plugin
Author: Sacconi
Description: Site specific code changes for example.com
Text Domain: mysite-plugin
*/
/* Start Adding Functions Below this Line */
function wpb_author_info_box( $content ) {
 
global $post;
 
// Detect if it is a single post with a post author
if ( is_single() && isset( $post->post_author ) ) {


......


......

$titolo_prezzo_include="<h4 class="titolo_affitti">". esc_html__('Il prezzo include:', 'my-text-domain') . '</h4>';

Plugin Author
Tim W

(@timwhitlock)

my-text-domain is not your text domain. You defined your text domain as mysite-plugin. So your code should be changed to:

esc_html__('Il prezzo include:', 'mysite-plugin')

This is a fundamental of WordPress i18n. Coding help is outside remit of my support here, but if you have any problems using Loco Translate’s string extractor, then feel free to reopen this topic.

As a side note, WordPress source strings are conventionally in English.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer