
i18n and date_select exception
Reported by YavorIvanov | February 10th, 2009 @ 01:10 PM
When migrating a current project from GetText to i18n the following exception was thrown when using the date_select helper:
can't convert Symbol into String
Example:
When in your application you have set the I18n.locale to something different than "en" and you have the following simple code in your view:
<%= date_select("user_info", "birthdate") %>
You'll get the can't convert Symbol into String for the date_select helper. The problem can be rescued by giving the date_select helper order like this:
<%= date_select("user_info", "birthdate", :order => [:day,:month,:year]) %>
or by doing order in the yml file usually located at config/locales/your_lang.yml like this
date:
formats:
default: ""
long: ""
short: ""
order: [ :day, :month, :year ]
Comments and changes to this ticket
-
2048 cupcakes October 8th, 2024 @ 11:29 AM
A gentle, engaging game. we become what we behold reduces stress in studying and working. Invite you to join and experience. Just have passion.
-
JohnasonXian December 16th, 2024 @ 02:51 PM
Huge thanks to the author for the great article! I just played the Sprunki Phase game at https://sprunkiphase.com/, and it was an amazing experience. It's a perfect fit for both beginners and experienced music creators!
-
lamhoang January 17th, 2025 @ 09:46 AM
great infomation tho, i need this right now
i tried it on sprunki pyramixed. Can you check it for me? -
elated.hyena.ygwg (at instantletter) January 21st, 2025 @ 09:53 AM
It's great that you've highlighted the issue with I18n locale affecting the date_select helper. One neat workaround I found was using a custom format to prevent errors. Speaking of custom challenges, have you checked out the bad parenting game? It’s a fun way to reflect on actual parenting decisions! By the way, using string keys instead of symbols for the locale can also resolve this issue.
-
doramasmp4 January 23rd, 2025 @ 03:36 PM
The
i18n
(internationalization) process involves preparing software to support multiple languages and regions, whiledate_select
is a common method used in web applications for selecting dates. An exception related todate_select
often arises when there are mismatches in date formats or missing locale settings, causing errors in rendering or handling date inputs.https://doramasmp4.dev/ -
sprunkimodss January 24th, 2025 @ 02:01 PM
sprunki mods Sprunki Mods are a revolutionary collection of add-ons that elevate the Sprunki experience. Each phase embodies a unique blend of immersive themes, dynamic soundscapes, and captivating visuals, offering endless opportunities for customization and creativity.
-
-
fiddlebops incredibox January 29th, 2025 @ 10:56 AM
I really enjoyed the insights in this article! If you're looking for more of the same musical mayhem, check out my site: incredibox fiddlebops .It's the same great FiddleBops experience, ready for you to explore all the sounds and rhythms!
-
Sarah Li February 17th, 2025 @ 08:40 AM
Thanks for your sharing! this is really helpful, I am always trying to escape road like this.
-
-
Sexyblond February 22nd, 2025 @ 01:50 PM
Discover https://www.hot-secret.com/ – a premier platform offering an exclusive selection of high-quality services with a strong focus on discretion and luxury. With a user-friendly design and regular updates, finding the best options is effortless. The website stands out for its professional presentation and meticulous attention to detail, ensuring a seamless and refined experience. If you value premium service and exclusivity, this platform is a must-visit. Explore top-tier offerings today!
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Internationalization API for Ruby.
This library is used in Ruby on Rails but also suited for use in other contexts.