Commit 2b312024 authored by sb's avatar sb

merged trunk r6780

removed i18n imports from zeroconf/connection files
parent 61dab0d5
# Set the C flags to include the GTK+ and Python libraries
PYTHON ?= python
PYTHONVER = `$(PYTHON) -c 'import sys; print sys.version[:3]'`
CFLAGS = `pkg-config --cflags gtk+-2.0 pygtk-2.0` -fPIC -I/usr/include/python$(PYTHONVER) -I.
LDFLAGS = `pkg-config --libs gtk+-2.0 pygtk-2.0` -lpython$(PYTHONVER)
gtk_CFLAGS = `pkg-config --cflags gtk+-2.0 pygtk-2.0` -fPIC -I/usr/include/python$(PYTHONVER) -I.
gtk_LDFLAGS = `pkg-config --libs gtk+-2.0 pygtk-2.0` -lpython$(PYTHONVER)
all: trayicon.so gtkspell.so
# Build the shared objects
trayicon.so: trayicon.o eggtrayicon.o trayiconmodule.o
$(CC) -shared $^ -o $@ $(LDFLAGS)
$(CC) -shared $^ -o $@ $(LDFLAGS) $(gtk_LDFLAGS)
gtkspell.so:
$(CC) $(OPTFLAGS) $(CFLAGS) `pkg-config --cflags gtkspell-2.0` -shared gtkspellmodule.c $^ -o $@ $(LDFLAGS) `pkg-config --libs gtkspell-2.0`
$(CC) $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) $(gtk_CFLAGS) $(gtk_LDFLAGS) `pkg-config --libs --cflags gtkspell-2.0` -shared gtkspellmodule.c $^ -o $@
# The path to the GTK+ python types
DEFS=`pkg-config --variable=defsdir pygtk-2.0`
%.o: %.c
$(CC) -o $@ -c $< $(CFLAGS) $(gtk_CFLAGS)
# Generate the C wrapper from the defs and our override file
trayicon.c: trayicon.defs trayicon.override
pygtk-codegen-2.0 --prefix trayicon \
......
......@@ -25,16 +25,9 @@
##
import gtk
import gtk.glade
import gtkgui_helpers
from common import gajim
from common import i18n
_ = i18n._
APP = i18n.APP
gtk.glade.bindtextdomain(APP, i18n.DIR)
gtk.glade.textdomain(APP)
(
OPT_TYPE,
......@@ -53,6 +46,8 @@ class AdvancedConfigurationWindow:
def __init__(self):
self.xml = gtkgui_helpers.get_glade('advanced_configuration_window.glade')
self.window = self.xml.get_widget('advanced_configuration_window')
self.window.set_transient_for(
gajim.interface.instances['preferences'].window)
self.entry = self.xml.get_widget('advanced_entry')
self.desc_label = self.xml.get_widget('advanced_desc_label')
self.restart_label = self.xml.get_widget('restart_label')
......
This diff is collapsed.
......@@ -138,7 +138,7 @@ else:
def verify(self, str, sign):
if not USE_GPG:
return str
if not str:
if str == None:
return ''
f = tmpfile()
fd = f.fileno()
......
......@@ -6,19 +6,19 @@ HAVE_XSCRNSAVER = $(shell pkg-config --exists xscrnsaver && echo 'YES')
ifeq ($(HAVE_XSCRNSAVER),YES)
# We link with libXScrnsaver from modular X.Org X11
CFLAGS = `pkg-config --cflags gtk+-2.0 pygtk-2.0 xscrnsaver` -fpic -I/usr/include/python$(PYTHONVER) -I.
LDFLAGS = `pkg-config --libs gtk+-2.0 pygtk-2.0 xscrnsaver` -lpython$(PYTHONVER)
gtk_and_x_CFLAGS = `pkg-config --cflags gtk+-2.0 pygtk-2.0 xscrnsaver` -fpic -I/usr/include/python$(PYTHONVER) -I.
gtk_and_x_LDFLAGS = `pkg-config --libs gtk+-2.0 pygtk-2.0 xscrnsaver` -lpython$(PYTHONVER)
else
# # We link with libXScrnsaver from monolithic X.Org X11
CFLAGS = `pkg-config --cflags gtk+-2.0 pygtk-2.0` -fpic -I/usr/include/python$(PYTHONVER) -I.
LDFLAGS = `pkg-config --libs gtk+-2.0 pygtk-2.0` -L/usr/X11R6$(LIBDIR) -lX11 \
-lXss -lXext -lpython$(PYTHONVER)
gtk_and_x_CFLAGS = `pkg-config --cflags gtk+-2.0 pygtk-2.0` -fpic -I/usr/include/python$(PYTHONVER) -I.
gtk_and_x_LDFLAGS = `pkg-config --libs gtk+-2.0 pygtk-2.0` \
-L/usr/X11R6$(LIBDIR) -lX11 -lXss -lXext -lpython$(PYTHONVER)
endif
all: idle.so
idle.so:
$(CC) $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) -shared idle.c $^ -o $@
$(CC) $(OPTFLAGS) $(CFLAGS) $(LDFLAGS) $(gtk_and_x_CFLAGS) $(gtk_and_x_LDFLAGS) -shared idle.c $^ -o $@
clean:
rm -f *.so
......
......@@ -28,10 +28,6 @@ import stat
from common import gajim
import logger
import i18n
_ = i18n._
Q_ = i18n.Q_
from pysqlite2 import dbapi2 as sqlite # DO NOT MOVE ABOVE OF import gajim
......@@ -61,6 +57,11 @@ def create_log_db():
jid_id INTEGER
);
CREATE TABLE transports_cache (
transport TEXT UNIQUE,
type INTEGER
);
CREATE TABLE logs(
log_line_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
jid_id INTEGER,
......
This diff is collapsed.
......@@ -42,9 +42,6 @@ from common import GnuPG
from connection_handlers import *
USE_GPG = GnuPG.USE_GPG
from common import i18n
_ = i18n._
class Connection(ConnectionHandlers):
'''Connection class'''
def __init__(self, name):
......@@ -88,8 +85,12 @@ class Connection(ConnectionHandlers):
self.on_connect_failure = None
self.retrycount = 0
self.jids_for_auto_auth = [] # list of jid to auto-authorize
self.muc_jid = {} # jid of muc server for each transport type
self.available_transports = {} # list of available transports on this
# server {'icq': ['icq.server.com', 'icq2.server.com'], }
self.vcard_supported = True
# END __init__
def put_event(self, ev):
if gajim.handlers.has_key(ev[0]):
gajim.handlers[ev[0]](self.name, ev[1])
......@@ -137,22 +138,21 @@ class Connection(ConnectionHandlers):
if not self.on_purpose:
self.disconnect()
if gajim.config.get_per('accounts', self.name, 'autoreconnect') \
and self.retrycount <= 10:
and self.retrycount <= 10:
self.connected = 1
self.dispatch('STATUS', 'connecting')
self.time_to_reconnect = 10
# this check has moved from _reconnect method
if self.retrycount > 5:
self.time_to_reconnect = 20
else:
self.time_to_reconnect = 10
gajim.idlequeue.set_alarm(self._reconnect_alarm,
self.time_to_reconnect)
gajim.idlequeue.set_alarm(self._reconnect_alarm,
self.time_to_reconnect)
elif self.on_connect_failure:
self.on_connect_failure()
self.on_connect_failure = None
else:
# show error dialog
# show error dialog
self._connection_lost()
else:
self.disconnect()
......@@ -162,9 +162,9 @@ class Connection(ConnectionHandlers):
def _connection_lost(self):
self.disconnect(on_purpose = False)
self.dispatch('STATUS', 'offline')
self.dispatch('ERROR',
(_('Connection with account "%s" has been lost') % self.name,
_('To continue sending and receiving messages, you will need to reconnect.')))
self.dispatch('CONNECTION_LOST',
(_('Connection with account "%s" has been lost') % self.name,
_('To continue sending and receiving messages, you will need to reconnect.')))
def _event_dispatcher(self, realm, event, data):
if realm == common.xmpp.NS_REGISTER:
......@@ -211,6 +211,34 @@ class Connection(ConnectionHandlers):
else:
conf = data[1].asDict()
self.dispatch('REGISTER_AGENT_INFO', (data[0], conf, is_form))
elif realm == common.xmpp.NS_PRIVACY:
if event == common.xmpp.features_nb.PRIVACY_LISTS_RECEIVED:
# data is (list)
self.dispatch('PRIVACY_LISTS_RECEIVED', (data))
elif event == common.xmpp.features_nb.PRIVACY_LIST_RECEIVED:
# data is (resp)
if not data:
return
rules = []
name = data.getTag('query').getTag('list').getAttr('name')
for child in data.getTag('query').getTag('list').getChildren():
dict_item = child.getAttrs()
childs = []
if dict_item.has_key('type'):
for scnd_child in child.getChildren():
childs += [scnd_child.getName()]
rules.append({'action':dict_item['action'],
'type':dict_item['type'], 'order':dict_item['order'],
'value':dict_item['value'], 'child':childs})
else:
for scnd_child in child.getChildren():
childs.append(scnd_child.getName())
rules.append({'action':dict_item['action'],
'order':dict_item['order'], 'child':childs})
self.dispatch('PRIVACY_LIST_RECEIVED', (name, rules))
elif event == common.xmpp.features_nb.PRIVACY_LISTS_ACTIVE_DEFAULT:
# data is (dict)
self.dispatch('PRIVACY_LISTS_ACTIVE_DEFAULT', (data))
elif realm == '':
if event == common.xmpp.transports.DATA_RECEIVED:
self.dispatch('STANZA_ARRIVED', unicode(data, errors = 'ignore'))
......@@ -360,7 +388,8 @@ class Connection(ConnectionHandlers):
if not self.retrycount and self.connected != 0:
self.disconnect(on_purpose = True)
self.dispatch('STATUS', 'offline')
self.dispatch('ERROR', (_('Could not connect to "%s"') % self._hostname,
self.dispatch('CONNECTION_LOST',
(_('Could not connect to "%s"') % self._hostname,
_('Check your connection or try again later.')))
def _connect_success(self, con, con_type):
......@@ -396,7 +425,8 @@ class Connection(ConnectionHandlers):
if not con:
self.disconnect(on_purpose = True)
self.dispatch('STATUS', 'offline')
self.dispatch('ERROR', (_('Could not connect to "%s"') % self._hostname,
self.dispatch('CONNECTION_LOST',
(_('Could not connect to "%s"') % self._hostname,
_('Check your connection or try again later')))
if self.on_connect_auth:
self.on_connect_auth(None)
......@@ -433,6 +463,41 @@ class Connection(ConnectionHandlers):
if kill_core and self.connected > 1:
self.disconnect(on_purpose = True)
def get_privacy_lists(self):
if not self.connection:
return
common.xmpp.features_nb.getPrivacyLists(self.connection)
def get_active_default_lists(self):
if not self.connection:
return
common.xmpp.features_nb.getActiveAndDefaultPrivacyLists(self.connection)
def del_privacy_list(self, privacy_list):
if not self.connection:
return
common.xmpp.features_nb.delPrivacyList(self.connection, privacy_list)
def get_privacy_list(self, title):
if not self.connection:
return
common.xmpp.features_nb.getPrivacyList(self.connection, title)
def set_privacy_list(self, listname, tags):
if not self.connection:
return
common.xmpp.features_nb.setPrivacyList(self.connection, listname, tags)
def set_active_list(self, listname):
if not self.connection:
return
common.xmpp.features_nb.setActivePrivacyList(self.connection, listname, 'active')
def set_default_list(self, listname):
if not self.connection:
return
common.xmpp.features_nb.setDefaultPrivacyList(self.connection, listname)
def build_privacy_rule(self, name, action):
'''Build a Privacy rule stanza for invisibility'''
iq = common.xmpp.Iq('set', common.xmpp.NS_PRIVACY, xmlns = '')
......@@ -442,6 +507,8 @@ class Connection(ConnectionHandlers):
return iq
def activate_privacy_rule(self, name):
if not self.connection:
return
'''activate a privacy rule'''
iq = common.xmpp.Iq('set', common.xmpp.NS_PRIVACY, xmlns = '')
iq.getTag('query').setTag('active', {'name': name})
......@@ -528,7 +595,7 @@ class Connection(ConnectionHandlers):
# Ask metacontacts before roster
self.get_metacontacts()
def change_status(self, show, msg, sync = False, auto = False):
def change_status(self, show, msg, auto = False):
if not show in STATUS_LIST:
return -1
sshow = helpers.get_xmpp_show(show)
......@@ -607,7 +674,8 @@ class Connection(ConnectionHandlers):
self.connection.send(msg_iq)
def send_message(self, jid, msg, keyID, type = 'chat', subject='',
chatstate = None, msg_id = None, composing_jep = None, resource = None):
chatstate = None, msg_id = None, composing_jep = None, resource = None,
user_nick = None):
if not self.connection:
return
if not msg and chatstate is None:
......@@ -638,6 +706,11 @@ class Connection(ConnectionHandlers):
if msgenc:
msg_iq.setTag(common.xmpp.NS_ENCRYPTED + ' x').setData(msgenc)
# JEP-0172: user_nickname
if user_nick:
msg_iq.setTag('nick', namespace = common.xmpp.NS_NICK).setData(
user_nick)
# chatstates - if peer supports jep85 or jep22, send chatstates
# please note that the only valid tag inside a message containing a <body>
# tag is the active event
......@@ -692,7 +765,7 @@ class Connection(ConnectionHandlers):
self.connection.send(p)
def request_subscription(self, jid, msg = '', name = '', groups = [],
auto_auth = False):
auto_auth = False, user_nick = ''):
if not self.connection:
return
gajim.log.debug('subscription request for %s' % jid)
......@@ -710,10 +783,11 @@ class Connection(ConnectionHandlers):
self.connection.send(iq)
p = common.xmpp.Presence(jid, 'subscribe')
if user_nick:
p.setTag('nick', namespace = common.xmpp.NS_NICK).setData(user_nick)
p = self.add_sha(p)
if not msg:
msg = _('I would like to add you to my roster.')
p.setStatus(msg)
if msg:
p.setStatus(msg)
self.connection.send(p)
def send_authorization(self, jid):
......@@ -796,6 +870,10 @@ class Connection(ConnectionHandlers):
def request_os_info(self, jid, resource):
if not self.connection:
return
# If we are invisible, do not request
if self.connected == gajim.SHOW_LIST.index('invisible'):
self.dispatch('OS_INFO', (jid, resource, _('Not fetched because of invisible status'), _('Not fetched because of invisible status')))
return
to_whom_jid = jid
if resource:
to_whom_jid += '/' + resource
......@@ -852,6 +930,9 @@ class Connection(ConnectionHandlers):
iq = common.xmpp.Iq(typ='get')
iq2 = iq.addChild(name='query', namespace='jabber:iq:private')
iq2.addChild(name='storage', namespace='storage:metacontacts')
id = self.connection.getAnID()
iq.setID(id)
self.awaiting_answers[id] = (METACONTACTS_ARRIVED, )
self.connection.send(iq)
def store_metacontacts(self, tags_list):
......@@ -873,7 +954,8 @@ class Connection(ConnectionHandlers):
def send_agent_status(self, agent, ptype):
if not self.connection:
return
p = common.xmpp.Presence(to = agent, typ = ptype)
show = helpers.get_xmpp_show(STATUS_LIST[self.connected])
p = common.xmpp.Presence(to = agent, typ = ptype, show = show)
p = self.add_sha(p, ptype != 'unavailable')
self.connection.send(p)
......
This diff is collapsed.
......@@ -210,7 +210,7 @@ class Contacts:
contacts = self.get_contacts_from_jid(account, jid)
if not contacts and '/' in jid:
# jid may be a fake jid, try it
room, nick = jid.split('/')
room, nick = jid.split('/', 1)
contact = self.get_gc_contact(account, room, nick)
return contact
return self.get_highest_prio_contact_from_contacts(contacts)
......@@ -324,8 +324,11 @@ class Contacts:
max_order = data_['order']
contact = self.get_contact_with_highest_priority(account, jid)
score = (max_order - order)*10000
if not common.gajim.jid_is_transport(jid):
score += contact.priority*10
if common.gajim.get_transport_name_from_jid(jid) is None:
score += 10
if contact.priority > 0:
score += contact.priority * 10
score += ['not in roster', 'error', 'offline', 'invisible', 'dnd', 'xa',
'away', 'chat', 'online', 'requested', 'message'].index(contact.show)
return score
......
## common/events.py
##
## Contributors for this file:
## - Yann Le Boulanger <asterix@lagaule.org>
##
## Copyright (C) 2006 Yann Le Boulanger <asterix@lagaule.org>
## Vincent Hanquez <tab@snarc.org>
## Nikos Kouremenos <nkour@jabber.org>
## Dimitur Kirov <dkirov@gmail.com>
## Travis Shirk <travis@pobox.com>
## Norman Rasmussen <norman@rasmussen.co.za>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
## by the Free Software Foundation; version 2 only.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
import time
import gajim
class Event:
'''Information concerning each event'''
def __init__(self, type_, time_, parameters, show_in_roster = False,
show_in_systray = True):
''' type_ in chat, normal, file-request, file-error, file-completed,
file-request-error, file-send-error, file-stopped, gc_msg, pm,
printed_chat, printed_gc_msg, printed_pm
parameters is (per type_):
chat, normal: [message, subject, kind, time, encrypted, resource,
msg_id]
where kind in error, incoming
file-*: file_props
gc_msg: None
printed_*: None
messages that are already printed in chat, but not read'''
self.type_ = type_
self.time_ = time_
self.parameters = parameters
self.show_in_roster = show_in_roster
self.show_in_systray = show_in_systray
class Events:
'''Information concerning all events'''
def __init__(self):
self._events = {} # list of events {acct: {jid1: [E1, E2]}, }
def change_account_name(self, old_name, new_name):
if self._events.has_key(old_name):
self._events[new_name] = self._events[old_name]
del self._events[old_name]
def add_account(self, account):
self._events[account] = {}
def get_accounts(self):
return self._events.keys()
def remove_account(self, account):
del self._events[account]
def create_event(self, type_, parameters, time_ = time.time(),
show_in_roster = False, show_in_systray = True):
return Event(type_, time_, parameters, show_in_roster,
show_in_systray)
def add_event(self, account, jid, event):
# No such account before ?
if not self._events.has_key(account):
self._events[account] = {jid: [event]}
# no such jid before ?
elif not self._events[account].has_key(jid):
self._events[account][jid] = [event]
else:
self._events[account][jid].append(event)
if event.show_in_systray and gajim.interface.systray_capabilities:
gajim.interface.systray.set_img()
def remove_events(self, account, jid, event = None, types = []):
'''if event is not speficied, remove all events from this jid,
optionnaly only from given type
return True if no such event found'''
if not self._events.has_key(account):
return True
if not self._events[account].has_key(jid):
return True
if event: # remove only one event
if event in self._events[account][jid]:
if len(self._events[account][jid]) == 1:
del self._events[account][jid]
else:
self._events[account][jid].remove(event)
if event.show_in_systray and gajim.interface.systray_capabilities:
gajim.interface.systray.set_img()
return
else:
return True
if types:
new_list = [] # list of events to keep
for ev in self._events[account][jid]:
if ev.type_ not in types:
new_list.append(ev)
if len(new_list) == len(self._events[account][jid]):
return True
if new_list:
self._events[account][jid] = new_list
else:
del self._events[account][jid]
if gajim.interface.systray_capabilities:
gajim.interface.systray.set_img()
return
# no event nor type given, remove them all
del self._events[account][jid]
if gajim.interface.systray_capabilities:
gajim.interface.systray.set_img()
def get_nb_events(self, types = []):
return self._get_nb_events(types = types)
def get_events(self, account, jid = None, types = []):
'''if event is not speficied, remove all events from this jid,
optionnaly only from given type'''
if not self._events.has_key(account):
return []
if not jid:
return self._events[account]
if not self._events[account].has_key(jid):
return []
events_list = [] # list of events
for ev in self._events[account][jid]:
if not types or ev.type_ in types:
events_list.append(ev)
return events_list
def get_first_event(self, account, jid = None, type_ = None):
'''Return the first event of type type_ if given'''
events_list = self.get_events(account, jid, type_)
# be sure it's bigger than latest event
first_event_time = time.time() + 1
first_event = None
for event in events_list:
if event.time_ < first_event_time:
first_event_time = event.time_
first_event = event
return first_event
def _get_nb_events(self, account = None, jid = None, attribute = None, types = []):
'''return the number of events'''
nb = 0
if account:
accounts = [account]
else:
accounts = self._events.keys()
for acct in accounts:
if not self._events.has_key(acct):
continue
if jid:
jids = [jid]
else:
jids = self._events[acct].keys()
for j in jids:
if not self._events[acct].has_key(j):
continue
for event in self._events[acct][j]:
if types and event.type_ not in types:
continue
if not attribute or \
attribute == 'systray' and event.show_in_systray or \
attribute == 'roster' and event.show_in_roster:
nb += 1
return nb
def _get_some_events(self, attribute):
'''attribute in systray, roster'''
events = {}
for account in self._events:
events[account] = {}
for jid in self._events[account]:
events[account][jid] = []
for event in self._events[account][jid]:
if attribute == 'systray' and event.show_in_systray or \
attribute == 'roster' and event.show_in_roster:
events[account][jid].append(event)
if not events[account][jid]:
del events[account][jid]
if not events[account]:
del events[account]
return events
def _get_first_event_with_attribute(self, events):
'''get the first event
events is in the form {account1: {jid1: [ev1, ev2], },. }'''
# be sure it's bigger than latest event
first_event_time = time.time() + 1
first_account = None
first_jid = None
first_event = None
for account in events:
for jid in events[account]:
for event in events[account][jid]:
if event.time_ < first_event_time:
first_event_time = event.time_
first_account = account
first_jid = jid
first_event = event
return first_account, first_jid, first_event
def get_nb_systray_events(self, types = []):
'''returns the number of events displayedin roster'''
return self._get_nb_events(attribute = 'systray', types = types)
def get_systray_events(self):
'''return all events that must be displayed in systray:
{account1: {jid1: [ev1, ev2], },. }'''
return self._get_some_events('systray')
def get_first_systray_event(self):
events = self.get_systray_events()
return self._get_first_event_with_attribute(events)
def get_nb_roster_events(self, account = None, jid = None, types = []):
'''returns the number of events displayedin roster'''
return self._get_nb_events(attribute = 'roster', account = account,
jid = jid, types = types)
def get_roster_events(self):
'''return all events that must be displayed in roster:
{account1: {jid1: [ev1, ev2], },. }'''
return self._get_some_events('roster')
......@@ -23,9 +23,6 @@
## GNU General Public License for more details.
##
from common import i18n
_ = i18n._
class PysqliteNotAvailable(Exception):
'''sqlite2 is not installed or python bindings are missing'''
def __init__(self):
......
## fuzzyclock.py
##
## Contributors for this file:
##
## - Yann Le Boulanger <asterix@lagaule.org>
## - Christoph Neuroth <delmonico@gmx.net>
##
## Copyright (C) 2006 Christoph Neuroth <delmonico@gmx.net>
## Yann Le Boulanger <asterix@lagaule.org>
## Dimitur Kirov <dkirov@gmail.com>
## Travis Shirk <travis@pobox.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
## by the Free Software Foundation; version 2 only.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
'''
Python class to show a "fuzzy clock".
Homepage: http://home.gna.org/fuzzyclock/
Project Page: http://gna.org/projects/fuzzyclock
The class has been ported from PHP code by
Henrique Recidive <henrique at recidive.com> which was
in turn based on the Fuzzy Clock Applet of Frerich Raabe (KDE).
So most of the credit goes to this guys, thanks :-)
'''
import time
class FuzzyClock:
def __init__(self):
self.__hour = 0
self.__minute = 0
self.__dayOfWeek = 0
self.__hourNames = [ _('one'), _('two'), _('three'), _('four'), _('five'), _('six'),
_('seven'), _('eight'), _('nine'), _('ten'), _('eleven'),
_('twelve')]
#Strings to use for the output. %0 will be replaced with the preceding hour (e.g. "x PAST %0"), %1 with the coming hour (e.g. "x TO %1). '''
self.__normalFuzzy = [ _("%0 o'clock"), _('five past %0'), _('ten past %0'),
_('quarter past %0'), _('twenty past %0'),
_('twenty five past %0'), _('half past %0'),
_('twenty five to %1'), _('twenty to %1'),
_('quarter to %1'), _('ten to %1'), _('five to %1'),
_("%1 o'clock") ]
#A "singular-form". It is used when talking about hour 0
self.__normalFuzzyOne = [ _("%0 o'clock"), _('five past %0'),
_('ten past %0'), _('quarter past %0'),
_('twenty past %0'), _('twenty five past %0'),
_('half past %0'), _('twenty five to %1'),
_('twenty to %1'), _('quarter to %1'),
_('ten to %1'), _('five to %1'), _("%1 o'clock") ]
self.__dayTime = [ _('Night'), _('Early morning'), _('Morning'), _('Almost noon'),
_('Noon'), _('Afternoon'), _('Evening'), _('Late evening') ]
self.__fuzzyWeek = [ _('Start of week'), _('Middle of week'), _('End of week'),
_('Weekend!') ]