I'm looking at a Sinatra app for a CAS server for SSO. I'm unsure what the underscore and parentheses mean in the string assignment. Here's a sample line:
@message = {:type => 'confirmation', :message => _("You have successfully logged in.")}
But it's also used in ERB:
<%= _("Username") %>
_ is the name of the translation method of GetText.
So _ basically means: Take the following string and use it as a key to find a localized/translated version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With