WordPress.org

Forums

qTranslate
qTranslate: How to translate Dates? (2 posts)

  1. MathiasAeschlimann
    Member
    Posted 1 year ago #

    I wanna display a date in a language dependant format. So I wrapped the the format string in an __() function

    <?php  echo strftime( __("%B %d, %Y"), strtotime($post->post_date) );?>

    and added a translation in the po/mo file.

    msgid "%B %d, %Y"
    msgstr "%d. %B %Y"

    But it always uses the "%B %d, %Y"-Format, never "%d. %B %Y"`.

    How can I translate dates?

    https://wordpress.org/plugins/qtranslate/

  2. szaleq
    Member
    Posted 1 year ago #

    Hello,

    The example you wrote about should work. Maybe you just need to use some textdomain? (It depends on which po/mo files you modified, if these were a template files, you should call __("%B %d, %Y", 'template-textdomain-name'))

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic