Translate wordpress without duplicate custom post
Translate wordpress without duplicate custom post
Translate wordpress without duplicate custom post
Because the translate function __() worked fine, I suspected printf() was the culprit. Turns out sprintf() is what I needed! printf() arguments work differently
Solved following https://wordpress.stackexchange.com/a/262613/143330. Deleting unused language files inside /wp-content.
I think Jacob has probably solved your problem in the comments. However, to your question: How to debug further this issue? I would hook into the load_textdomain_mofile filter and check the fully built file paths WordPress is actually trying to read: Example: <?php function debug_missing_mofile( $mofile, $domain ){ if( ‘ausg’ === $domain && ! is_readable($mofile) … Read more
get_locale() and get_user_locale() are functions to retrieve the locale that is already set. To change it, you want to “filter” the locale value. For that, you want to use the locale filter hook. The following should do it: add_filter( ‘locale’, ‘custom_locale’ ); function custom_locale( $locale ) { $locale = ( is_admin() ) ? “en_US” : … Read more
Suspect incomplete .pot file – what to do?
Theme translation not working
And what to do next? I guess it should be linked somewhere. The plugin loads your language itself, so you don’t need to do anything. However, it must be named correctly. I added my translated .po and .mo to language file. Where and what are they named? For Slovak your MO file must be named … Read more
The only instance of “Count” I can see in the default domain’s admin file has a context value of “Number/count of items”. So your code should be: add_action( ‘admin_init’, ‘action_admin_init’ ); function action_admin_init() { _ex( ‘Count’, ‘Number/count of items’ ); } Ref: _ex.
Ok, found on a blog this solution, paste in functions.php of your child theme : function child_theme_slug_setup() { load_child_theme_textdomain( ‘parent-theme-domain’, get_stylesheet_directory() . ‘/languages’ ); } add_action( ‘after_setup_theme’, ‘child_theme_slug_setup’ );