Menu names not getting translated
Menu names not getting translated
Menu names not getting translated
Interface translation without plugins
So as you explained I installed fresh WordPress with woo-commerce and Loco Translate is working fine, I am using storefront theme, So i guess It’s something your theme is not compatible. One thing i found is that when i changed language from English to German and then back to German there were still some words … Read more
It depends how and where you use this string. Possibly, you have to localize the date according to the site settings: <?php $date_format = get_option( ‘date_format’ ); $timestamp = strtotime( get_the_time() ); $localized_date = date_i18n( $date_format, $timestamp );
WordPress has no ability to switch language based on URL or query string parameter. In fact it does no dynamic language switching at all. Wherever you’ve seen this working, it would have been using a plugin. You say you don’t want to use a plugin, which means you’ll have to write all the switching logic … Read more
By default WordPress only loads translations according to the user’s language when they’re viewing admin pages. You can see that in the code for the load_theme_textdomain function: $locale = apply_filters( ‘theme_locale’, is_admin() ? get_user_locale() : get_locale(), // ^^^^^^^^ $domain ); So your code is fine if you want to override that behaviour for the front … Read more
Your error is here The path to your bundled translations resolve to a languages folder inside the includes folder, which is one level down from where it actually is. Try it with an extra dirname and you will target it correctly: dirname( dirname( plugin_basename( __FILE__ ) ) ) . ‘/languages/’ Or to be a bit … Read more
You have a UTF-8 encoding issue. You are seeing single, unprintable bytes. That suggests the data is either stored in a single byte character set, or something is converting it from UTF-8 to a single byte character set. Regarding PO files (actually MO files are what WordPress reads). These need to be UTF-8 encoded. You … Read more
You already have the answer, but perhaps you’re not running your code early enough. Returning true from the override_load_textdomain filter will prevent all MO files from loading, but you’ll have to run it early to catch WordPress Core translations. Adding it as a must-use plugin does the trick for me: /* Plugin Name: Disable Gettext … Read more
You need to add an additional filter on the frontend. Very basically it would look like this: Frontend (eg. single.php): echo apply_filters( ‘my_custom_persian_filter’, $post_date ); Backend (eg. functions.php) function persian_date_function( $date ) { $date = $converted_to_persian; // there you convert date to persian return $date; } add_filter( ‘my_custom_persian_filter’, ‘persian_date_function’ );