The $date variable used in the node.tpl.php of wetkit_omega theme outputs the date of the node, and thus shows the same value for all languages, even if only one of them has been updated.

I'll provide a patch to the preprocess function in order to make it output the date of the translated object.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

omar’s picture

Status: Active » Needs review
FileSize
969 bytes

Here's the patch.

sylus’s picture

Status: Needs review » Closed (won't fix)

I think this is the wrong way to approach this. Since the date variable is being passed to format_date, you should be able to adjust the french view by going to the regional settings in Drupal and specifying an alternate date display for the french side. Of course this will only work for default cases and not exceptions like discussed here:

#2338993

I think this is a problem that core + i18n has solved if not correct please re-open but would like to address the regional settings solution first.

omar’s picture

Status: Closed (won't fix) » Active

I'm re-opening as I think that there may be a misunderstanding. The issue is not related to the *format* of the date, but rather *which* date is being displayed, the node's modification date, or the translation's modification date. i.e. the date/time that one language version was created/updated will be different than for other languages.

spotzero’s picture

Status: Active » Needs work

This patch makes assumptions about the specific translation configuration for all node types on the site, which are not enforced and therefore may not be correct.

This patch should check to verify that the translation changed time is available, and only use if its set, if not, it should fall back to the node changed time.

Something like this:

global $language;
$variables['date'] = isset($node->translations->data[$language->language]['changed']) ?
  format_date($node->translations->data[$language->language]['changed'], 'custom', 'Y-m-d') :
  format_date($node->changed, 'custom', 'Y-m-d');
omar’s picture

Thanks @spotzero ! This is good feedback and with code to boot... sweet!

I tested the code with a node that has translations and one without. It seems to work as expected. I rolled a patch with your code.

omar’s picture

Status: Needs work » Patch (to be ported)
omar’s picture

Status: Patch (to be ported) » Needs review
sylus’s picture

Status: Needs review » Fixed

Committed and attributed! Thanks guys!

  • sylus committed 18b9269 on authored by omar
    Update WetKit Omega for Issue #2344473 by omar: Fixed Make "Modified...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.