How do I make this plugin translation-ready?
How do I make this plugin translation-ready?
How do I make this plugin translation-ready?
WPLANG option not available in localhost
Yes that would be easy. You can use the get_the_permalink() function to retrieve a post’s link. Here’s how to do it: // You are storing the post data here $posts_arr[] = $post; // Add the URL to the same array element $posts_arr[][‘url’] = get_the_permalink(); You can get the index of the current post in the … Read more
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