WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Unable to translate date format (9 posts)

  1. Arnoud
    Member
    Posted 1 year ago #

    In my Twenty Twelve based theme functions.php the following code displays the date/time and category in the following way:

    $utility_text = __( 'This entry was posted in %1$s on %3$s.', 'twentytwelve' );

    In English it displays fine:
    Wednesday August 24th, 2011

    However in Dutch it shows:
    woensdag augustus 24th, 2011
    It should read:
    woensdag 24 augustus 2011

    I'm using the Qtranslate plugin, but the settings there are setup accordingly. (It works in an older WordPress default theme)

    Does anyone know how I can fix this?

  2. W.P. Ginfo
    Member
    Posted 1 year ago #

    Hi Arnoud,
    In the TwentyTwelve dashboard, choose instellingen > algemeen > datumnotatie and choose the top option.

    Should you have an English / US version of WP:
    Dashboard > General settings > Date format >custom: l j F Y
    You could also try: l d-m-Y [lowercase 'L' / kleine 'L']

    By the way there is a dutch version of wordpress available.
    Try: http://nl.wordpress.org

  3. Arnoud
    Member
    Posted 1 year ago #

    Thanks, but that does not have the desired effect.
    It doesn't change the way the date is displayed. I suspect due to the Qtranslate plugin.

    I know there is a Dutch version of WordPress, I however am working with a dual language website. I need/use both languages. :)

  4. W.P. Ginfo
    Member
    Posted 1 year ago #

    Hi Arnoud,

    Perhaps it's a good idea to temporarily deactivate the plugins.
    Then check if the date format can be set.
    If this is the case, a plugin is the culprit.
    Then - one at a time - reactivate the plugins, checking if the problem reoccurs.

  5. Arnoud
    Member
    Posted 1 year ago #

    Thanks again for your reply.
    It is defenitly not a plugin issue, when I apply the older (kurbick template) I currently use on my site, it works fine.

    Coding is there in "single.php", that isn't used anymore in the TwentyTwelve theme.

    Single.php:
    <?php _e('<!--:nl-->Dit verslag is geplaatst op <!--:--><!--:en-->This entry was posted on<!--:-->')?> <?php echo date_i18n( 'l d F Y', strtotime( $post->post_date ) );?>

    Therefore I conclude that it must be a coding issue.
    I am however not sure how I can implement the line from single.php from my old theme into functions.php in the twentytwelve theme.

    Any thoughts on that?

  6. W.P. Ginfo
    Member
    Posted 1 year ago #

    Hi Arnoud,

    I've tried various settings in the twentytwelve theme. They all work well and display the date as I set it. So there must be 'something' that messes things up. So let me start off with a few silly questions:

    You said you're posting in both Englisch an Dutch.
    How did you set this up?
    E.g: Do dutch and English entries sit side by side? / in different subdomains? Do they each have a separate WP-install?

  7. Arnoud
    Member
    Posted 1 year ago #

    Thanks again for your reply:

    The Dutch & English is arranged for in one single post.
    The Qtranslate plugin takes care of that.
    When using the visual editor the Qtranslate plugin creates two tabs, one for English and one for Dutch.
    When not using the visual edtior tags can be used [:nl]Dutch[:en]English.
    Each post has only 1 ID in the database, contaning both the English and Dutch text. Also everything is contained in one and the same WordPress install on the same domain: http://www.arnoudraeven.nl (for the old site with kurbick theme). New site is in development in a secured area to prevent Google from indexing it.

    When a visitor browses to my website, based on the browser language either Dutch of English is presented. A used also has the option to manually select the language by clicking the flag.

  8. Arnoud
    Member
    Posted 1 year ago #

    Found the solution.

    In the Qtranslate Plugin settings:
    I changed the Dutch Language display options.
    The option for Date Format was:
    %A %B %e%q, %Y

    I cleared that and the issue was resolved! :)
    Now the date is displayed correctly in both languages.

    Strangly when this option is cleared date/time no longer is displayed correct when used in combination with the older kurbick theme. Must be an error in a PHP file there or something. :)

    Thanks again for the help!

  9. W.P. Ginfo
    Member
    Posted 1 year ago #

    you're welcome

Topic Closed

This topic has been closed to new replies.

About this Topic