Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8956717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:50:42+00:00 2026-06-15T14:50:42+00:00

I need to set up two languages for a single form using internationalization. This

  • 0

I need to set up two languages for a single form using internationalization.

This is the proposed form page

<%= semantic_form_for @detail do |f| %>
    <%= f.inputs do %>
    <%= f.input :name %>
    <%= f.input :dob  %> 
    <%= f.input :gender, :as => :radio, :label => "Gender", :collection => [["Male", 'male'], ["Female", 'female']] %>  
  <% end %>
  <%= f.actions do %>
    <%= f.action :submit, :as => :input %>
  <% end %>
<% end %>

This is wk.yml file

wk: 
formtastic:
    labels:
      detail:
        dob: "Data of birtha"
        name: "Youre Nama"
        gender: "Gendera""

This is en.yml file

en: 
  formtastic:
    labels:
      detail:
        dob: "Date of Birth"
        name: "Your Name"
        gender: "gender"

I have added Formtastic::SemanticFormBuilder.i18n_lookups_by_default = true in formtastic.rb initializer.

I was successful in using en.yml.

I need to switch from ‘en’ to ‘wk’ and vise-verse.

How to achieve it via drop down box?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:50:43+00:00Added an answer on June 15, 2026 at 2:50 pm

    That’s not something related to formstatic, but rather to your rails code.

    All you have to do in order to switch to wk is

    http://guides.rubyonrails.org/i18n.html

    I18n.locale = :wk
    

    In order to let your client to choose his language for the website, probably a good place to start is on this link: http://guides.rubyonrails.org/i18n.html

    If all you want is to update the form (and not the rest of the website) in different languages on a user action, like selecting the language from a select box, you can use an ajax listener on the select box, that could require something like “http://www.yourwebsite.com/:locale/form/new” which will answer with an ajax action and will replace your form with the selected language (so on :locale you will pass the value of your select box for the language).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to set up two machines later today for a domo of a
I've got a layout with two editexts. I need to set the second one
While googling I found two different sets of headers that need to be set
I have a WordPress site in two languages (Hebrew and English) and I need
(I'm using VB6 but I imagine this comes up in most other languages.) I've
I have two languages set in my windows settings - Czech (default) and English
Need set zoom for camera preview...
I need set a cultureinfo different of others in a currency field. Metadata: [Display(ResourceType
I need Set collection, where its items will be identified by items class. Something
Need to set some attributes of button. For example Checked. I guess it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.