diff --git a/app/assets/javascripts/channels/meeting_updates.js b/app/assets/javascripts/channels/meeting_updates.js index db39b476..7b8c7382 100644 --- a/app/assets/javascripts/channels/meeting_updates.js +++ b/app/assets/javascripts/channels/meeting_updates.js @@ -21,12 +21,12 @@ loopJoin(); } else { sessionStatusRefresh($('.meeting-url').val()); - showAlert($('.meeting-started-alert').html(), 4000); + showAlert(I18n.meeting_started, 4000); } } } else if (data.action === 'meeting_ended') { sessionStatusRefresh($('.meeting-url').val()); - showAlert($('.meeting-ended-alert').html(), 4000); + showAlert(I18n.meeting_ended, 4000); } } }); diff --git a/app/assets/javascripts/channels/recording_update.js b/app/assets/javascripts/channels/recording_update.js index 5650f310..ad75f6c7 100644 --- a/app/assets/javascripts/channels/recording_update.js +++ b/app/assets/javascripts/channels/recording_update.js @@ -14,12 +14,12 @@ rowData.published = data.published table.row("#"+data.record_id).data(rowData).draw(); - var publish = (data.published) ? 'publish' : 'unpublish'; - showAlert($('.recording-'+publish+'-alert').html(), 4000); + var published = (data.published) ? 'published' : 'unpublished'; + showAlert(I18n['recording_'+published], 4000); } else if (data.action === 'delete') { row.remove().draw(); - showAlert($('.recording-delete-alert').html(), 4000); + showAlert(I18n.recording_deleted, 4000); } } }); diff --git a/app/assets/javascripts/landing.js b/app/assets/javascripts/landing.js index d904b4df..24aa8725 100644 --- a/app/assets/javascripts/landing.js +++ b/app/assets/javascripts/landing.js @@ -59,7 +59,7 @@ html: true, trigger: 'focus', title: function() { - return $(".delete-popover-title").html(); + return I18n.are_you_sure; }, content: function() { return $(".delete-popover-body").html(); diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be794..c0628bd9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,17 @@ module ApplicationHelper + def client_translations + locale = I18n.locale + if locale.length < 4 + fallback_locale = I18n.fallbacks[locale].second + end + + if fallback_locale + I18n.locale = fallback_locale + translations = I18n.t('.') + I18n.locale = locale + else + translations = I18n.t('.') + end + translations[:client] + end end diff --git a/app/views/landing/rooms.html.erb b/app/views/landing/rooms.html.erb index 3cceca19..7bde85f1 100644 --- a/app/views/landing/rooms.html.erb +++ b/app/views/landing/rooms.html.erb @@ -29,9 +29,6 @@