How about:
en:
job_categories:
undergraduate: Undergraduate student
graduate: Graduate student
predoctoral: Pre-doctoral student
postdoctoral: Postdoctoral student
associate_prof: Asociate professor
assistent_prof: Assistant professor
research_prof: Research professor
technician: Technician
And in your model:
class Job < ActiveRecord::Base
def translated_job_category
I18n.t(job_category, :scope => :job_categories)
end
end
In your helper:
module JobsHelper
def job_categories
I18n.t(:job_categories).map { |key, value| [ value, key ] }
end
end
And in your view:
<%= f.select :job_category, job_categories %>
The helper method creates an array that the select-helper understands.
It saves shortened keys ("undergraduate", "graduate", etc) in the
database, as some sort of enumerable. Be sure to keep those the same
in all languages.
When you want to show which job category an object has, you can do
@job.translated_job_category to get the translated value back.
I hope this helps,
Iain
2010/2/22 Andrés gutiérrez <andres...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "rails-i18n" group.
> To post to this group, send email to rails...@googlegroups.com.
> To unsubscribe from this group, send email to
> rails-i18n+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rails-i18n?hl=en.
>
def job_categories
I18n.t(:job_categories).map { |key, value| [ value, key.to_s ] }
end
Regards,
KK
2010/2/22 Andrés gutiérrez <andres...@gmail.com>: