Does WPML translate numbers automatically, or do I have to do the string translation? [closed]
It is better to use gettext calls, according to WPML Guidelines.
It is better to use gettext calls, according to WPML Guidelines.
I found the answer: load_textdomain( ‘site-map’, TEMPLATEPATH.’/partials/languages’ ); … gives the path of the folder containing the .mo file. but the path of every individual mo file should be used in its own load_textdomain instruction : load_textdomain(‘site-map’, TEMPLATEPATH.’/partials/languages/site-map-fr_FR.mo’); load_textdomain(‘site-map’, TEMPLATEPATH.’/partials/languages/site-map-en_US.mo’); load_textdomain(‘site-map’, TEMPLATEPATH.’/partials/languages/site-map-es_ES.mo’); load_textdomain(‘site-map’, TEMPLATEPATH.’/partials/languages/site-map-ru_RU.mo’); load_textdomain(‘site-map’, TEMPLATEPATH.’/partials/languages/site-map-de_DE.mo’); Shame on me it is a very obvious and … Read more
in poeditor go to file->preferences->extractors->javascript->edit and change language JavaScript to php
I’m not sure, but if I understand correctly you should create a second menu which is only visible on your Spanish language page. if (is_page($english_page_id)) { wp_nav_menu( array(‘menu’=>$english_menu) ); } if (is_page($spanish_page_id)) { wp_nav_menu( array(‘menu’=>$spanish_menu) ) } is_page() wp_nav_menu()
You could just rename the labels associated with that post type. class News_Post_Type { const POST_TYPE = ‘post’; public static function init() { $post_obj = get_post_type_object(‘post’); $post_obj->labels->name = __(‘News Post’, ‘textdomain’); $post_obj->labels->singular_name = __(‘News Post’, ‘textdomain’); // You can continue to rename all the label properties, this is just an example } } add_action( ‘init’, … Read more
I found the answer was to create my own walker with a little help from this article. This is it. The most important part being when it checks for the $language value (which is got from a cookie), and assigns the value of either $item->title or $item->description. class description_walker extends Walker_Nav_Menu { function start_el(&$output, $item, … 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
Try to rename your files, from woosidebars-fr_FR.po to fr_FR.po. The same for .mo file.
For archives you can use the get_archives_link filter like this: add_filter(‘get_archives_link’, ‘translate_archive_month’); function translate_archive_month($list) { $patterns = array( ‘/January/’, ‘/February/’, ‘/March/’, ‘/April/’, ‘/May/’, ‘/June/’, ‘/July/’, ‘/August/’, ‘/September/’, ‘/October/’, ‘/November/’, ‘/December/’ ); $replacements = array( //Put here whatever you want ’01’, ’02’, ’03’, ’04’, ’05’, ’06’, ’07’, ’08’, ’09’, ’10’, ’11’, ’12’ ); $list = preg_replace($patterns, … Read more
In your code, you are concatenating a string but you are (from a comment) using a function that echos information– _e(). You can’t do that. You are printing the content wherever that array is constructed, which is not what you want. Use __() instead.