Ruby on Rails I18n - Internationalization

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • I18n.t("key")
  • I18n.translate("key") # equivalent to I18n.t("key")
  • I18n.t("key", count: 4)
  • I18n.t("key", param1: "Something", param2: "Else")
  • I18n.t("doesnt_exist", default: "key") # specify a default if the key is missing
  • I18n.locale #=> :en
  • I18n.locale = :en
  • I18n.default_locale #=> :en
  • I18n.default_locale = :en
  • t(".key") # same as I18n.t("key"), but scoped to the action/template it's called from


Got any Ruby on Rails Question?