Search code examples
middleman

Middleman - how do I access Locale / Localization / lang variable


Hi wanted to know within templates if there is an easy way to access the lang string for the current translation.


Solution

  • You can access it with I18n.locale.

    So within ERB ...

    <%= I18n.locale %>

    ... and within HAML:

    = I18n.locale