Two-time Grand Slam champion Simona Halep announced her retirement after playing her final match in front of home fans at the Transylvania Open in Romania.