This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 6 replies, has 2 voices.

Last updated by Wolfgang Männel 1 year, 3 months ago.

Assigned support staff: Vincenzo.

Author Posts
April 2, 2019 at 9:03 am #3514993

Wolfgang Männel

Tell us what you are trying to do? I am trying to have the right date format in both English and German.

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site? hidden link

April 2, 2019 at 10:00 am #3515717

Vincenzo
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello, thank you for contacting WPML Support!

1. You can translate the Date format by following these steps:
- Go to WPML -> String Translation
- Look for the string "F j, Y"
- If you find it, check that its German translation is not empty.

2. If that does not work, try these steps:

- Go to WPML -> String Translation
- Scroll to the bottom of the page
- Click on "Translate texts in admin screens »".
- Search for the string "date_format" (usually the second one)
- Select it
- Scroll to the bottom of the page
- Press the Apply button
- Back to WPML -> String Translation
- Select the domain "admin_texts_date_format"
- Translate the string with the name "date_format"

3. You may also use this solution:
- https://wpml.org/forums/topic/how-to-translate-the-date-format
- https://wpml.org/forums/topic/how-to-translate-the-date-format/#post-3130556

Please let me know if this solves the issue or if you need further details.

Thank you

April 2, 2019 at 12:43 pm #3517225

Wolfgang Männel

Hi Vincenzo, I have done all this but it still doesn't work. Any other ideas? Thanks!

April 2, 2019 at 3:24 pm #3518707

Vincenzo
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hi, it is possible that the language format is hardcoded in the theme.

To further debug the problem I’d like to replicate your site locally.

I would need a site snapshot if possible.
We usually recommend the free Plugin “Duplicator” for this purpose.

If you already know how Duplicator works
(https://wordpress.org/plugins/duplicator/),
please skip the following steps and just send me the archive file you downloaded.

★ Duplicator Instructions
hidden link
https://wpml.org/faq/provide-supporters-copy-site/

If the file is too large (more than 500M), please use the Duplicator file filters to remove the cache, the wp-uploads directory, the media, and the archive files.

Send me the link to the archive file (you probably want to use Google Drive, Dropbox, or similar services, as the snapshot file will be quite big)

Your next reply will be private, which means that only you and I will be able to see it and have access to it. You can paste the link to the file there. You can also share the credentials to your website. I will then download the file from the admin panel.
Once the problem is resolved I will delete the local site.

Please let me know if you need help creating the Duplicator package.

Thank you

April 3, 2019 at 2:05 pm #3526937

Vincenzo
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

thank you for the copy of the site.

As I thought, the issue is caused by the fact that the date format is hardcoded in the theme's code.

As a quick workaround, please follow these steps:
- Edit the following file:
/wp-content/themes/salient/includes/partials/single-post/post-header-no-img-regular.php
- Find this code. It is around line 74:

<span class="meta-date date updated rich-snippet-hidden"><?php echo get_the_modified_time( 'F jS, Y' ); ?></span>

Change it to:

<span class="meta-date date updated rich-snippet-hidden"><?php echo get_the_modified_time(__( 'F jS, Y' , 'salient' ) ); ?></span>

- Save the file
- Open the affected post page to register the string
- Go to WPML -> String Translation
- Find the new date format string (salient domain)
- Translate it
- Check the frontend

There are three other places where the date format is hardcoded:
- /wp-content/themes/salient/includes/partials/single-post/post-header-no-img-fullscreen.php line 70
- /wp-content/themes/salient/nectar/helpers/page-header.php lines 275 and 293

I suggest asking the theme support to fix all these lines because the next theme update will overwrite this patch.

Please let me know if this solves the issue or if you need further details.

Thank you

April 4, 2019 at 11:35 am #3534357

Wolfgang Männel

My issue is resolved now. Thank you!

April 25, 2019 at 9:38 am #3680627

Wolfgang Männel

Hello Vincenzo, following a Salient Theme update, this fix recipe doesn't seem to work anymore. Any tip what I should try? Thanks!