I donwloaded and applied a theme to my WordPress 4.7.2 installation.
The site's locale specified in the admin settings is it_IT
and the theme was not translated in this language so I'm trying to create a translation for the custom strings the theme uses.
So what I did was:
- Opened the
/wp-content/themes/thf/languages/thf.pot
file (thf
being the theme's name) with POEdit - Created a new it_IT translation and translated all the strings
- Saved the project.
/wp-content/themes/thf/languages/it_IT.po
and/wp-content/themes/thf/languages/it_IT.mo
files were created - Edited the
functions.php
adding the following.
.
function thf_setup() {
load_theme_textdomain( 'thf', get_template_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'thf_setup' );
But the strings won't translate. Looks like I don't need to define WP_LANG
in config.php
since I'm on WordPress 4.7.2 so I didn't edit that.
I also looked at other similar questions but they all point to either load_theme_textdomain
, which I added, or WP_LANG
, which I don't need.
Am I missing something else? Thanks in advance for your attention.