Hi, I’ve finished translation of this theme to Czech. And in next 30 mins the transaltion will be generated. If it doesn’t hel try to add the functions.php file as described here.
Still doesn’t work. What I’ve done:
a) placed the language files to /wp-content/themes/blogsonry/languages/
b) placed
function my_child_theme_locale() {
load_child_theme_textdomain(‘blogsonry’, get_stylesheet_directory() . ‘/languages’);
}
add_action(‘after_setup_theme’, ‘my_child_theme_locale’);
into functions.php in /wp-content/themes/blogsonry/
c) placed
define(‘WPLANG’, ‘cs_CZ’);
into wp-config.php (and i have czech version of WP installed).
What’s wrong?
Translation works only if I place the language files to /wp-content/languages/.
Did you checked for new translations? it sohuld be at address your /wp-admin/update-core.php
Did you named the file like this? cs_CZ.mo
(its described in CODEX)
I’ve forgot that the latest version of WordPress prefere /wp-content/languages/
directory, so it might be useless.
But when I was testing the new translation which was generated, everything worked well.
-
This reply was modified 7 years, 11 months ago by
Tomas.
As I wrote in my first post, my language file is named “blogsonry-cs_CZ.mo”.
As I wrote in my second post, it works, if I place language file to /wp-content/languages/.
But it didn’t work if I place language file to /wp-content/themes/blogsonry/languages/ and
function my_child_theme_locale() {
load_child_theme_textdomain(‘blogsonry’, get_stylesheet_directory() . ‘/languages’);
}
add_action(‘after_setup_theme’, ‘my_child_theme_locale’);
in functions.php in blogsonry folder.
Did you tried to udpate Czech versions?
Sure. It’s not the matter of .mo version – it works even with the older one placed to /wp-content/languages/. Doesn’t work if i place it to /wp-content/themes/blogsonry/languages/.
So I guess there is something wrong with the recommended
function my_child_theme_locale() {
load_child_theme_textdomain(‘blogsonry’, get_stylesheet_directory() . ‘/languages’);
}
add_action(‘after_setup_theme’, ‘my_child_theme_locale’);
I thoght if you tried to check for updates in WordPress backend not just pushing new .mo file.
The function might not be active as the wordpress translations have the highest priority.