Translate "when" statement