In your app’s head (this usually is in application.html.erb).

<link rel="alternate" hreflang="<%= locale %>">

The variable locale is representing, the requests current value of I18n in Rails.