def getFilename(page, extension=None):
    """
    Create a filename that is unique for the page.

    @param page: page used to create the new filename
    @type page: Page
    @param extension: file extension
    @type extension: str
    @return: filename of <family>-<lang>-<page>.<ext>
    @rtype: str
    """
    filename = '%s-%s-%s' % (page.site.family.name,
                             page.site.code,
                             page.titleForFilename())
    if extension:
        filename += '.%s' % extension
    return filename