diff options
| author | Barry Warsaw | 2007-07-16 23:55:49 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2007-07-16 23:55:49 -0400 |
| commit | b8e8aa0386c2ee0fc7e90bf22fbe8fe3f222964a (patch) | |
| tree | 5893e3908f89d8dd988c7844827d83e60ab6c532 /Mailman/docs | |
| parent | 327865eaf118f40063366acad9c7d97487e010d6 (diff) | |
| download | mailman-b8e8aa0386c2ee0fc7e90bf22fbe8fe3f222964a.tar.gz mailman-b8e8aa0386c2ee0fc7e90bf22fbe8fe3f222964a.tar.zst mailman-b8e8aa0386c2ee0fc7e90bf22fbe8fe3f222964a.zip | |
Major surgery to get the setuptools based installation passing all the
existing unit tests. Here's a summary of the changes.
- Removed all dependent third party packages, since the setup.py file now
claims all package dependencies such that they can be automatically
installed from the cheeseshop.
- Moved the misc directory into the Mailman package as Mailman/data. Moved
templates and messages to Mailman subpackages.
- Added an ILanguageManager interface, plus an implementation, so that
we don't use Defaults.LC_DESCRIPTIONS directly anymore. Added a doctest
for this interface and implementation. Defaults.LANGUAGES is moved into
mailman.cfg. Defaults.LANGUAGE_DICT is moved to _DEFAULT_LANGUAGE_DATA, and
LC_DESCRIPTIONS is removed. The calculation of the available and enabled
languages is moved to the Configuration class, but this will probably still
need work. Utils.GetLanguageDescr() and Utils.IsLanguage() are removed.
I'd like to remove GetCharSet() eventually too, but there are too many uses
of this currently, so I'm deferring it.
- Utils.findtext(): Hacks added so that templates can be retrieved from the
language catalog. The hack is that the template contents are used to find
the translation, but in the one test case where this is actually flexed, the
trailing newline in the file contents has to be trimmed. This is probably
not right.
- No more Defaults.py.in or mm_cfg.py! Defaults.py.in is moved to Defaults.py
and is no longer created from a template file. The script called
make_instance is added which creates an etc/mailman.cfg file from
mailman.cfg.in (previously, mailman.cfg.sample) and /that/ file now has the
small number of calculated values. In general, make_instance will not touch
mailman.cfg if it exists, unless the --force option is given. CGIEXT is
made the empty string by default (i.e. not generated). make_instance grows
a --var-dir option. Fleshed out the --languages opton.
- Defaults.py grows a DEFAULT_VAR_DIRECTORY variable, which is the default
location of the 'var' directory. The Configuration class uses this as one
of the directories it searches for its landmark, i.e. etc/mailman.cfg.
RUNTIME_DIR is gone, as is VAR_PREFIX.
- testall needs to write MAILMAN_USER, MAILMAN_UID, MAILMAN_GROUP,
MAILMAN_GID, and LANGUAGES run time variables.
- bin/withlist no longer needs to add config.BIN_DIR to sys.path, because in
fact that variable doesn't exist any more.
- Tweak the French catalog to make a test work. This is needed because of the
conversion from %-strings to $-strings.
- The setup.py now generates the .mo files before it does its thing. This
will have to be fixed, but for now we must generate these files on setup
build time instead of installation time.
- Removed an unused interface.
Diffstat (limited to 'Mailman/docs')
| -rw-r--r-- | Mailman/docs/acknowledge.txt | 1 | ||||
| -rw-r--r-- | Mailman/docs/digests.txt | 15 | ||||
| -rw-r--r-- | Mailman/docs/languages.txt | 94 |
3 files changed, 109 insertions, 1 deletions
diff --git a/Mailman/docs/acknowledge.txt b/Mailman/docs/acknowledge.txt index 82fdd3fd3..e22bf3d57 100644 --- a/Mailman/docs/acknowledge.txt +++ b/Mailman/docs/acknowledge.txt @@ -12,6 +12,7 @@ acknowledgment. >>> from Mailman.database import flush >>> mlist = config.list_manager.create('_xtest@example.com') >>> mlist.real_name = 'XTest' + >>> mlist.preferred_language = 'en' >>> # XXX This will almost certainly change once we've worked out the web >>> # space layout for mailing lists now. >>> mlist._data.web_page_url = 'http://lists.example.com/' diff --git a/Mailman/docs/digests.txt b/Mailman/docs/digests.txt index 3788651f9..8f2a60ebc 100644 --- a/Mailman/docs/digests.txt +++ b/Mailman/docs/digests.txt @@ -418,9 +418,16 @@ Internationalized digests ------------------------- When messages come in with a content-type character set different than that of -the list's preferred language, recipients wil get an internationalized digest. +the list's preferred language, recipients wil get an internationalized +digest. French is not enabled by default site-wide, so enable that now. +XXX We also have to set the default server language to French, otherwise the +English template will be found and the masthead won't be translated. + + >>> config.languages.enable_language('fr') + >>> config.DEFAULT_SERVER_LANGUAGE = 'fr' >>> mlist.preferred_language = 'fr' + >>> flush() >>> msg = message_from_string("""\ ... From: aperson@example.org ... To: _xtest@example.com @@ -537,3 +544,9 @@ Set the digest threshold to zero so that the digests will be sent immediately. ('listname', '_xtest@example.com'), ('received_time', ...), ('recips', set([])), ('version', 3)] + + +Clean up +-------- + + >>> config.DEFAULT_SERVER_LANGUAGE = 'en' diff --git a/Mailman/docs/languages.txt b/Mailman/docs/languages.txt new file mode 100644 index 000000000..2c1664da3 --- /dev/null +++ b/Mailman/docs/languages.txt @@ -0,0 +1,94 @@ +Languages +========= + +Mailman is multilingual. A language manager handles the known set of +languages at run time, as well as enabling those languages for use in a +running Mailman instance. + + >>> from zope.interface.verify import verifyObject + >>> from Mailman.interfaces import ILanguageManager + >>> from Mailman.languages import LanguageManager + >>> mgr = LanguageManager() + >>> verifyObject(ILanguageManager, mgr) + True + +A language manager keeps track of the languages it knows about as well as the +languages which are enabled. By default, none are known or enabled. + + >>> sorted(mgr.known_codes) + [] + >>> sorted(mgr.enabled_codes) + [] + +The language manager also keeps track of information for each known language, +but you obviously can't get information for an unknown language. + + >>> mgr.get_language_data('en') + Traceback (most recent call last): + ... + KeyError: 'en' + + +Adding languages +---------------- + +Adding a new language requires three pieces of information, the 2-character +language code, the English description of the language, and the character set +used by the language. + + >>> mgr.add_language('en', 'English', 'us-ascii') + >>> mgr.add_language('it', 'Italian', 'iso-8859-1') + +By default, added languages are also enabled. + + >>> sorted(mgr.known_codes) + ['en', 'it'] + >>> sorted(mgr.enabled_codes) + ['en', 'it'] + +And you can get information for all known languages. + + >>> mgr.get_language_data('en') + ('English', 'us-ascii') + >>> mgr.get_language_data('it') + ('Italian', 'iso-8859-1') + +You can also add a language without enabling it. + + >>> mgr.add_language('pl', 'Polish', 'iso-8859-2', enable=False) + >>> sorted(mgr.known_codes) + ['en', 'it', 'pl'] + >>> sorted(mgr.enabled_codes) + ['en', 'it'] + +You can get language data for disabled languages. + + >>> mgr.get_language_data('pl') + ('Polish', 'iso-8859-2') + +And of course you can enable a known language. + + >>> mgr.enable_language('pl') + >>> sorted(mgr.enabled_codes) + ['en', 'it', 'pl'] + +But you cannot enable languages that the manager does not know about. + + >>> mgr.enable_language('xx') + Traceback (most recent call last): + ... + KeyError: 'xx' + + +Other iterations +---------------- + +You can iterate over the descriptions (names) of all enabled languages. + + >>> sorted(mgr.enabled_names) + ['English', 'Italian', 'Polish'] + +You can ask whether a particular language code is enabled. + + >>> 'it' in mgr.enabled_codes + True |
