Cannot translate the post meta data (Date) in another language
-
I want to translate the post meta data (date) in chines language for example, September 13, 2017, should be translated as 2017年9月13. But my code gives it in English. Do you see any error? Please help.
Thank you in advance.
printf(__('<span class="posted-on"><a href="%1$s" title="%2$s" rel="bookmark"><i class="fa fa-clock-o"></i> %3$s</a></span>', 'colormag'), esc_url(get_permalink()), esc_attr(get_the_time()), $time_string ); -
Hi… can you leave a link to the Blog you’re having problems with? It’ll help us figure out if you’re in the right Forum.
-
Hi, I want to localize the post date/time. codex.
I tried to google out a lot but still unable to solve the issue. This is the code.
the function __() is not working.<?php $cur_cat = get_query_var('cat'); $check_cat_nodate = array(84,85,86,87,89); if (in_array($cur_cat, $check_cat_nodate)) { } else{ $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>'; if (get_the_time('U') !== get_the_modified_time('U')) { $time_string .= '<time class="updated" datetime="%3$s">%4$s</time>'; } $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()) ); printf(__('<span class="posted-on"><a href="%1$s" title="%2$s" rel="bookmark"><i class="fa fa-clock-o"></i> %3$s</a></span>', 'colormag'), esc_url(get_permalink()), esc_attr(get_the_time()), $time_string ); } ?>
- The topic ‘Cannot translate the post meta data (Date) in another language’ is closed to new replies.