Moving internalization from javascript to ruby for event conflicts