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

  • Home
  • SEARCH
  • 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 7680269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:04:36+00:00 2026-05-31T18:04:36+00:00

Using Rails 3.1.3 with Ruby 1.9.3p0. I’ve discovered that by default, Rails does not

  • 0

Using Rails 3.1.3 with Ruby 1.9.3p0.

I’ve discovered that by default, Rails does not use sentence case for form buttons. For example, instead of an “Update user” button, it generates an “Update User” button.

The button names come from the ActionView locale file. Is there a way to create a default that downcases the model name? This is not covered in the Ruby on Rails Guides i18n section on Interpolation so maybe it is not possible. The following doesn’t work:

en:
  helpers:
    submit:
      update: 'Update %{model}.downcase'

In general, I’d be glad to find a reference for the syntax of the locale YAML files. The i18n guide covers some of the syntax, but it would be helpful to find documentation on all the exclamation points, various date/time formats, etc. Or maybe I should be using a Ruby Hash instead of a YAML file for this purpose?

  • 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-05-31T18:04:37+00:00Added an answer on May 31, 2026 at 6:04 pm

    After further research, I’ve concluded that this kind of operation on interpolated values is not possible, at least using a YAML locale file.

    YAML is documented here and doesn’t support string operations:
    http://www.yaml.org/spec/1.2/spec.html

    The main page on Ruby localization is here:
    http://ruby-i18n.org/wiki

    From there, we find the code for the default I18n gem and drill down to the interpolation code. It uses sprintf to do the interpolation:
    https://github.com/svenfuchs/i18n/blob/master/lib/i18n/interpolate/ruby.rb

    That code is “heavily based on Masao Mutoh’s gettext String interpolation extension”:
    http://github.com/mutoh/gettext/blob/f6566738b981fe0952548c421042ad1e0cdfb31e/lib/gettext/core_ext/string.rb

    That extension has an example of formatting numbers:

    For strings.
    "%{firstname}, %{familyname}" % {:firstname => "Masao", :familyname => "Mutoh"}
    
    With field type to specify format such as d(decimal), f(float),...
    "%<age>d, %<weight>.1f" % {:age => 10, :weight => 43.4}
    

    The extension refers to the [Ruby] “Kernel::sprintf for details of the format string”:
    http://www.ruby-doc.org/core-1.9.2/Kernel.html#method-i-sprintf

    In that doc on sprintf, there are lots of ways to format numbers, but no operations for changing the case of strings.

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

Sidebar

Related Questions

says if i develop a Ruby on Rails application using Rails 2.3.2, will that
I'm using ruby on rails 2.3.2 and also using the acts_as_taggable_on puglin. That generated
Using Rails 3.2 and ruby 1.9.3p0 I am trying out the gem delayed_job. I
I am using bootstrap-sass, formtastic-bootstrap, rails 3.2, and ruby 1.9.3p0 on a new project.
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
I've installed ruby on rails using gem install rails and got the message that
So I installed Ruby On Rails using the Windows Installer. Now the startup guides
using Ruby on Rails 2.3.2, since I already created Scaffold for Story, so instead
I am using Ruby on Rails. I want to create a filter field on
I am using ruby on rails with a MySQL backend. I have a table

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.