diff options
author | Karel Minarik <karmi@karmi.cz> | 2009-02-02 11:57:31 +0100 |
---|---|---|
committer | Karel Minarik <karmi@karmi.cz> | 2009-02-02 11:57:31 +0100 |
commit | 8cdfca1b5dc54fbdafd2ad5a3e9e83b6083d8b36 (patch) | |
tree | abc61acec9552a95492856a1a942a83b988b7b81 /railties/doc/guides/source | |
parent | d96483dedff67c817de97c32cc9290a6b581a6e4 (diff) | |
download | rails-8cdfca1b5dc54fbdafd2ad5a3e9e83b6083d8b36.tar.gz rails-8cdfca1b5dc54fbdafd2ad5a3e9e83b6083d8b36.tar.bz2 rails-8cdfca1b5dc54fbdafd2ad5a3e9e83b6083d8b36.zip |
I18n guide: Add warning about YAML sensitivity when storing translation in YAML files, add info about better debugging when using Ruby files for translations: they crash your app during start-up. {i18n}
Cf. http://groups.google.com/group/rails-i18n/browse_thread/thread/28f7aff5b8bd8c4d/002edd9466500302?hl=en and many many more other people wondering what's wrong with their YAML.
Diffstat (limited to 'railties/doc/guides/source')
-rw-r--r-- | railties/doc/guides/source/i18n.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/railties/doc/guides/source/i18n.txt b/railties/doc/guides/source/i18n.txt index 035cf66808..90072d7087 100644 --- a/railties/doc/guides/source/i18n.txt +++ b/railties/doc/guides/source/i18n.txt @@ -403,6 +403,8 @@ image:images/i18n/demo_translated_pirate.png[rails i18n demo translated to pirat NOTE: You need to restart the server when you add new locale files. +You may use YAML (+.yml+) or plain Ruby (+.rb+) files for storing your translations in SimpleStore. YAML is the preffered option among Rails developers, has one big disadvantage, though. YAML is very sensitive to whitespace and special characters, so the application may not load your dictionary properly. Ruby files will crash your application during start-up time, so you may easily find what's wrong. (If you encounter any "weird issues" with YAML dictionaries, try putting the relevant portion of your dictionary into Ruby file.) + === Adding Date/Time formats OK! Now let's add a timestamp to the view, so we can demo the *date/time localization* feature as well. To localize the time format you pass the Time object to +I18n.l+ or (preferably) use Rails' +#l+ helper. You can pick a format by passing the +:format+ option -- by default the +:default+ format is used. |