forked from External/greenlight
		
	Email recording now translates correctly (#809)
This commit is contained in:
		
				
					committed by
					
						 Jesus Federico
						Jesus Federico
					
				
			
			
				
	
			
			
			
						parent
						
							073400b51b
						
					
				
				
					commit
					4a791ae0b5
				
			| @@ -28,9 +28,15 @@ function getLocalizedString(key) { | ||||
|   var translated = I18n | ||||
|  | ||||
|   // Search current language for the key | ||||
|   keyArr.forEach(function(k) { | ||||
|     translated = translated[k] | ||||
|   }) | ||||
|   try { | ||||
|     keyArr.forEach(function(k) { | ||||
|       translated = translated[k] | ||||
|     }) | ||||
|   } catch (e) { | ||||
|     // Key is missing in selected language so default to english | ||||
|     translated = undefined; | ||||
|   } | ||||
|  | ||||
|  | ||||
|   // If key is not found, search the fallback language for the key | ||||
|   if (translated === undefined) {  | ||||
|   | ||||
| @@ -26,10 +26,10 @@ $(document).on('turbolinks:load', function(){ | ||||
|     // Handle recording emails. | ||||
|     $('.email-link').each(function(){ | ||||
|       $(this).click(function(){ | ||||
|         var subject = $(".username").text() + " " + t('room.mailer.subject'); | ||||
|         var body =  t('room.mailer.body') + "\n\n" + $(this).attr("data-pres-link"); | ||||
|         var autogenerated = t('room.mailer.autogenerated') + "\n"; | ||||
|         var footer = t('room.mailer.footer'); | ||||
|         var subject = $(".username").text() + " " + getLocalizedString('javascript.room.mailer.subject'); | ||||
|         var body =  getLocalizedString('javascript.room.mailer.body') + "\n\n" + $(this).attr("data-pres-link"); | ||||
|         var autogenerated = getLocalizedString('javascript.room.mailer.autogenerated') + "\n"; | ||||
|         var footer = getLocalizedString('javascript.room.mailer.footer'); | ||||
|  | ||||
|         var url = "mailto:?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(body) + encodeURIComponent(autogenerated) + encodeURIComponent(footer); | ||||
|         var win = window.open(url, '_blank'); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user