@@ -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 ;
@@ -137,7 +141,8 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
137141 $scope . showGroupRoom ( null , options ) ;
138142 } else {
139143 $scope . showRoom ( id , {
140- title : translation . _ ( "Chat with" )
144+ // Gets translated in template.
145+ title : "Chat with %1$s"
141146 } , options ) ;
142147 }
143148
@@ -159,7 +164,8 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
159164 return ;
160165 }
161166 var subscope = $scope . showRoom ( id , {
162- title : translation . _ ( "Chat with" )
167+ // Gets translated in template.
168+ title : "Chat with %1$s"
163169 } , options ) ;
164170 subscope . sendChatServer ( id , "Contact request" , {
165171 ContactRequest : {
@@ -181,7 +187,8 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
181187
182188 scope . showGroupRoom = function ( settings , options ) {
183189 var stngs = $ . extend ( {
184- title : translation . _ ( "Room chat" ) ,
190+ // Gets translated in template.
191+ title : "Room chat %1$s" ,
185192 group : true
186193 } , settings ) ;
187194 return scope . showRoom ( controller . group , stngs , options ) ;
@@ -384,7 +391,7 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
384391 // before we beep and shout.
385392 if ( ! subscope . isgroupchat && from !== sessionid ) {
386393 playSound . play ( "chatmessage" ) ;
387- desktopNotify . notify ( translation . _ ( "Message from " ) + displayName ( from ) , message ) ;
394+ desktopNotify . notify ( translation . _ ( "Message from %1$s" , displayName ( from ) ) , message ) ;
388395 appData . e . triggerHandler ( "uiNotification" , [ "chatmessage" , { from : from , message : message , first : subscope . firstmessage } ] ) ;
389396 }
390397 subscope . firstmessage = false ;
0 commit comments