summaryrefslogtreecommitdiff
path: root/app/controllers/config_snom_controller.rb
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-07-31 08:50:24 +0200
committerPeter Kozak <spag@golwen.net>2013-07-31 08:50:24 +0200
commit9045b821f35a329bb13501942162697229dbda0c (patch)
treec067d285ffdccbb6302cc091d2727b3d911a4831 /app/controllers/config_snom_controller.rb
parent21dc1d9a7d5c7ab2de63b4b6de5bea1e01fba790 (diff)
set language code
Diffstat (limited to 'app/controllers/config_snom_controller.rb')
-rw-r--r--app/controllers/config_snom_controller.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/controllers/config_snom_controller.rb b/app/controllers/config_snom_controller.rb
index f669b8e..da2f8c0 100644
--- a/app/controllers/config_snom_controller.rb
+++ b/app/controllers/config_snom_controller.rb
@@ -1577,12 +1577,8 @@ AAAA'
if sip_account && !sip_account.language_code.blank?
I18n.locale = sip_account.language_code
@locale = sip_account.language_code
- elsif @phone.phoneable
- if @phone.phoneable_type == 'Tenant'
- I18n.locale = tenant.language.code
- elsif @phone.phoneable_type == 'User'
- I18n.locale = @phone.phoneable.language.code
- end
+ elsif @phone.phoneable && @phone.phoneable.respond_to?('language') && @phone.phoneable.language
+ I18n.locale = @phone.phoneable.language.code
end
end
end