Source code for whiteprints.loc
# SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors <whiteprints@pm.me>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Localization."""
import gettext
import pathlib
from typing import Final
__all__: Final = ["LOCALE_DIRECTORY", "TRANSLATION", "_"]
"""Public module attributes."""
[docs]
LOCALE_DIRECTORY: Final = pathlib.Path(__file__).parent / "locale"
"""Path to the directory containing the locales."""
[docs]
TRANSLATION: Final = gettext.translation(
"messages",
LOCALE_DIRECTORY,
fallback=True,
)
"""A Gettext translation."""
_: Final = TRANSLATION.gettext
"""Convenient access to Gettext's translation."""