Month of articles publication date not properly translated

Homepage Forums Free Support Forum BoldR Lite BoldR Lite Bug Reports Month of articles publication date not properly translated

Month of articles publication date not properly translated

This topic contains 2 replies, has 2 voices, and was last updated by  aurelrobert 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #20682
    Month of articles publication date not properly translated

    aurelrobert
    Participant

    Hello,

    I am not able to display publication dates in french: the month is displayed as the 3 first characters of the month in english.
    I have fixed the issue by adding some code to map english months to french months but I have to do the same fix each time I am upgrading the theme.

    Do you have an option to fix this issue permanently?

    thanks
    regards

    #20687
    Reply to: Month of articles publication date not properly translated

    iceable
    Keymaster
    Support
    Happy with my help?
    Buy me a beer!

    Hello,

    Thanks for reporting this issue. I just reviewed this portion of the code and found that the month part of post dates was indeed missing internationalisation support.

    This will be fixed to the next update (1.2.13) so you will not have this issue anymore when updating.

    For the record, the month part of post dates is currently rendered with this code in both index.php and single.php:

    ?><span class="month"><?php the_time('M'); ?></span><?php

    This only returns the month in a 3-letters formats, in english.

    I will update this will the following code, which will automatically display the month as 3 letters in the current language of the website, as defined in Settings > General > Site Language (this will work in every language supported by WordPress, with no mapping necessary!):

    ?><span class="month"><?php echo date_i18n( 'M', strtotime( get_the_time('Y-m-d') ) ); ?></span><?php

    Code reference: https://codex.wordpress.org/Function_Reference/date_i18n


    On an unrelated note to answer your “I have to do the same fix each time I am upgrading the theme.” concern:
    Any change you make directly in any of the theme’s file will be overwritten during updates (updates in WordPress actually delete all files and replace them by unzipping the new version’s package).
    This is why you should not edit files directly but use a child theme instead when you need to make changes or customizations: files in a child theme effectively override files from the parent theme, but are not affected by updates.

    #20744
    Reply to: Month of articles publication date not properly translated

    aurelrobert
    Participant

    Hello,

    I have tried replacing the code by the one you have provided but it does not seem to work, the month is still in english.

    Thank you for the information regarding the child themes

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.


PayPal Verified
Secured by PayPal
Secure Credit Card payments powered by Stripe
SiteLock