1
votes

I would like to know how to give different sitename for different languages. When I tried to change spree.rb

 Spree.config do |config|
     Example:
     Uncomment to override the default site name.
    if I18n.locale == :ar
    config.site_name = "الأربعاء"
    else
    config.site_name = "Spree Demo Site"
    end

end

It gives an error on console invalid multibyte char (US-ASCII) (SyntaxError) invalid multibyte char (US-ASCII) syntax error, unexpected $end, expe cting keyword_end config.site_name = "الأربعاء"

and admin interface has only one sitename facility

And if i give sitename replacement in ar.yml file it doesn't change with change in language

2

2 Answers

2
votes

Here is what I did and got success

<% if I18n.locale == :ar %>
<title> تجريبي |<%= title %></title>
 <html lang="ar" dir="rtl">
<% else %>
<title>demo |<%= title %> </title>

<% end %>
0
votes

I would suggest to use the i18n gem and to define your translations in app/config/locales/ar.yml file , similar to this RailsCast.