I have a site that renders content in both English & Spanish. I'm using the {{ last_segment }} global variable to hook into a custom plugin to display a page title (title is not coming from a Statamic content file).

/en/result/18 works as expected and the item title is displayed when passing the {{ last_segment }} to my plugin /es/result/18 displays nothing. When I output the {{ last_segment }} or {{ segment_x }} variables I get no result on the layout even though English & Spanish are using the same layout & _layout is specified in the front matter of both content templates.

I'm scratching my head on this one as I can't see a reason why it would work in one language & and not another.