translate.storage.mo

Package translate :: Package storage :: Module mo |
[hide private]
[frames] | no frames]

# Module mo

source code

Module for parsing Gettext .mo files for translation.

The coding of .mo files was produced from Gettext documentation, Pythons msgfmt.py and by observing and testing existing .mo files in the wild.

The hash algorithm is implemented for MO files, this should result in faster access of the MO file. The hash is optional for Gettext and is not needed for reading or writing MO files, in this implementation it is always on and does produce sometimes different results to Gettext in very small files.

Classes | [hide private]
| mounit A class representing a .mo translation message.
| mofile A class representing a .mo file.

Functions | [hide private]
mounpack(filename='messages.mo') Helper to unpack Gettext MO files into a Python string | source code
my_swap4(result) | source code
hashpjw(str_param) | source code
get_next_prime_number(start) | source code

Variables | [hide private]
| MO_MAGIC_NUMBER = `0x950412deL`

Imports: base, po, poheader, multistring, struct, array, re