@@ -24,6 +24,10 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
2424
2525 return [ "$compile" , "safeDisplayName" , "mediaStream" , "safeApply" , "desktopNotify" , "translation" , "playSound" , "fileUpload" , "randomGen" , "buddyData" , "appData" , "$timeout" , "geolocation" , function ( $compile , safeDisplayName , mediaStream , safeApply , desktopNotify , translation , playSound , fileUpload , randomGen , buddyData , appData , $timeout , geolocation ) {
2626
27+ // Translation helpers.
28+ translation . _ ( "Chat with %1$s" ) ;
29+ translation . _ ( "Room chat %1$s" ) ;
30+
2731 var displayName = safeDisplayName ;
2832 var groupChatId = "" ;
2933 var maxMessageSize = 200000 ;
@@ -138,7 +142,8 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
138142 $scope . showGroupRoom ( null , options ) ;
139143 } else {
140144 $scope . showRoom ( id , {
141- title : translation . _ ( "Chat with" )
145+ // Gets translated in template.
146+ title : "Chat with %1$s"
142147 } , options ) ;
143148 }
144149
@@ -160,7 +165,8 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
160165 return ;
161166 }
162167 var subscope = $scope . showRoom ( id , {
163- title : translation . _ ( "Chat with" )
168+ // Gets translated in template.
169+ title : "Chat with %1$s"
164170 } , options ) ;
165171 subscope . sendChatServer ( id , "Contact request" , {
166172 ContactRequest : {
@@ -182,7 +188,8 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
182188
183189 scope . showGroupRoom = function ( settings , options ) {
184190 var stngs = $ . extend ( {
185- title : translation . _ ( "Room chat" ) ,
191+ // Gets translated in template.
192+ title : "Room chat %1$s" ,
186193 group : true
187194 } , settings ) ;
188195 return scope . showRoom ( controller . group , stngs , options ) ;
@@ -385,7 +392,7 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
385392 // before we beep and shout.
386393 if ( ! subscope . isgroupchat && from !== sessionid ) {
387394 playSound . play ( "chatmessage" ) ;
388- desktopNotify . notify ( translation . _ ( "Message from " ) + displayName ( from ) , message ) ;
395+ desktopNotify . notify ( translation . _ ( "Message from %1$s" , displayName ( from ) ) , message ) ;
389396 appData . e . triggerHandler ( "uiNotification" , [ "chatmessage" , { from : from , message : message , first : subscope . firstmessage } ] ) ;
390397 }
391398 subscope . firstmessage = false ;
0 commit comments