fix for #557
This commit is contained in:
parent
f861955d80
commit
3a13657087
1 changed files with 8 additions and 1 deletions
|
|
@ -12,6 +12,11 @@ module SocketsHelper
|
||||||
def action_hash(uid, object, opts={})
|
def action_hash(uid, object, opts={})
|
||||||
begin
|
begin
|
||||||
user = User.find_by_id uid
|
user = User.find_by_id uid
|
||||||
|
unless user.nil?
|
||||||
|
old_locale = I18n.locale
|
||||||
|
I18n.locale = user.language.to_s
|
||||||
|
end
|
||||||
|
|
||||||
if object.is_a? StatusMessage
|
if object.is_a? StatusMessage
|
||||||
post_hash = {:post => object,
|
post_hash = {:post => object,
|
||||||
:person => object.person,
|
:person => object.person,
|
||||||
|
|
@ -60,6 +65,8 @@ module SocketsHelper
|
||||||
|
|
||||||
action_hash[:mine?] = object.person && (object.person.owner.id == uid) if object.respond_to?(:person)
|
action_hash[:mine?] = object.person && (object.person.owner.id == uid) if object.respond_to?(:person)
|
||||||
|
|
||||||
|
I18n.locale = old_locale unless user.nil?
|
||||||
|
|
||||||
action_hash.to_json
|
action_hash.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue