An issue with Polylang and theme translation
-
there’s a website on custom theme and the Polylang plugin. It was good when I used for couple months. While changing the language it translated such code
<?php _e('Hello!','themedomain'); ?>
Then something went wrong and it stopped translating. .mo and .po files didn’t change, code too. But now it stopped to translate expressions.
Polylang 2.0.4, WordPress 4.6.1
Loading text domain:
add_action( 'after_setup_theme', 'mytheme_setup' ); if ( ! function_exists( 'mytheme_setup' ) ): function mytheme_setup() { add_editor_style(); add_theme_support( 'post-thumbnails' ); add_theme_support( 'automatic-feed-links' ); $path = get_template_directory() . '/languages'; //$result = load_theme_textdomain('themedomain', $path ); //if ( $result ) //return; //$locale = apply_filters( 'theme_locale', get_locale(), 'themedomain' ); //die( "Could not find $path/$locale.mo." ); load_theme_textdomain('themedomain', $path ); //if ( is_readable( "$path/$locale.mo")) { echo "+"; } else { echo "-"; }; } endif;
If I uncomment this
//$result = load_theme_textdomain('themedomain', $path ); //if ( $result ) //return; //$locale = apply_filters( 'theme_locale', get_locale(), 'themedomain' ); //die( "Could not find $path/$locale.mo." );
it shows “Could not find /the/full/path/ru_RU.mo”, however another language is chosen.
If I uncomment this
//if ( is_readable( "$path/$locale.mo")) { echo "+"; } else { echo "-"; };
it shows –
Files permissions are 666, ‘languages’ directory is 777.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘An issue with Polylang and theme translation’ is closed to new replies.