use plural forms (ngettext) in a string. please convert your strings that way
This commit is contained in:
parent
3c59acddc2
commit
6aefa6ae86
4 changed files with 31 additions and 31 deletions
|
@ -109,12 +109,12 @@ class Chat:
|
|||
chat = self.names[jid]
|
||||
if len(self.xmls) > 1: # if more than one tab in the same window
|
||||
if self.widget_name == 'tabbed_chat_window':
|
||||
chat = 'Chat'
|
||||
chat = _('Chat')
|
||||
elif self.widget_name == 'groupchat_window':
|
||||
chat = 'Groupchat'
|
||||
chat = _('Group Chat')
|
||||
title = start + chat
|
||||
if len(gajim.connections) >= 2: # if we have 2 or more accounts
|
||||
title = title + _(' (account: ') + self.account + ')'
|
||||
title = title + ' (' + _('account: ') + self.account + ')'
|
||||
|
||||
self.window.set_title(title)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
## common/i18n.py
|
||||
##
|
||||
## -*- coding: utf-8 -*-
|
||||
## Gajim Team:
|
||||
## - Yann Le Boulanger <asterix@lagaule.org>
|
||||
## - Vincent Hanquez <tab@snarc.org>
|
||||
|
@ -17,8 +17,8 @@
|
|||
## GNU General Public License for more details.
|
||||
##
|
||||
|
||||
APP='gajim'
|
||||
DIR='../po'
|
||||
APP = 'gajim'
|
||||
DIR = '../po'
|
||||
|
||||
import locale
|
||||
import gettext
|
||||
|
@ -36,5 +36,4 @@ def init():
|
|||
def _(s):
|
||||
if s == '':
|
||||
return s
|
||||
assert s
|
||||
return _translation.gettext(s)
|
||||
|
|
|
@ -487,16 +487,12 @@ class ConfirmationDialogCheck(ConfirmationDialog):
|
|||
def __init__(self, pritext, sectext='', checktext = ''):
|
||||
HigDialog.__init__(self, None, pritext, sectext,
|
||||
gtk.STOCK_DIALOG_WARNING, [ [gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL] ])
|
||||
|
||||
# add ok button manually, because we need to focus on it
|
||||
ok_button = self.add_button (gtk.STOCK_OK, gtk.RESPONSE_OK)
|
||||
ok_button = self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
|
||||
self.checkbutton = gtk.CheckButton(checktext)
|
||||
self.vbox.pack_start(self.checkbutton, expand=False, fill=True)
|
||||
ok_button.grab_focus()
|
||||
# override this method not to destroy the dialog
|
||||
def get_response(self):
|
||||
self.show_all()
|
||||
response = gtk.Dialog.run(self)
|
||||
return response
|
||||
|
||||
def is_checked(self):
|
||||
''' Get active state of the checkbutton '''
|
||||
|
|
|
@ -30,6 +30,7 @@ import gtkgui_helpers
|
|||
from gajim import Contact
|
||||
from common import gajim
|
||||
from common import helpers
|
||||
from gettext import ngettext
|
||||
from common import i18n
|
||||
|
||||
_ = i18n._
|
||||
|
@ -111,7 +112,6 @@ class GroupchatWindow(chat.Chat):
|
|||
|
||||
def on_groupchat_window_delete_event(self, widget, event):
|
||||
"""close window"""
|
||||
stop_propagation = False
|
||||
for room_jid in self.xmls:
|
||||
if time.time() - gajim.last_message_time[self.account][room_jid] < 2:
|
||||
dialog = dialogs.ConfirmationDialog(
|
||||
|
@ -119,39 +119,44 @@ class GroupchatWindow(chat.Chat):
|
|||
_('If you close this window, this message will be lost.')
|
||||
)
|
||||
if dialog.get_response() != gtk.RESPONSE_OK:
|
||||
stop_propagation = True #stop the propagation of the event
|
||||
if not stop_propagation and self.confirm_close:
|
||||
if len(self.xmls) >=2:
|
||||
names = ''
|
||||
dialog.destroy()
|
||||
return True # stop the propagation of the delete event
|
||||
|
||||
if self.confirm_close:
|
||||
name = ''
|
||||
names = ''
|
||||
if len(self.xmls) >= 2:
|
||||
for room in self.xmls:
|
||||
if names != '':
|
||||
names += ', '
|
||||
names += gajim.get_nick_from_jid(room)
|
||||
pritext = _('Are you sure you want to leave rooms "%s"?') \
|
||||
% names
|
||||
sectext = \
|
||||
_('If you close this window, you will be disconnected from these rooms.')
|
||||
else:
|
||||
name = gajim.get_nick_from_jid(room_jid)
|
||||
pritext = _('Are you sure you want to leave room "%s"?') \
|
||||
% name
|
||||
sectext = \
|
||||
_('If you close this window, you will be disconnected from the room.')
|
||||
|
||||
pritext = ngettext('Are you sure you want to leave room "%s"?' % name,
|
||||
'Are you sure you want to leave rooms "%s"?' % names, len(self.xmls))
|
||||
|
||||
sectext = ngettext(
|
||||
'If you close this window, you will be disconnected from this room.',
|
||||
'If you close this window, you will be disconnected from these rooms.',
|
||||
len(self.xmls))
|
||||
|
||||
dialog = dialogs.ConfirmationDialogCheck(pritext, sectext,
|
||||
_('Do not ask me again') )
|
||||
|
||||
if dialog.get_response() != gtk.RESPONSE_OK:
|
||||
stop_propagation = True
|
||||
return True # stop propagation of the delete event
|
||||
|
||||
if dialog.is_checked():
|
||||
gajim.config.set('confirm_close_muc', False)
|
||||
dialog.destroy()
|
||||
if stop_propagation:
|
||||
return True
|
||||
dialog.destroy()
|
||||
|
||||
for room_jid in self.xmls:
|
||||
gajim.connections[self.account].send_gc_status(self.nicks[room_jid],
|
||||
room_jid, 'offline', 'offline')
|
||||
|
||||
if gajim.config.get('saveposition'):
|
||||
# save window position and size
|
||||
# save window position and size
|
||||
gajim.config.set('gc-hpaned-position', self.hpaned_position)
|
||||
x, y = self.window.get_position()
|
||||
gajim.config.set('gc-x-position', x)
|
||||
|
|
Loading…
Add table
Reference in a new issue