diff --git a/app/assets/javascripts/room.js b/app/assets/javascripts/room.js index c4361069..93dbd5cc 100644 --- a/app/assets/javascripts/room.js +++ b/app/assets/javascripts/room.js @@ -43,10 +43,14 @@ $(document).on('turbolinks:load', function(){ // Handle recording emails. $('.email-link').each(function(){ $(this).click(function(){ - var subject = $(".username").text() + " has invited you to view a recording."; - var body = "To view the recording, follow the link below:\n\n" + $(this).attr("data-pres-link"); - var footer = "\n\nThis e-mail is auto-generated by BigBlueButton.\nBigBlueButton is an open source web conferencing system. For more information on BigBlueButton, see https://bigbluebutton.org/." - var win = window.open("mailto:?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(body) + encodeURIComponent(footer), '_blank'); + var subject = $(".username").text() + " " + t('room.mailer.subject'); + var body = t('room.mailer.body') + "\n\n" + $(this).attr("data-pres-link"); + var autogenerated = "\n\n" + t('room.mailer.autogenerated') + "\n"; + var footer = t('room.mailer.footer'); + + var url = "mailto:?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(body) + encodeURIComponent(autogenerated) + encodeURIComponent(footer); + var win = window.open(url, '_blank'); + win.focus(); }); }); diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0de2a1c8..09e14627 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -89,4 +89,10 @@ module ApplicationHelper false end end + + # Return all the translations available in the client side through javascript + def current_translations + @translations ||= I18n.backend.send(:translations) + @translations[I18n.locale].with_indifferent_access[:javascript] || {} + end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index e1fc5e24..94df89f5 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -32,6 +32,26 @@ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> + + "> diff --git a/app/views/user_mailer/password_reset.html.erb b/app/views/user_mailer/password_reset.html.erb index 373249b4..52d1fdf7 100644 --- a/app/views/user_mailer/password_reset.html.erb +++ b/app/views/user_mailer/password_reset.html.erb @@ -19,28 +19,30 @@
<%= image_tag(Rails.configuration.branding_image) %> -

Password Reset

+

+ <%= t('mailer.user.password_reset.title') %> +

- It seems like you forgot your password for <%= t('bigbluebutton') %> + <%= t('mailer.user.password_reset.welcome', bigbluebutton: t('bigbluebutton')) %>

- If this is true, please click the link below to reset your password: + <%= t('mailer.user.password_reset.message') %>

- Reset Password + <%= t('mailer.user.password_reset.reset_link') %>

- This link will expire in two hours. + <%= t('mailer.user.password_reset.expire') %>

- You can safely ignore this email if you did not request a password reset. + <%= t('mailer.user.password_reset.ignore') %>

diff --git a/app/views/user_mailer/password_reset.text.erb b/app/views/user_mailer/password_reset.text.erb index e219a5b6..199047df 100644 --- a/app/views/user_mailer/password_reset.text.erb +++ b/app/views/user_mailer/password_reset.text.erb @@ -16,13 +16,13 @@ # with BigBlueButton; if not, see . %> -Password Reset +<%= t('mailer.user.password_reset.title') %> -It seems like you forgot your password for <%= t('bigbluebutton') %> -If this is true, please click the link below to reset your password: +<%= t('mailer.user.password_reset.welcome', bigbluebutton: t('bigbluebutton')) %> +<%= t('mailer.user.password_reset.message') %> <%= @url %> -This link will expire in two hours. +<%= t('mailer.user.password_reset.expire') %> -You can safely ignore this email if you did not request a password reset. +<%= t('mailer.user.password_reset.ignore') %> diff --git a/app/views/user_mailer/verify_email.html.erb b/app/views/user_mailer/verify_email.html.erb index b388d3ce..a0a29937 100644 --- a/app/views/user_mailer/verify_email.html.erb +++ b/app/views/user_mailer/verify_email.html.erb @@ -20,23 +20,25 @@
<%= image_tag(Rails.configuration.branding_image) %> -

Welcome to <%= t('bigbluebutton') %>!, - <%= @user[:name] %>

+

+ <%= t('mailer.user.verify_email.welcome', bigbluebutton: t('bigbluebutton'), name: @user[:name]) %> +

- You have successfully registered your <%= t('bigbluebutton') %> account, your username is: - <%= @user[:email] %>. + <%= t('mailer.user.verify_email.success', bigbluebutton: t('bigbluebutton'), email: @user[:email]) %>

- To verify your account, just click the button below. + <%= t('mailer.user.verify_email.verify') %>

- Verify Account + <%= t('mailer.user.verify_email.verify_link') %> -

Thanks for joining and have a great day!

+

+ <%= t('mailer.user.verify_email.thanks') %> +

diff --git a/app/views/user_mailer/verify_email.text.erb b/app/views/user_mailer/verify_email.text.erb index 7d7b9e3b..c5cecc7d 100644 --- a/app/views/user_mailer/verify_email.text.erb +++ b/app/views/user_mailer/verify_email.text.erb @@ -16,10 +16,10 @@ # with BigBlueButton; if not, see . %> -Welcome to <%= t('bigbluebutton') %>!, <%= @user[:name] %> +<%= t('mailer.user.verify_email.welcome', bigbluebutton: t('bigbluebutton'), name: @user[:name]) %> -You have successfully registered your <%= t('bigbluebutton') %> account, your username is: <%= @user[:email] %>. +<%= t('mailer.user.verify_email.success', bigbluebutton: t('bigbluebutton'), email: @user[:email]) %> -To verify your account, just follow this link: <%= @url %> +<%= t('mailer.user.verify_email.verify_text', url: @url) %> -Thanks for joining and have a great day! +<%= t('mailer.user.verify_email.thanks') %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 7c810bc9..70ab4a7b 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -81,6 +81,13 @@ en: invalid_credentials: Login failed due to invalid credentials. Are you sure you entered them correctly? invalid_login_method: Login failed due to account mismatch. You need to log in with omniauth. invite_message: "To invite someone to the meeting, send them this link:" + javascript: + room: + mailer: + subject: 'has invited you to view a recording.' + body: 'To view the recording, follow the link below:' + autogenerated: 'This e-mail is auto-generated by BigBlueButton.' + footer: 'BigBlueButton is an open source web conferencing system. For more information on BigBlueButton, see https://bigbluebutton.org/.' landing: about: "%{href} is a simple front-end for your BigBlueButton open-source web conferencing server. You can create your own rooms to host sessions, or join others using a short and convenient link." welcome: Welcome to BigBlueButton. @@ -91,6 +98,22 @@ en: language_default: Default (browser language) ldap_error: Unable to connect to the LDAP server. Please check your LDAP configuration in the env file and ensure your server is running. login: Sign in + mailer: + user: + password_reset: + title: 'Password reset' + welcome: It seems like you forgot your password for %{bigbluebutton} + message: 'If this is true, please click the link below to reset your password:' + reset_link: Reset Password + expire: This link will expire in two hours. + ignore: You can safely ignore this email if you did not request a password reset. + verify_email: + welcome: Welcome to %{bigbluebutton}, %{name}! + success: You have successfully registered your %{bigbluebutton} account. Your username is %{email}. + verify: To verify your account, just click the button below. + verify_text: 'To verify your account, just follow this link: %{url}' + verify_link: Verify Account + thanks: Thanks for joining and have a great day! max_concurrent: The maximum number of concurrent sessions allowed has been reached! modal: create_room: