The Rails Internationalization (I18n) API
This guide will walk you through the I18n API and contains a tutorial how to internationalize a Rails application from the start.
Related cards:
Guide to localizing a Rails application
Localizing a non-trivial application can be a huge undertaking. This card will give you an overview over the many components that are affected.
When you are asked to give an estimate for the effort involved, go through the list below and check wh...
Customizing Rails error messages for models and attributes
Rails has generic error messages you can define in your locale .yml
files. You may override those application-wide error messages using model or attribute scope like this:
en:
activerecord:
errors:
messages:
invalid: ...
svenfuchs's rails-i18n at master - GitHub
Central point to collect locale data for use in Ruby on Rails.
Rails: Example on how to extract domain independent code from the `app/models` folder to the `lib/` folder
This cards describes an example with a Github Client on how to keep your Rails application more maintainable by extracting domain independent code from the app/models
folder to the lib/
folder. The approach is applicable to arbitrary scenarios...
Security issues with hash conditions in Rails 2 and Rails 3
Find conditions for scopes can be given either as an array (:conditions => ['state = ?', 'draft']
) or a hash (:conditions => { 'state' => 'draft' }
). The later is nicer to read, but has horrible security implications in some versions of Ru...
Introducing RMM, the Rails Maturity Model - Ruby on Rails meets the business world | Google Groups
A couple of Railsconfs ago, Courtenay and I did indeed discuss
Rails: Rest API post-mortem analysis
This is a personal post-mortem analysis of a project that was mainly build to provide a REST API to mobile clients.
For the API backend we used the following components:
- Active Model Serializer (AMS) to serializer our Active Record models to J...
Rails I18n fallback locales
When you need to create a locale for a language variant (like Austrian for German), you probably don't want to duplicate your entire de.yml
file only to change a few minor exceptions for our Austrian friends.
Luckily, the I18n gem used by Rails...
Should I test for translated strings?
I brought up the question whether tests should call the translation API when checking for the presence of a string.
Managing Rails locale files with i18n-tasks
When internationalizing your Rails app, you'll be replacing strings like 'Please enter your name'
with t('.name_prompt')
. You will be adding keys to your config/locales/*.yml
files over and over again. Not to miss any key and place each at t...