Changeset 152

Show
Ignore:
Timestamp:
04/27/08 00:07:15 (7 months ago)
Author:
xbright
Message:

Internationalisation du randomchat et traduction francophone.
Ajout des fichiers AUTHORS, README et COPYING.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • randomchat/src/config-example.py

    r145 r152  
     1# ######################################## 
     2# Welcome to Random Chat configuration 
     3# ######################################## 
     4 
     5# The jabber identifiant of the component, 
     6# the password, the server and the port. 
    17JID = 'randomchat.example.com' 
    28PASS = 'secret' 
     
    410PORT = 5347 
    511 
     12# Default nick 
    613NICK_GUEST = 'inconnu(e)' 
    714 
     15# Database configuration 
    816DB_MODULE = 'sqlite' 
    9 SQLITE_DB = 'randomchat.db' 
     17SQLITE_DB = '../randomchat.db' 
    1018 
     19# Enable or disable log 
    1120LOG = True 
  • randomchat/src/randomchat.py

    r146 r152  
    11#!/usr/bin/env python 
    22# -*- coding: utf-8 -*- 
     3 
     4from gettext import (bindtextdomain, textdomain, bind_textdomain_codeset, \ 
     5                     gettext as _) 
     6bindtextdomain('randomchat', '../locale') 
     7textdomain('randomchat') 
     8bind_textdomain_codeset('randomchat', 'UTF-8') 
    39 
    410from xmpp import (NS_DISCO_ITEMS, NS_DISCO_INFO, NS_REGISTER, NS_MUC, JID, \ 
     
    814from time import time 
    915from datetime import datetime 
    10 from os.path import join 
    11 from os import getcwd 
     16from os.path import join, isdir 
     17from os import getcwd, listdir 
    1218 
    1319import config 
     
    118124                # Log 
    119125                if config.LOG: 
    120                     file_ = open(join(getcwd(), 'logs', room), 'a') 
     126                    file_ = open('../logs/' + room, 'a') 
    121127 
    122128                    date = datetime.now().strftime('%d/%m/%Y %H:%M:%S') 
     
    151157                    [ 
    152158                        Node('reason', 
    153                            payload = ['Votre interlocuteur a quitté le salon'] )  
     159                           payload = [_('Your interlocutor just leave the room.')] )  
    154160                    ]) 
    155161                ]) 
     
    222228    def invite(self, room, jid): 
    223229        invite = Message(to=jid, frm=room + '@' + self.jid,  
    224           body = 'Vous avez été invité dans le salon ' + room + '@' + self.jid
     230          body = _('You have been invited in the room %s.' % (room + '@' + self.jid) )
    225231          payload =  
    226232          [  
     
    282288        self.con.RegisterHandler('message', self.message_handler) 
    283289 
     290        # Prepare informations for disco. 
    284291        b = browser.Browser() 
    285292        b.PlugIn(self.con) 
     
    349356        if not self.init_chat(msg.getFrom()): 
    350357            con.send(Message(to=msg.getFrom(), frm=msg.getTo(), 
    351                              body='Pas de participant trouvé'
     358                             body=_('No participant found.')
    352359                             typ=msg.getType())) 
    353360