Browse files

I18n guide: Add warning about YAML sensitivity when storing translati…

…on in YAML files, add info about better debugging when using Ruby files for translations: they crash your app during start-up. {i18n}

Cf. and many many more other people wondering what's wrong with their YAML.
  • Loading branch information...
1 parent d96483d commit 8cdfca1b5dc54fbdafd2ad5a3e9e83b6083d8b36 @karmi karmi committed Feb 2, 2009
Showing with 2 additions and 0 deletions.
  1. +2 −0 railties/doc/guides/source/i18n.txt
2 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.

0 comments on commit 8cdfca1

Please sign in to comment.