4

I'm writing an application that will be accessed by users of different languages.
As I understand, the standard way to localize Rails app is to use gems i18n (localize static text) and globalize (localize db field values). These gems work fine and let me display fields in different languages on a same view using Globalize.with_locale(...) { ... }.

However, what I need to do is to input values in different languages on a same view. How can I do that?

UPDATE

More specifically - I need to have a number of <inputs> inside <form> which (after the form is submitted) save their values into different locales.

                   ____________________________
Description (en): |             Ruby           |
                  |____________________________|

                   ____________________________
Description (de): |             Rubin          |
                  |____________________________|

etc

Chris Salzberg
  • 27,099
  • 4
  • 75
  • 82
xaxa
  • 1,057
  • 1
  • 24
  • 53
  • What do you mean with "save their values into different locales"? Create separate records in a database with a column indicating which locale this is for? – Danny Mar 17 '14 at 13:54
  • I mean that user enters field values in different languages and these values can be used afterward. `globalize` creates a separate table to store field values in different languages (e.g. `posts_tranlsations`). If this cannot be done with `globalize` then another gem will be fine – xaxa Mar 17 '14 at 13:57

1 Answers1

0

If all you need to do is change the label of the input, this is easily solved like so:

=form.label :model_attribute, t('translation.in.your.locale.file')
nicohvi
  • 2,270
  • 2
  • 28
  • 42
  • you've missed the point of the question. He's trying to (for example) submit an English and a Spanish value for the same field. – sevenseacat Mar 17 '14 at 13:52