Poedit ASCII errors ( WordPress )
in poeditor go to file->preferences->extractors->javascript->edit and change language JavaScript to php
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.
Google Language Translator – Manage Translation
This is more of PHP implementation detail. If you want a precise match you can do something like: if ( isset( $words[$translated] ) ) return $words[$translated]; return $translated; PS you might want to declare $words as static, so that array is reused and not continuously re-created on each function call (which would be a lot … Read more