[spree-user] How to change default language?

1,209 views
Skip to first unread message

Style)r

unread,
May 2, 2010, 4:49:28 PM5/2/10
to Spree
Hi, help me please)

How to change default language? I try to change value
"config.i18n.default_locale" in environment.rb, but language doesn't
change.

Thanks

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To post to this group, send email to spree...@googlegroups.com.
To unsubscribe from this group, send email to spree-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.

Jones Lee

unread,
May 2, 2010, 8:15:34 PM5/2/10
to spree...@googlegroups.com
Are u using 0.10.2 gem? or upstream?

Rempargo

unread,
May 4, 2010, 1:51:26 PM5/4/10
to Spree
You could try changing the following value:

preference :default_locale, :string, :default => 'en-US'


in the file:

\vendor\extensions\site\app\models\app_configuration.rb

Davor Ocelic

unread,
May 4, 2010, 2:29:19 PM5/4/10
to spree...@googlegroups.com
On Tue, 4 May 2010 10:51:26 -0700 (PDT)
Rempargo <paul.ve...@gmail.com> wrote:

> You could try changing the following value:
>
> preference :default_locale, :string, :default => 'en-US'

Right.

And on a related note, in Git head spree, you'll just want to
use 'us' instead of 'en-US'. (A change made for Rails compatibility).

-doc

Roman Smirnov

unread,
May 6, 2010, 3:32:18 AM5/6/10
to Spree
> You could try changing the following value:
>
> preference :default_locale, :string, :default => 'en-US'
> in the file:
>
> \vendor\extensions\site\app\models\app_configuration.rb

Wrong.
Right way - set this preference in your custom initializer, for
example:

if Spree::Config.instance
Spree::Config.set(:default_locale => 'ru-RU')
end

x@ES

unread,
May 28, 2010, 2:07:51 AM5/28/10
to Spree
Yes, it is wrong in common case. But in manual (http://
spreecommerce.com/documentation/i18n.html) writen about changes in
model:

"1.3 Setting the Default Locale

The default locale for Spree is en-US. This can be changed by editing
the :default_locale setting in the AppConfiguration model. In the
future we hope to add a localization settings page that will allow you
to set the default locale from the admin screen [#35]."

SPREE_GEM_VERSION = '0.10.2'

Changes in model, placed (by hand from gem) into site extenstion works
for me.

On 6 май, 11:32, Roman Smirnov <pom...@gmail.com> wrote:
> > You could try changing the following value:
>
> >   preference :default_locale, :string, :default => 'en-US'
> > in the file:
>
> > \vendor\extensions\site\app\models\app_configuration.rb
>
Reply all
Reply to author
Forward
0 new messages