I heard someone say hi to me when I was walking in town the other day. I turned around and it was you.
I heard someone call my name when I was downtown a few days ago. I didn't know who it was, but then I turned around and realized it was you.
ーI heard someone say hi to me when I was walking in town the other day. I turned around and it was you.
「この前、街を歩いていたら誰かから声を掛けられて、振り返ったらあなただった。」
someone say hi to me で「誰かから声を掛けられる」
turn around で「振り返る」
ーI heard someone call my name when I was downtown a few days ago. I didn't know who it was, but then I turned around and realized it was you.
「数日前、ダウンタウンで名前を呼ばれて、誰かわからなかったんだけど、振り向いたらあなただと気がついた。」
someone call my name で「誰かが私の名前を呼ぶ」=「声を掛ける」と言えます。
realize で「…に気づく」
ご参考まで!