Ruby on Rails Friday, August 25, 2017



On Friday, August 25, 2017 at 10:30:03 AM UTC-4, Hassan Schroeder wrote:
On Fri, Aug 25, 2017 at 3:13 AM, fugee ohu <fuge...@gmail.com> wrote:

> The rails docs say i can use rb or yml but they don't say what the syntax
> for rb should be They do say rb is preferable

What doc says that? Certainly not this one:

  http://guides.rubyonrails.org/i18n.html

which also includes an example of using Ruby rather than YAML

  http://guides.rubyonrails.org/i18n.html#how-to-store-your-custom-translations

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote


http://guides.rubyonrails.org/i18n.html:

You may use YAML (.yml) or plain Ruby (.rb) files for storing your translations in SimpleStore. YAML is the preferred option among Rails developers. However, it has one big disadvantage. YAML is very sensitive to whitespace and special characters, so the application may not load your dictionary properly. Ruby files will crash your application on first request, 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 a Ruby file.)

If your translations are stored in YAML files, certain keys must be escaped. They are:

  • true, on, yes
  • false, off, no
 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/15ddbae3-28ca-48c0-9811-513d4862cca6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment