* 'install.sh'
- Install also message objects.
* 'VirtualMailManager/Account.py'
* 'VirtualMailManager/Alias.py'
* 'VirtualMailManager/Config.py'
* 'VirtualMailManager/Domain.py'
* 'VirtualMailManager/MailLocation.py'
* 'VirtualMailManager/Transport.py'
* 'VirtualMailManager/VirtualMailManager.py'
* 'vmm'
- added i18n support
* 'po/vmm.pot'
* 'po/de.po'
- added to repository
--- a/ChangeLog Sat May 10 02:56:33 2008 +0000
+++ b/ChangeLog Tue May 13 03:20:02 2008 +0000
@@ -1,4 +1,14 @@
=== 0.0.0 ===
+2008-05-13 Pascal Volk <neverseen@users.sourceforge.net>
+
+ * VirtualMailManager/Alias.py, VirtualMailManager/MailLocation.py,
+ VirtualMailManager/Account.py, VirtualMailManager/Transport.py,
+ VirtualMailManager/VirtualMailManager.py, VirtualMailManager/Config.py,
+ VirtualMailManager/Domain.py, vmm:
+ Added i18n (gettext) support
+ * install.sh:
+ +Install message objects
+
2008-05-01 Pascal Volk <neverseen@users.sourceforge.net>
* VirtualMailManager/VirtualMailManager.py (VirtualMailManager.__chkenv()):
--- a/VirtualMailManager/Account.py Sat May 10 02:56:33 2008 +0000
+++ b/VirtualMailManager/Account.py Tue May 13 03:20:02 2008 +0000
@@ -13,12 +13,18 @@
__revision__ = 'rev '+'$Rev$'.split()[1]
__date__ = '$Date$'.split()[1]
+import gettext
+
from Exceptions import VMMAccountException
from Domain import Domain
from Transport import Transport
from MailLocation import MailLocation
import constants.ERROR as ERR
+gettext.bindtextdomain('vmm', '/usr/local/share/locale')
+gettext.textdomain('vmm')
+_ = gettext.gettext
+
class Account:
"""Class to manage e-mail accounts."""
def __init__(self, dbh, address, password=None):
@@ -36,7 +42,7 @@
self._exists()
if self._isAlias():
raise VMMAccountException(
- ('There is already an alias with address »%s«' % address,
+ (_('There is already an alias with address »%s«') % address,
ERR.ALIAS_EXISTS))
def _exists(self):
@@ -68,8 +74,9 @@
dom = Domain(self._dbh, d)
self._gid = dom.getID()
if self._gid == 0:
- raise VMMAccountException(("Domain »%s« doesn't exist." % d,
- ERR.NO_SUCH_DOMAIN))
+ #raise VMMAccountException(("Domain »%s« doesn't exist." % d,
+ errmsg = _('Domain »%s« does not exists.')
+ raise VMMAccountException((errmsg % d, ERR.NO_SUCH_DOMAIN))
self._base = dom.getDir()
self._tid = dom.getTransportID()
--- a/VirtualMailManager/Alias.py Sat May 10 02:56:33 2008 +0000
+++ b/VirtualMailManager/Alias.py Tue May 13 03:20:02 2008 +0000
@@ -13,10 +13,16 @@
__revision__ = 'rev '+'$Rev$'.split()[1]
__date__ = '$Date$'.split()[1]
+import gettext
+
from Exceptions import VMMAliasException
from Domain import Domain
import constants.ERROR as ERR
+gettext.bindtextdomain('vmm', '/usr/local/share/locale')
+gettext.textdomain('vmm')
+_ = gettext.gettext
+
class Alias:
"""Class to manage e-mail accounts."""
def __init__(self, dbh, address, destination=None):
--- a/VirtualMailManager/Config.py Sat May 10 02:56:33 2008 +0000
+++ b/VirtualMailManager/Config.py Tue May 13 03:20:02 2008 +0000
@@ -17,6 +17,7 @@
__date__ = '$Date$'.split()[1]
import sys
+import gettext
from shutil import copy2
from ConfigParser import ConfigParser
from cStringIO import StringIO
@@ -24,6 +25,10 @@
from Exceptions import VMMConfigException
import constants.ERROR as ERR
+gettext.bindtextdomain('vmm', '/usr/local/share/locale')
+gettext.textdomain('vmm')
+_ = gettext.gettext
+
class VMMConfig(ConfigParser):
"""This class is for configure the Virtual Mail Manager.
--- a/VirtualMailManager/Domain.py Sat May 10 02:56:33 2008 +0000
+++ b/VirtualMailManager/Domain.py Tue May 13 03:20:02 2008 +0000
@@ -13,6 +13,7 @@
__revision__ = 'rev '+'$Rev$'.split()[1]
__date__ = '$Date$'.split()[1]
+import gettext
from random import choice
from Exceptions import VMMDomainException
@@ -21,6 +22,10 @@
MAILDIR_CHARS = '0123456789abcdefghijklmnopqrstuvwxyz'
+gettext.bindtextdomain('vmm', '/usr/local/share/locale')
+gettext.textdomain('vmm')
+_ = gettext.gettext
+
class Domain:
"""Class to manage e-mail domains."""
def __init__(self, dbh, domainname, basedir=None, transport=None):
--- a/VirtualMailManager/Exceptions.py Sat May 10 02:56:33 2008 +0000
+++ b/VirtualMailManager/Exceptions.py Tue May 13 03:20:02 2008 +0000
@@ -14,31 +14,31 @@
__date__ = '$Date$'.split()[1]
class VMMException(Exception):
- """Ausnahmeklasse für die Klasse VirtualMailManager"""
+ """Exception class for VirtualMailManager exceptions"""
def __init__(self, msg):
Exception.__init__(self, msg)
class VMMConfigException(Exception):
- """Ausnahmeklasse für Konfigurationssausnamhem"""
+ """Exception class for Configurtion exceptions"""
def __init__(self, msg):
Exception.__init__(self, msg)
class VMMPermException(Exception):
- """Ausnahmeklasse für Berechtigungsausnamhem"""
+ """Exception class for permissions exceptions"""
pass
class VMMNotRootException(Exception):
- """Ausnahmeklasse für unberechtige Zugriffe"""
+ """Exception class for non-root exceptions"""
def __init__(self, msg):
Exception.__init__(self, msg)
class VMMDomainException(VMMException):
- """Ausnahmeklasse für Domainausnamhem"""
+ """Exception class for Domain exceptions"""
def __init__(self, msg):
VMMException.__init__(self, msg)
class VMMAccountException(VMMException):
- """Ausnahmeklasse für Accountausnamhem"""
+ """Exception class for Account exceptions"""
def __init__(self, msg):
VMMException.__init__(self, msg)
--- a/VirtualMailManager/MailLocation.py Sat May 10 02:56:33 2008 +0000
+++ b/VirtualMailManager/MailLocation.py Tue May 13 03:20:02 2008 +0000
@@ -14,10 +14,15 @@
__revision__ = 'rev '+'$Rev$'.split()[1]
__date__ = '$Date$'.split()[1]
+import gettext
from Exceptions import VMMMailLocationException as MLE
import constants.ERROR as ERR
+gettext.bindtextdomain('vmm', '/usr/local/share/locale')
+gettext.textdomain('vmm')
+_ = gettext.gettext
+
class MailLocation:
"""A wrapper class thats provide access to the maillocation table"""
def __init__(self, dbh, mid=None, maillocation=None):
--- a/VirtualMailManager/Transport.py Sat May 10 02:56:33 2008 +0000
+++ b/VirtualMailManager/Transport.py Tue May 13 03:20:02 2008 +0000
@@ -14,9 +14,15 @@
__revision__ = 'rev '+'$Rev$'.split()[1]
__date__ = '$Date$'.split()[1]
+import gettext
+
from Exceptions import VMMTransportException
import constants.ERROR as ERR
+gettext.bindtextdomain('vmm', '/usr/local/share/locale')
+gettext.textdomain('vmm')
+_ = gettext.gettext
+
class Transport:
"""A wrapper class thats provide access to the transport table"""
def __init__(self, dbh, tid=None, transport=None):
--- a/VirtualMailManager/VirtualMailManager.py Sat May 10 02:56:33 2008 +0000
+++ b/VirtualMailManager/VirtualMailManager.py Tue May 13 03:20:02 2008 +0000
@@ -16,6 +16,7 @@
import os
import re
import sys
+import gettext
from encodings.idna import ToASCII, ToUnicode
from shutil import rmtree
from subprocess import Popen, PIPE
@@ -40,6 +41,10 @@
ENCODING_IN = sys.getfilesystemencoding()
ENCODING_OUT = sys.stdout.encoding or sys.getfilesystemencoding()
+gettext.bindtextdomain('vmm', '/usr/local/share/locale')
+gettext.textdomain('vmm')
+_ = gettext.gettext
+
class VirtualMailManager:
"""The main class for vmm"""
def __init__(self):
@@ -47,14 +52,14 @@
Throws a VMMNotRootException if your uid is greater 0.
"""
self.__cfgFileName = '/usr/local/etc/vmm.cfg'
- self.__permWarnMsg = "fix permissions for '%s'\n`chmod 0600 %s` would\
- be great." % (self.__cfgFileName, self.__cfgFileName)
+ self.__permWarnMsg = _("fix permissions for '%s'\n`chmod 0600 %s` would\
+ be great.") % (self.__cfgFileName, self.__cfgFileName)
self.__warnings = []
self.__Cfg = None
self.__dbh = None
if os.geteuid():
- raise VMMNotRootException(("You are not root.\n\tGood bye!\n",
+ raise VMMNotRootException((_("You are not root.\n\tGood bye!\n"),
ERR.CONF_NOPERM))
if self.__chkCfgFile():
self.__Cfg = Cfg(self.__cfgFileName)
@@ -68,7 +73,7 @@
def __chkCfgFile(self):
"""Checks the configuration file, returns bool"""
if not os.path.isfile(self.__cfgFileName):
- raise VMMException(("The file »%s« does not exists." %
+ raise VMMException((_("The file »%s« does not exists.") %
self.__cfgFileName, ERR.CONF_NOFILE))
fstat = os.stat(self.__cfgFileName)
try:
@@ -90,14 +95,14 @@
self.__Cfg.getint('misc', 'gid_mail'))
os.umask(old_umask)
elif not os.path.isdir(self.__Cfg.get('domdir', 'base')):
- raise VMMException(('%s is not a directory' %
+ raise VMMException((_('%s is not a directory') %
self.__Cfg.get('domdir', 'base'), ERR.NO_SUCH_DIRECTORY))
for opt, val in self.__Cfg.items('bin'):
if not os.path.exists(val):
- raise VMMException(("%s doesn't exists." % val,
+ raise VMMException((_("%s doesn't exists.") % val,
ERR.NO_SUCH_BINARY))
elif not os.access(val, os.X_OK):
- raise VMMException(("%s is not executable." % val,
+ raise VMMException((_("%s is not executable.") % val,
ERR.NOT_EXECUTABLE))
def __getFileMode(self):
@@ -131,12 +136,12 @@
localpart -- the e-mail address that should be validated (str)
"""
if len(localpart) > 64:
- raise VMMException(('The local part is too long',
+ raise VMMException((_('The local part is too long'),
ERR.LOCALPART_TOO_LONG))
if re.compile(RE_LOCALPART).search(localpart):
raise VMMException((
- 'The local part »%s« contains invalid characters.' % localpart,
- ERR.LOCALPART_INVALID))
+ _('The local part »%s« contains invalid characters.') %
+ localpart, ERR.LOCALPART_INVALID))
return localpart
def __idn2ascii(self, domainname):
@@ -174,10 +179,10 @@
if not re.match(RE_ASCII_CHARS, domainname):
domainname = self.__idn2ascii(domainname)
if len(domainname) > 255:
- raise VMMException(('The domain name is too long.',
+ raise VMMException((_('The domain name is too long.'),
ERR.DOMAIN_TOO_LONG))
if not re.match(RE_DOMAIN, domainname):
- raise VMMException(('The domain name is invalid.',
+ raise VMMException((_('The domain name is invalid.'),
ERR.DOMAIN_INVALID))
return domainname
@@ -185,10 +190,10 @@
try:
localpart, domain = address.split('@')
except ValueError:
- raise VMMException(("Missing '@' sign in e-mail address »%s«." %
+ raise VMMException((_("Missing '@' sign in e-mail address »%s«.") %
address, ERR.INVALID_ADDRESS))
except AttributeError:
- raise VMMException(("»%s« looks not like an e-mail address." %
+ raise VMMException((_("»%s« looks not like an e-mail address.") %
address, ERR.INVALID_ADDRESS))
domain = self.__chkDomainname(domain)
localpart = self.__chkLocalpart(localpart)
@@ -283,16 +288,16 @@
if uid > 0 and gid > 0:
maildir = '%s' % uid
if maildir.count('..') or domdir.count('..'):
- raise VMMException(('FATAL: ".." in maildir path detected.',
+ raise VMMException((_('FATAL: ".." in maildir path detected.'),
ERR.FOUND_DOTS_IN_PATH))
if os.path.isdir(domdir):
os.chdir(domdir)
if os.path.isdir(maildir):
mdstat = os.stat(maildir)
if (mdstat.st_uid, mdstat.st_gid) != (uid, gid):
- raise VMMException(
- ('FATAL: owner/group mismatch in maildir detected',
- ERR.MAILDIR_PERM_MISMATCH))
+ raise VMMException((
+ _('FATAL: owner/group mismatch in maildir detected'),
+ ERR.MAILDIR_PERM_MISMATCH))
rmtree(maildir, ignore_errors=True)
def __domdirdelete(self, domdir, gid):
@@ -301,13 +306,13 @@
domdirdirs = domdir.replace(basedir+'/', '').split('/')
if basedir.count('..') or domdir.count('..'):
raise VMMException(
- ('FATAL: ".." in domain directory path detected.',
+ (_('FATAL: ".." in domain directory path detected.'),
ERR.FOUND_DOTS_IN_PATH))
if os.path.isdir('%s/%s' % (basedir, domdirdirs[0])):
os.chdir('%s/%s' % (basedir, domdirdirs[0]))
if os.lstat(domdirdirs[1]).st_gid != gid:
raise VMMException(
- ('FATAL: group mismatch in domain directory detected',
+ (_('FATAL: group mismatch in domain directory detected'),
ERR.DOMAINDIR_GROUP_MISMATCH))
rmtree(domdirdirs[1], ignore_errors=True)
@@ -385,9 +390,9 @@
try:
return self.__Cfg.getboolean('config', 'done')
except ValueError, e:
- raise VMMConfigException('Configurtion error: "'+str(e)
- +'"\n(in section "Connfig", option "done")'
- +'\nsee also: vmm.cfg(5)\n')
+ raise VMMConfigException(_("""Configurtion error: "%s"
+(in section "connfig", option "done")'
+see also: vmm.cfg(5)\n""") % str(e))
def configure(self, section=None):
"""Starts interactive configuration.
@@ -404,7 +409,7 @@
if not section:
self.__Cfg.configure(self.__cfgSections)
elif section not in self.__cfgSections:
- raise VMMException(("Invalid section: »%s«" % section,
+ raise VMMException((_("Invalid section: »%s«") % section,
ERR.INVALID_SECTION))
else:
self.__Cfg.configure([section])
@@ -418,7 +423,7 @@
def domain_transport(self, domainname, transport, force=None):
if force is not None and force != 'force':
- raise VMMDomainException(('Invalid argument: »%s«' % force,
+ raise VMMDomainException((_('Invalid argument: »%s«') % force,
ERR.INVALID_OPTION))
dom = self.__getDomain(domainname, None)
if force is None:
@@ -428,7 +433,7 @@
def domain_delete(self, domainname, force=None):
if not force is None and force not in ['deluser','delalias','delall']:
- raise VMMDomainException(('Invalid argument: »%s«' % force,
+ raise VMMDomainException((_('Invalid argument: »%s«') % force,
ERR.INVALID_OPTION))
dom = self.__getDomain(domainname)
gid = dom.getID()
@@ -457,8 +462,8 @@
elif detailed == 'detailed':
return dominfo, dom.getAccounts(), dom.getAliases()
else:
- raise VMMDomainException(('Invalid argument: »%s«' % detailed,
- ERR.INVALID_OPTION))
+ raise VMMDomainException(('%s: »%s«' % (_('Invalid argument'),
+ detailed), ERR.INVALID_OPTION))
def user_add(self, emailaddress, password):
acc = self.__getAccount(emailaddress, password)
--- a/install.sh Sat May 10 02:56:33 2008 +0000
+++ b/install.sh Tue May 13 03:20:02 2008 +0000
@@ -9,6 +9,7 @@
PREFIX=/usr/local
PF_CONFDIR=$(postconf -h config_directory)
PF_GID=$(id -g $(postconf -h mail_owner))
+LOCALE_DIR=${PREFIX}/share/locale
DOC_DIR=${PREFIX}/share/doc/vmm
MAN1DIR=${PREFIX}/share/man/man1
MAN5DIR=${PREFIX}/share/man/man5
@@ -37,6 +38,16 @@
install ${INSTALL_OPTS_CF} pgsql-*.cf ${PF_CONFDIR}/
install -m 0700 ${INSTALL_OPTS} vmm ${PREFIX}/sbin
+[ -d ${LOCALE_DIR} ] || mkdir -m 0755 -p ${LOCALE_DIR}
+cd po
+for po in $(ls -1 *.po); do
+ lang=$(basename ${po} .po)
+ ddir=${LOCALE_DIR}/${lang}/LC_MESSAGES
+ [ -d ${ddir} ] || mkdir -m 0755 -p ${ddir}
+ msgfmt -o ${LOCALE_DIR}/${lang}/LC_MESSAGES/vmm.mo ${po}
+done
+cd -
+
[ -d ${MAN1DIR} ] || mkdir -m 0755 -p ${MAN1DIR}
install -m 0644 ${INSTALL_OPTS} vmm.1 ${MAN1DIR}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/po/de.po Tue May 13 03:20:02 2008 +0000
@@ -0,0 +1,239 @@
+# German translations for vmm package.
+# Copyright (C) 2008 VEB IT
+# Pascal Volk <p.volk@veb-it.de>, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vmm 0.4\n"
+"POT-Creation-Date: 2008-05-13 03:54+CEST\n"
+"PO-Revision-Date: 2008-05-13 04:55+0200\n"
+"Last-Translator: Pascal Volk <p.volk@veb-it.de>\n"
+"Language-Team: German\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: pygettext.py 1.5\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: VirtualMailManager/Account.py:45
+msgid "There is already an alias with address »%s«"
+msgstr "Es gibt bereits einen Alias mit der Adresse »%s«"
+
+#: VirtualMailManager/Account.py:78
+msgid "Domain »%s« does not exists."
+msgstr "Die Domain »%s« existiert nicht."
+
+#: VirtualMailManager/VirtualMailManager.py:55
+msgid ""
+"fix permissions for '%s'\n"
+"`chmod 0600 %s` would be great."
+msgstr ""
+"Bitte Zugriffsrechte für '%s' anpassen\n"
+"`chmod 0600 %s` wäre großartig"
+
+#: VirtualMailManager/VirtualMailManager.py:62
+msgid ""
+"You are not root.\n"
+"\tGood bye!\n"
+msgstr ""
+"Sie sind nicht root\n"
+"\tAuf Wiedersehen\n"
+
+#: VirtualMailManager/VirtualMailManager.py:76
+msgid "The file »%s« does not exists."
+msgstr "Die Datei »%s« existiert nicht."
+
+#: VirtualMailManager/VirtualMailManager.py:98
+msgid "%s is not a directory"
+msgstr "%s ist kein Verzeichnis"
+
+#: VirtualMailManager/VirtualMailManager.py:102
+msgid "%s doesn't exists."
+msgstr "%s existiert nicht."
+
+#: VirtualMailManager/VirtualMailManager.py:105
+msgid "%s is not executable."
+msgstr "%s ist nicht ausführbar."
+
+#: VirtualMailManager/VirtualMailManager.py:139
+msgid "The local part is too long"
+msgstr "Der local-part ist zu lang"
+
+#: VirtualMailManager/VirtualMailManager.py:143
+msgid "The local part »%s« contains invalid characters."
+msgstr "Der local-part »%s« enthält ungültige Zeichen."
+
+#: VirtualMailManager/VirtualMailManager.py:182
+msgid "The domain name is too long."
+msgstr "Der Domain-Name ist zu lang."
+
+#: VirtualMailManager/VirtualMailManager.py:185
+msgid "The domain name is invalid."
+msgstr "Der Domain-Name ist ungültig."
+
+#: VirtualMailManager/VirtualMailManager.py:193
+msgid "Missing '@' sign in e-mail address »%s«."
+msgstr "In der E-Mail-Adresse »%s« fehlt das '@'-Zeichen."
+
+#: VirtualMailManager/VirtualMailManager.py:196
+msgid "»%s« looks not like an e-mail address."
+msgstr "»%s« sieht nicht wie eine E-Mail-Adresse aus."
+
+#: VirtualMailManager/VirtualMailManager.py:291
+msgid "FATAL: \"..\" in maildir path detected."
+msgstr "FATAL: \"..\" im Pfad zum Maildir entdeckt."
+
+#: VirtualMailManager/VirtualMailManager.py:299
+msgid "FATAL: owner/group mismatch in maildir detected"
+msgstr "FATAL: Maildir gehört dem/der falschen Benutzer/Gruppe."
+
+#: VirtualMailManager/VirtualMailManager.py:309
+msgid "FATAL: \"..\" in domain directory path detected."
+msgstr "FATAL: \"..\" im Pfad zum Domain-Verzeichnis entdeckt."
+
+#: VirtualMailManager/VirtualMailManager.py:315
+msgid "FATAL: group mismatch in domain directory detected"
+msgstr "FATAL: Domain-Verzeichnis gehört der falschen Gruppe"
+
+#: VirtualMailManager/VirtualMailManager.py:393
+msgid ""
+"Configurtion error: \"%s\"\n"
+"(in section \"connfig\", option \"done\")'\n"
+"see also: vmm.cfg(5)\n"
+msgstr ""
+"Konfigurations Fehler: \"%s\"\n"
+"(in Sektion \"connfig\", Option \"done\")'\n"
+"Siehe auch: vmm.cfg(5)\n"
+
+#: VirtualMailManager/VirtualMailManager.py:412
+msgid "Invalid section: »%s«"
+msgstr "Ungültiges Sektion: »%s«"
+
+#: VirtualMailManager/VirtualMailManager.py:426
+#: VirtualMailManager/VirtualMailManager.py:436
+msgid "Invalid argument: »%s«"
+msgstr "Ungültiges Argument: »%s«"
+
+#: VirtualMailManager/VirtualMailManager.py:465
+msgid "Invalid argument"
+msgstr "Ungültiges Argument"
+
+#: vmm:34
+msgid ""
+"Usage: %s SUBCOMMAND OBJECT ARGS*\n"
+" short long\n"
+" subcommand object args (* = optional)\n"
+"\n"
+msgstr ""
+"Verwendung: %s UNTERBEFEHL OBJEKT ARGS*\n"
+" kurz lang\n"
+" Unterbefehl Objekt args (* = optional)\n"
+"\n"
+
+#: vmm:61 vmm:70 vmm:363
+msgid "Error"
+msgstr "Fehler"
+
+#: vmm:80 vmm:360
+msgid "Ouch"
+msgstr "Autsch"
+
+#: vmm:92
+msgid "Enter new password: "
+msgstr "Neues Passwort eingeben: "
+
+#: vmm:95
+msgid "Sorry, empty passwords are not permitted"
+msgstr "Entschuldigung, leere Passwörter sind nicht zulässig"
+
+#: vmm:96
+msgid "Retype new password: "
+msgstr "Neues Passwort wiederholen: "
+
+#: vmm:99
+msgid "Sorry, passwords do not match"
+msgstr "Entschuldigung, die Passwörter stimmen nicht überein"
+
+#: vmm:123
+msgid "information"
+msgstr "Informationen"
+
+#: vmm:133
+msgid "Available"
+msgstr "Verfügbare"
+
+#: vmm:139 vmm:150
+msgid "\tNone"
+msgstr "\tKeine"
+
+#: vmm:143
+msgid "Alias information"
+msgstr "Alias Informationen"
+
+#: vmm:145
+msgid "\tMail for %s goes to:"
+msgstr "\tE-Mails für %s gehen an:"
+
+#: vmm:156 vmm:165 vmm:174
+msgid "Missing domain name."
+msgstr "Kein Domain-Name angegeben."
+
+#: vmm:180
+msgid "accounts"
+msgstr "Accounts"
+
+#: vmm:181
+msgid "aliases"
+msgstr "Aliase"
+
+#: vmm:186
+msgid "Missing domain name and new transport."
+msgstr "Domain-Name und neuer Transport fehlen."
+
+#: vmm:188
+msgid "Missing new transport."
+msgstr "Neuer Transport fehlt."
+
+#: vmm:197 vmm:207 vmm:214 vmm:241 vmm:250 vmm:259
+msgid "Missing e-mail address."
+msgstr "E-Mail-Adresse fehlt."
+
+#: vmm:223
+msgid "Missing e-mail address and users name."
+msgstr "E-Mail-Adresse und der Name des Benutzers fehlen."
+
+#: vmm:225
+msgid "Missing users name."
+msgstr "Name des Benutzers fehlt."
+
+#: vmm:232
+msgid "Missing e-mail address and transport."
+msgstr "E-Mail-Adresse und Transport fehlen."
+
+#: vmm:234
+msgid "Missing transport."
+msgstr "Transport fehlt."
+
+#: vmm:269
+msgid "Missing alias address and destination."
+msgstr "Alias- und Ziel-Adresse fehlen."
+
+#: vmm:276 vmm:283
+msgid "Missing alias address"
+msgstr "Alias-Adresse fehlt."
+
+#: vmm:292
+msgid "Missing userid"
+msgstr "Keine UID angegeben."
+
+#: vmm:298
+msgid ""
+"\n"
+"Warnings:"
+msgstr ""
+"\n"
+"Warnungen:"
+
+#: vmm:357
+msgid "Unknown subcommand"
+msgstr "Unbekannter Unterbefehl"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/po/vmm.pot Tue May 13 03:20:02 2008 +0000
@@ -0,0 +1,227 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2008 VEB IT
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2008-05-13 03:54+CEST\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: ENCODING\n"
+"Generated-By: pygettext.py 1.5\n"
+
+
+#: VirtualMailManager/Account.py:45
+msgid "There is already an alias with address \302\273%s\302\253"
+msgstr ""
+
+#: VirtualMailManager/Account.py:78
+msgid "Domain \302\273%s\302\253 does not exists."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:55
+msgid ""
+"fix permissions for '%s'\n"
+"`chmod 0600 %s` would be great."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:62
+msgid ""
+"You are not root.\n"
+"\tGood bye!\n"
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:76
+msgid "The file \302\273%s\302\253 does not exists."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:98
+msgid "%s is not a directory"
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:102
+msgid "%s doesn't exists."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:105
+msgid "%s is not executable."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:139
+msgid "The local part is too long"
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:143
+msgid "The local part \302\273%s\302\253 contains invalid characters."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:182
+msgid "The domain name is too long."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:185
+msgid "The domain name is invalid."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:193
+msgid "Missing '@' sign in e-mail address \302\273%s\302\253."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:196
+msgid "\302\273%s\302\253 looks not like an e-mail address."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:291
+msgid "FATAL: \"..\" in maildir path detected."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:299
+msgid "FATAL: owner/group mismatch in maildir detected"
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:309
+msgid "FATAL: \"..\" in domain directory path detected."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:315
+msgid "FATAL: group mismatch in domain directory detected"
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:393
+msgid ""
+"Configurtion error: \"%s\"\n"
+"(in section \"connfig\", option \"done\")'\n"
+"see also: vmm.cfg(5)\n"
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:412
+msgid "Invalid section: \302\273%s\302\253"
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:426
+#: VirtualMailManager/VirtualMailManager.py:436
+msgid "Invalid argument: \302\273%s\302\253"
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:465
+msgid "Invalid argument"
+msgstr ""
+
+#: vmm:34
+msgid ""
+"Usage: %s SUBCOMMAND OBJECT ARGS*\n"
+" short long\n"
+" subcommand object args (* = optional)\n"
+"\n"
+msgstr ""
+
+#: vmm:61 vmm:70 vmm:363
+msgid "Error"
+msgstr ""
+
+#: vmm:80 vmm:360
+msgid "Ouch"
+msgstr ""
+
+#: vmm:92
+msgid "Enter new password: "
+msgstr ""
+
+#: vmm:95
+msgid "Sorry, empty passwords are not permitted"
+msgstr ""
+
+#: vmm:96
+msgid "Retype new password: "
+msgstr ""
+
+#: vmm:99
+msgid "Sorry, passwords do not match"
+msgstr ""
+
+#: vmm:123
+msgid "information"
+msgstr ""
+
+#: vmm:133
+msgid "Available"
+msgstr ""
+
+#: vmm:139 vmm:150
+msgid "\tNone"
+msgstr ""
+
+#: vmm:143
+msgid "Alias information"
+msgstr ""
+
+#: vmm:145
+msgid "\tMail for %s goes to:"
+msgstr ""
+
+#: vmm:156 vmm:165 vmm:174
+msgid "Missing domain name."
+msgstr ""
+
+#: vmm:180
+msgid "accounts"
+msgstr ""
+
+#: vmm:181
+msgid "aliases"
+msgstr ""
+
+#: vmm:186
+msgid "Missing domain name and new transport."
+msgstr ""
+
+#: vmm:188
+msgid "Missing new transport."
+msgstr ""
+
+#: vmm:197 vmm:207 vmm:214 vmm:241 vmm:250 vmm:259
+msgid "Missing e-mail address."
+msgstr ""
+
+#: vmm:223
+msgid "Missing e-mail address and users name."
+msgstr ""
+
+#: vmm:225
+msgid "Missing users name."
+msgstr ""
+
+#: vmm:232
+msgid "Missing e-mail address and transport."
+msgstr ""
+
+#: vmm:234
+msgid "Missing transport."
+msgstr ""
+
+#: vmm:269
+msgid "Missing alias address and destination."
+msgstr ""
+
+#: vmm:276 vmm:283
+msgid "Missing alias address"
+msgstr ""
+
+#: vmm:292
+msgid "Missing userid"
+msgstr ""
+
+#: vmm:298
+msgid ""
+"\n"
+"Warnings:"
+msgstr ""
+
+#: vmm:357
+msgid "Unknown subcommand"
+msgstr ""
+
--- a/vmm Sat May 10 02:56:33 2008 +0000
+++ b/vmm Tue May 13 03:20:02 2008 +0000
@@ -15,21 +15,27 @@
import os
import sys
+import gettext
from getpass import getpass
from VirtualMailManager.VirtualMailManager import VirtualMailManager
from VirtualMailManager.Config import VMMConfig
import VirtualMailManager.Exceptions as VMME
import VirtualMailManager.constants.EXIT as EXIT
+import VirtualMailManager.constants.ERROR as ERR
__prog__ = os.path.basename(sys.argv[0])
+gettext.bindtextdomain(__prog__, '/usr/local/share/locale')
+gettext.textdomain(__prog__)
+_ = gettext.gettext
+
def usage(excode=0, errMsg=None):
- sys.stderr.write("""\
+ sys.stderr.write(_("""\
Usage: %s SUBCOMMAND OBJECT ARGS*
short long
- subcommand object args (* = optional)
-
+ subcommand object args (* = optional)\n\n""")% __prog__)
+ sys.stderr.write("""\
da domainadd domain.tld transport*
di domaininfo domain.tld detailed*
dt domaintransport domain.tld transport force*
@@ -50,9 +56,9 @@
h help
v version
-""" % __prog__)
+""")
if not errMsg is None:
- sys.stderr.write('Error: %s\n' % errMsg)
+ sys.stderr.write('%s: %s\n' % (_('Error'), errMsg))
sys.exit(excode)
def getVMM():
@@ -61,7 +67,7 @@
return vmm
except (VMME.VMMException, VMME.VMMNotRootException, VMME.VMMPermException,
VMME.VMMConfigException), e:
- sys.stderr.write("\aERROR: %s\n" % e[0][0])
+ sys.stderr.write("\a%s: %s\n" % (_('Error'),e[0][0]))
sys.exit(e[0][1])
def configure():
@@ -71,11 +77,11 @@
else:
vmm.configure(sys.argv[2])
except (EOFError, KeyboardInterrupt):
- sys.stderr.write('\nOuch!\n')
+ sys.stderr.write('\n%s!\n' % _('Ouch'))
sys.exit(EXIT.USER_INTERRUPT)
except VMME.VMMConfigException, e:
sys.stderr.write(str(e))
- sys.exit(EXIT.CONF_ERROR)
+ sys.exit(ERR.CONF_ERROR)
sys.exit(0)
def _readpass():
@@ -83,13 +89,14 @@
clear1 = '1'
while clear0 != clear1:
while len(clear0) < 1:
- clear0 = getpass(prompt='Enter new password: ')
+ clear0 = getpass(prompt=_('Enter new password: '))
if len(clear0) < 1:
- sys.stderr.write('Sorry, empty passwords are not permitted\n')
- clear1 = getpass(prompt='Retype new password: ')
+ sys.stderr.write('%s\n'
+ % _('Sorry, empty passwords are not permitted'))
+ clear1 = getpass(prompt=_('Retype new password: '))
if clear0 != clear1:
clear0 = ''
- sys.stderr.write('Sorry, passwords do not match\n')
+ sys.stderr.write('%s\n' % _('Sorry, passwords do not match'))
return clear0
def _getOrder():
@@ -113,7 +120,7 @@
def _printInfo(info, title):
- msg = title+' information'
+ msg = '%s %s' % (title, _('information'))
print '%s\n%s' % (msg, '-'*len(msg))
for k,u in _getOrder():
if u:
@@ -123,30 +130,30 @@
print
def _printUsers(users, title):
- msg = 'Available '+title
+ msg = '%s %s' % (_('Available'), title)
print '%s\n%s' % (msg, '-'*len(msg))
if len(users) > 0:
for user in users:
print '\t%s' % user
else:
- print '\tNone'
+ print _('\tNone')
print
def _printAliases(alias, targets):
- msg = 'Alias information'
+ msg = _('Alias information')
print '%s\n%s' % (msg, '-'*len(msg))
- print '\tMail for %s goes to:' % alias
+ print _('\tMail for %s goes to:') % alias
if len(targets) > 0:
for target in targets:
print '\t -> %s' % target
else:
- print '\tNone'
+ print _('\tNone')
print
def domain_add():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing domain name.')
+ usage(EXIT.MISSING_ARGS, _('Missing domain name.'))
elif argc < 4:
vmm.domain_add(sys.argv[2].lower())
else:
@@ -155,7 +162,7 @@
def domain_delete():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing domain name.')
+ usage(EXIT.MISSING_ARGS, _('Missing domain name.'))
elif argc < 4:
vmm.domain_delete(sys.argv[2].lower())
else:
@@ -164,21 +171,21 @@
def domain_info():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing domain name.')
+ usage(EXIT.MISSING_ARGS, _('Missing domain name.'))
elif argc < 4:
_printInfo(vmm.domain_info(sys.argv[2].lower()), 'Domain')
else:
infos = vmm.domain_info(sys.argv[2].lower(), sys.argv[3])
_printInfo(infos[0], 'Domain')
- _printUsers(infos[1], 'accounts')
- _printUsers(infos[2], 'aliases')
+ _printUsers(infos[1], _('accounts'))
+ _printUsers(infos[2], _('aliases'))
def domain_transport():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing domain name and new transport.')
+ usage(EXIT.MISSING_ARGS, _('Missing domain name and new transport.'))
if argc < 4:
- usage(EXIT.MISSING_ARGS, 'Missing new transport.')
+ usage(EXIT.MISSING_ARGS, _('Missing new transport.'))
elif argc < 5:
vmm.domain_transport(sys.argv[2].lower(), sys.argv[3])
else:
@@ -187,7 +194,7 @@
def user_add():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing e-mail address.')
+ usage(EXIT.MISSING_ARGS, _('Missing e-mail address.'))
elif argc < 4:
password = _readpass()
else:
@@ -197,14 +204,14 @@
def user_delete():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing e-mail address.')
+ usage(EXIT.MISSING_ARGS, _('Missing e-mail address.'))
else:
vmm.user_delete(sys.argv[2].lower())
def user_info():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing e-mail address.')
+ usage(EXIT.MISSING_ARGS, _('Missing e-mail address.'))
elif argc < 4:
_printInfo(vmm.user_info(sys.argv[2].lower()), 'Account')
else:
@@ -213,25 +220,25 @@
def user_name():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing e-mail address and users name.')
+ usage(EXIT.MISSING_ARGS, _('Missing e-mail address and users name.'))
if argc < 4:
- usage(EXIT.MISSING_ARGS, 'Missing users name.')
+ usage(EXIT.MISSING_ARGS, _('Missing users name.'))
else:
vmm.user_name(sys.argv[2].lower(), sys.argv[3])
def user_transport():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing e-mail address and transport.')
+ usage(EXIT.MISSING_ARGS, _('Missing e-mail address and transport.'))
if argc <4:
- usage(EXIT.MISSING_ARGS, 'Missing transport.')
+ usage(EXIT.MISSING_ARGS, _('Missing transport.'))
else:
vmm.user_transport(sys.argv[2].lower(), sys.argv[3])
def user_enable():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing e-mail address.')
+ usage(EXIT.MISSING_ARGS, _('Missing e-mail address.'))
elif argc < 4:
vmm.user_enable(sys.argv[2].lower())
else:
@@ -240,7 +247,7 @@
def user_disable():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing e-mail address.')
+ usage(EXIT.MISSING_ARGS, _('Missing e-mail address.'))
elif argc < 4:
vmm.user_disable(sys.argv[2].lower())
else:
@@ -249,7 +256,7 @@
def user_password():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing e-mail address.')
+ usage(EXIT.MISSING_ARGS, _('Missing e-mail address.'))
elif argc < 4:
password = _readpass()
else:
@@ -259,21 +266,21 @@
def alias_add():
global argc
if argc < 4:
- usage(EXIT.MISSING_ARGS, 'Missing alias address and destination.')
+ usage(EXIT.MISSING_ARGS, _('Missing alias address and destination.'))
else:
vmm.alias_add(sys.argv[2].lower(), sys.argv[3])
def alias_info():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing alias address')
+ usage(EXIT.MISSING_ARGS, _('Missing alias address'))
else:
_printAliases(sys.argv[2], vmm.alias_info(sys.argv[2].lower()))
def alias_delete():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing alias address')
+ usage(EXIT.MISSING_ARGS, _('Missing alias address'))
elif argc < 4:
vmm.alias_delete(sys.argv[2].lower())
else:
@@ -282,13 +289,13 @@
def user_byID():
global argc
if argc < 3:
- usage(EXIT.MISSING_ARGS, 'Missing userid')
+ usage(EXIT.MISSING_ARGS, _('Missing userid'))
else:
_printInfo(vmm.user_byID(sys.argv[2]), 'Account')
def showWarnings():
if vmm.hasWarnings():
- print '\nWarnings:'
+ print _('\nWarnings:')
for w in vmm.getWarnings():
print " * ",w
@@ -303,7 +310,7 @@
configure()
except VMME.VMMConfigException, e:
sys.stderr.write(str(e))
- sys.exit(EXIT.CONF_ERROR)
+ sys.exit(ERR.CONF_ERROR)
except VMME.VMMException, e:
sys.stderr.write("\aERROR: %s\n" % e[0][0])
sys.exit(e[0][1])
@@ -347,11 +354,11 @@
__revision__, __date__)
else:
usage(EXIT.UNKNOWN_COMMAND,
- 'Unknown subcommand: »%s«' % sys.argv[1])
+ '%s: »%s«' % (_('Unknown subcommand'), sys.argv[1]))
showWarnings()
except (EOFError, KeyboardInterrupt):
- sys.stderr.write('\nOuch!\n')
+ sys.stderr.write('\n%s!\n' % _('Ouch'))
sys.exit(EXIT.USER_INTERRUPT)
except VMME.VMMException, e:
- sys.stderr.write("\aERROR: %s\n" % e[0][0])
+ sys.stderr.write("\a%s: %s\n" % (_('Error'), e[0][0]))
sys.exit(e[0][1])