temporary workaround of ngettext() limitation
This commit is contained in:
		
							parent
							
								
									f640d62ac0
								
							
						
					
					
						commit
						57930d1d7a
					
				
					 1 changed files with 13 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -137,11 +137,20 @@ class GroupchatWindow(chat.Chat):
 | 
			
		|||
					names.append(gajim.get_nick_from_jid(room_jid))
 | 
			
		||||
 | 
			
		||||
			if len(names): # if one or more rooms connected
 | 
			
		||||
				joined_names = ', '.join(names)
 | 
			
		||||
				#FIXME: wrap this function to OUR function called ngettext()
 | 
			
		||||
				#this hopefully will fool xgettext and we'll have a signature we like
 | 
			
		||||
				#eg. ngettext('do %s' % 'one', 'do %s' % 'two', len(jobs))
 | 
			
		||||
				#so we do not have to do this madness that follows allover we use
 | 
			
		||||
				#ngettext()
 | 
			
		||||
				pritext = i18n._translation.ngettext(
 | 
			
		||||
					'Are you sure you want to leave room "%s"?' % names[0],
 | 
			
		||||
					'Are you sure you want to leave rooms "%s"?' % joined_names,
 | 
			
		||||
					'Are you sure you want to leave room "%s"?',
 | 
			
		||||
					'Are you sure you want to leave rooms "%s"?',
 | 
			
		||||
					len(names))
 | 
			
		||||
				if len(names) == 1:
 | 
			
		||||
					pritext = pritext % names[0]
 | 
			
		||||
				else:
 | 
			
		||||
					joined_names = ', '.join(names)
 | 
			
		||||
					pritext = pritext % joined_names
 | 
			
		||||
			
 | 
			
		||||
				sectext = i18n._translation.ngettext(
 | 
			
		||||
			'If you close this window, you will be disconnected from this room.',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue