How are themes and plugins localized using the gettext GNU framework?
How are themes and plugins localized using the gettext GNU framework?
How are themes and plugins localized using the gettext GNU framework?
Import js variables loaded via wp_localize_script() into js module without global scope connection
There are several plugins out there that help you to translate your site content. Though you could have googled that by yourself easily, look here to get a brief overview: https://premium.wpmudev.org/blog/top-6-translation-plugins-for-your-wordpress-site/ WPML is a very powerful translation plugin (not free), in your case qTranslate should be good enough and is easier to implement than WPML … Read more
There was a syntax error in loading the WooCommerce translations and I managed to get the parent theme translations working by following the same method I used for the WooCommerce translations. function weg_localisation() { unload_textdomain( ‘woothemes’ ); load_textdomain(‘woothemes’, get_stylesheet_directory() . ‘/lang/af_AF.mo’); unload_textdomain(‘woocommerce’); load_textdomain(‘woocommerce’, get_stylesheet_directory() . ‘/woocommerce/i18n/languages/woocommerce-af_AF.mo’); } add_action(‘init’, ‘weg_localisation’);
If you have static text with dynamic content then you can use. printf( esc_attr___(‘static text goes here with %s’, ‘text-domain’ ), $title ); If you have only $title then no need to translate it. Just escape it. echo esc_attr( $title ); Note esc_attr, esc_attr__ and esc_attr_e used for escaping dynamic values from HTML element attributes. … Read more
No it does not work, people that will need to translate the string will not be able to use the automated tools they usually use to extract the strings that need translation. And yes, it is always bad.
I’m guessing you mean the WordPress Admin bar which shows in the header of the logged in user page? Can you get the user to login and check that they haven’t disabled this under the User > My Profile menu option Also you might like to check out this plugin which allows you to switch … Read more
See the php sprintf and printf functions. They are tokens that get data from a function or variable separated by commas at the end of the call. $variable=”sprintf”; printf( ‘Hey dude check out the %s php function’, $variable );
You just need to set your words in a WordPress translation tag in your theme: <?php _e(‘Goedemorgen’,’yourthemename’);?> And with the WPML string translation tool you can scan for these strings and give the appropriate translation. That’s how I do it with the paying WPML plugin. Works like a breeze. No need to make your own … Read more
Use date_i18n() from wp-includes/functions.php. /** * Retrieve the date in localized format, based on timestamp. * * If the locale specifies the locale month and weekday, then the locale will * take over the format for the date. If it isn’t, then the date format string * will be used instead. * * @since 0.71 … Read more