Tag Info

New answers tagged

1

WP translation functions, are meant to translate static strings. E.g. Regarding options, you should use them to translate the labels, not values. However, as far I remember, the translation utility of WPML works in contrast to standard translation, i.e. if you use that than you can't load the transaltion using from .po/.mo files. If users want to use that ...


0

You can create a menu use another language. Then you use conditional code to switch the menu. or you can use title attribute of menu. if($language=='us'): wp_nav_menu(menu1); else: wp_nav_menu(menu2); endif;


0

You are doing things correctly. Either the plugin is including its languages folder and text domain in a wrong way, or your locale is wrong. You can install Codestyling Localization plugin in order to check if the plugin is being localized as it should be, and if it doesn't give any warnings, then try forcing the locale of the site from Settings -> Language ...


0

After adding code to detect locale like get_locale(), I could not seeing language locale returned. So not sure how load_plugin_textdomain works to detect locale in wordpress 3.9.3.


0

The said thing is this si-contact-form would not work even when it first got installed. I originally came with load_plugin_textdomain('si-contact-form', false, 'si-contact-form/languages/' ); and it did not work so I changed it to load_plugin_textdomain('si-contact-form', WP_PLUGIN_DIR.'/si-contact-form/languages/' ); and it did ...


1

get_current_screen() is a pain, I use the following code to avoid/wrap it: /* * Convenience function to tell if we're on a specified page. */ function theme_is_current_screen( $base = null, $post_type = null ) { if ( ! $base && ! $post_type ) { return false; } $screen = function_exists( 'get_current_screen' ) ? ...


1

According with the codex, get_current_screen() has to be used later than admin_init hook. After a few tests, it seems that the safiest way is to use current_screen action hook instead of get_current_screen(): add_action('current_screen', 'current_screen_callback'); function current_screen_callback($screen) { if( is_object($screen) && ...


0

You are passing a wrong path. The third parameter of load_plugin_textdomain() is the relative path to WP_PLUGIN_DIR where mo files are located; you are using absolute path instead. The correct is: load_plugin_textdomain('si-contact-form', false, 'si-contact-form/languages/' ); Also, you said that the mo files are located in ...


3

I cannot find the reference for hard answer on this, but likely it can handle large strings just fine. From quick look at WP's own files somethings like this: __('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for ...


0

Please note how the translation works: The Text Domain should be same in all the places of your theme. On this page you can see the Theme's text domain setup: load_theme_textdomain( '_s', get_template_directory() . '/languages' ); And on this page (and many in this theme), you can see the implementation of the Text Domain: _e( 'Nothing Found', '_s' ); ...



Top 50 recent answers are included