WordPress.org

Forums

Celestial - Lite
[resolved] Date format will not be translated - and the solution (4 posts)

  1. joru
    Member
    Posted 2 years ago #

    First of all: Thanks for the nice theme

    I think I've found a bug during my translation process. The date format in blog pages is not prepared for translation. In my case I want to change the default 'F j, Y' to 'j. M Y'. The string is in the .pot file but translating the string does not change anything.
    Looking in the source I relaized that the date format string is not prepared for translating.
    So I made the following changes:
    content.php, line 31
    old:
    <span><?php the_date('F j, Y, __('Date: ', 'celestial') ); ?></span>
    new:
    <span><?php the_date(__('F j, Y', 'celestial'), __('Date: ', 'celestial') ); ?></span>
    content-single.php, line 25
    old:
    <span><?php the_date('F j, Y', __('Date: ', 'celestial') ); ?></span>
    new:
    <span><?php the_date(__('F j, Y', 'celestial'), __('Date: ', 'celestial') ); ?></span>

    Maybe you can integrate that in further updates.
    Best
    Joerg

  2. StyledThemes
    Member
    Theme Author

    Posted 2 years ago #

    Thank you for that effort, I will apply that to my next update (which is coming up shortly). Thanks again Joerg.

  3. joru
    Member
    Posted 2 years ago #

    Found a third date format string
    content-single.php, line 52
    new:
    <?php the_modified_date( __('F j, Y', 'celestial'), __( '<span class="modified-date">Last Modified: </span> ', 'celestial') ); ?>
    Maybe there are some more

    There is also an error in the language file. In functions.php, line 576, you use the function
    _x( 'Comment', 'noun', 'celestial' )
    But the correspondent
    msgctxt "noun"
    in the language file is missing. Should be inserted after line 286 in celestial.pot. So that it looks like

    #: functions.php:573
    msgctxt "noun"
    msgid "Comment"
    msgstr ""

    Not sure if you use _x() somewhere else.

    Hope that helps.

  4. StyledThemes
    Member
    Theme Author

    Posted 2 years ago #

    I'm actually working on an update right now. There are a couple other locations with the date strong as well. Thanks for the update.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic