Language file not effecting post slider

Hi I followed your instructions on here https://theme.co/apex/forums/topic/change-child-theme-language/#post-6751 to add some Swedish Translations to our site.

I’ve located the .po & .mo files in the child theme x-child/framework/lang/sv_SE.po and referenced that in functions.php of the child theme with:
add_action( ‘after_setup_theme’, ‘my_child_theme_setup’ );
function my_child_theme_setup() {
load_child_theme_textdomain( ‘x’, get_stylesheet_directory() . ‘/lang’ );
}

But on the slider for featured posts you can see here the View Post button is still in English. Can you advise how to change that?

Summary

https://test.swedishposture.se/inspiration/

Thanks in advance.

Hello There,

Thanks for writing in! The “View Post” keyword is included in the translation file. You should have translated it already. Do you have a customization to the post slider which you may have added in the child theme? This could be the reason why. To resolve this issue, please add the following code in your child theme’s functions.php file

add_filter('gettext', 'translate_text' );
function translate_text($translated) { 
  $translated = str_ireplace('View Post', 'your translation', $translated);
  return $translated; 
}

We would loved to know if this has work for you. Thank you.