Skip to content

Instantly share code, notes, and snippets.

@clemens
Created April 6, 2009 13:32
Show Gist options
  • Save clemens/90757 to your computer and use it in GitHub Desktop.
Save clemens/90757 to your computer and use it in GitHub Desktop.
{
:en => {
:salutation => {
:gender => {
:male => "Mr",
:female => "Mrs",
:female_unmarried => "Ms"
}
:full => lambda { |attributes|
gender_salutation = I18n.t(:"salutation.#{attributes[:gender]}")
gender_salutation = I18n.t(:'salutation.female_unmarried') if attributes[:gender] == 'female' && !attributes[:married]
attributes[:prefix] ||= gender_salutation
"Dear #{attributes[:prefix]} #{attributes[:last_name]}"
}
}
},
:de => {
:salutation => {
:gender => {
:male => "Sehr geehrter Herr", # Dear Mr
:female => "Sehr geehrte Frau" # Dear Mrs
},
:full => lambda { |attributes|
gender_salutation = I18n.t(:"salutation.#{attributes[:gender]}")
prefix = [gender_salutation, attributes[:prefix]].compact.join(' ')
"#{prefix} #{attributes[:last_name]}"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment