Skip to content
Snippets Groups Projects
locale.py 628 B
Newer Older
me5na7qbjqbrp's avatar
me5na7qbjqbrp committed
"""
Small gettext wrapper

Copyright (C) 2010-2020 Cr@ns <roots@crans.org>
Authors : Daniel Stan <daniel.stan@crans.org>
          Vincent Le Gallic <legallic@crans.org>
          Alexandre Iooss <erdnaxe@crans.org>
SPDX-License-Identifier: GPL-3.0-or-later
"""

import gettext
me5na7qbjqbrp's avatar
me5na7qbjqbrp committed

from pkg_resources import resource_filename

# Load locale
if platform.uname().system == 'Linux':
    gettext.bindtextdomain('messages', resource_filename("cpasswords", "locale"))
    gettext.textdomain('messages')
    _ = gettext.gettext
else:
me5na7qbjqbrp's avatar
me5na7qbjqbrp committed
    # Do not support translation under MacOS and Windows
    def _(s):
        return s