@ville123: Go to => Child Theme folder => functions.php and add the following Code.
function polylang_translation() {
if ( function_exists( 'pll_register_string' ) ) {
$header_media_title = get_theme_mod( 'catch_fullscreen_header_media_title', esc_html__( 'Dancing Under The Sky', 'catch-fullscreen-pro' ) );
pll_register_string( 'catch_fullscreen_header_media_title', $header_media_title, 'Catch Fullscreen Pro' ); //die('aaaa');
}
}
add_action ( 'admin_init', 'polylang_translation' );
function catch_fullscreen_header_title( $before = '', $after = '' ) {
if ( is_front_page() ) {
$header_media_title = get_theme_mod( 'catch_fullscreen_header_media_title', esc_html__( 'Dancing Under The Sky', 'catch-fullscreen-pro' ) );
if ( $header_media_title ) {
if( class_exists( 'Polylang' ) ) {
echo $before . pll__( $header_media_title ) . $after;
}
else{
echo $before . wp_kses_post( $header_media_title ) . $after;
}
}
} elseif ( is_singular() ) {
if ( is_page() ) {
if( ! get_theme_mod( 'catch_fullscreen_single_page_title' ) ) {
the_title( $before, $after );
}
} else {
the_title( $before, $after );
}
} elseif ( is_404() ) {
echo $before . esc_html__( 'Nothing Found', 'catch-fullscreen-pro' ) . $after;
} elseif ( is_search() ) {
/* translators: %s: search query. */
echo $before . sprintf( esc_html__( 'Search Results for: %s', 'catch-fullscreen-pro' ), '<span>' . get_search_query() . '</span>' ) . $after;
} else {
the_archive_title( $before, $after );
}
}
Now, you should be able to translate the Header Media Title when you Go to => Dashboard => Languages => String Translation.
Let me know if this works out!
Kind Regards,
Skandha