Admin keeps showing pending translation update
Solved following https://wordpress.stackexchange.com/a/262613/143330. Deleting unused language files inside /wp-content.
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’ );
I’d recommend you using Loco Translate plugin to create a translation. If you are creating a theme, you should specify the Text Domain and Domain Path in your style.css file. /* Theme Name: My Theme Name Author: My Name Author URI: http://sample.url Description: Your theme description Version: 1.0.0 Text Domain: mydomain Domain Path: /lang */ … Read more
As you’re using _x() as your translation function you should do one of the following. 1) If ‘slug’ is supposed to be your text-domain, add context to the _x() functions, e.g. _x( ‘Homepage’, ‘page title’, ‘slug’ ). 2) If ‘slug’ is your context, then add the text-domain, the third parameter, to your translation functions as … Read more