How to Get Modified Date for Specific Language?

In multilingual sites, the content files for different languages will have different modified dates. How do I get the modified date for a page, for a specific language?

echo $page->modified(); // returns the mod date of current page

echo $page->content('de')->modified();      // gives error
echo $page->translation('de')->modified();  // gives error

Is there an easy method I’m overlooking?..

I don’t think there’s a method for that (but I can be wrong).

Can you test with code below? (untested):

echo F::modified($page->contentFile('de'));

If this works, you could create your own page method. And it might be interesting to add an issue on github and ask if the core team sees value in this and adds it to core.

Thank you, @bvdputte - it worked. I’ve added an issue to the ideas repo, too.

@texnixe, it wasn’t clear to me that the first argument of F::modified() was supposed to be a file path - should that be specified in the docs?

@luxlogica What did you think was expected from the docs?

It is in the docs as “string $file” (that’s where I got it from):

@texnixe Maybe I’m just bad at ‘reading between the lines’, but just having the argument name as $file doesn’t seem to tell me explicitly that what is expected here is a filepath. Could it be a file url? Mime type?..