add dialect support

If you use symbols then code climate will tell us we have a problem.
Because of how symbols are handled in ruby (ie: not garbage collected) it's
possible to consume all the memory with symbols and stop the app.

So converting user input strings (in this case locale identifiers) into
symbols creates a vulnerability, if done unchecked.

You cannot avoid doing this unless you convert all of the locale symbols
into strings, and validate that the input locale string is included in the
valid locales before converting it into a symbol. But I'm ok with doing
that, if you wanna go that way.




On Wed, Jul 30, 2014 at 7:30 PM, mix irving <notifications@github.com>
wrote:

> In app/helpers/locales_helper.rb:
>
> > @@ -0,0 +1,112 @@
> > +require 'http_accept_language'
> > +
>
> @robguthrie <https://github.com/robguthrie> can you look over this file
> please.
> I've shifted everything towards using symbols (rather than strings).
> Also decided to use dashes in locales as this is what browsers speak in (
> :'pt-BR' vs. :pt_BR )
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/loomio/loomio/pull/1571/files#r15569570>.
>