import pathlib


def add_suffix(path: pathlib.Path, suffix):
    """Add a suffix to a path.

    This differs from ``with_suffix`` by adding a suffix without changing
    the extension, i.e. adding ``en`` to ``foo.baz`` will produce
    ``foo.en.baz``."""
    name = path.name
    name, _, extension = name.rpartition('.')
    return path.with_name(name + '.' + suffix + '.' + extension)