# Path: stampy/i18n.py
# def _(string):
#     """
#     Provides translation of string based on current language
#     :param string: String to translate
#     :return: Translated string
#     """
#     language = stampy.language
# 
#     localedir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'locale')
#     trad = gettext.translation('stampy', localedir, fallback=True, languages=[language])
#     return trad.ugettext(string)
# 
# Path: stampy/i18n.py
# def _L(string):
#     """
#     Provides translation of string based on current language
#     :param string: String to translate
#     :return: Translated string
#     """
#     loglanguage = stampy.loglanguage
# 
#     localedir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'locale')
#     trad = gettext.translation('stampy', localedir, fallback=True, languages=[loglanguage])
#     return trad.ugettext(string)


import logging
import random
import string
import stampy.plugin.config
import stampy.stampy
from prettytable import from_db_cursor
from stampy.i18n import _
from stampy.i18n import _L
    """
    Returns help for plugin
    :param message: message to process
    :return: help text
    """

    commandtext = ""
    if stampy.stampy.is_owner_or_admin(message):
        commandtext += _("Use `/admin unlink` to remove channel linking\n")
        commandtext += _("Use `/admin link master` to generate and store linking token to be used on slaves\n")
        commandtext += _("Use `/admin link slave <token> to use provided token to link against master channel\n")
        commandtext += _("Use `/admin link show to list linked channel\n")
    return commandtext


def admincommands(message):
    """
    Processes link commands in the message
    :param message: message to process
    :return:
    """
    msgdetail = stampy.stampy.getmsgdetail(message)

    texto = msgdetail["text"]
    who_un = msgdetail["who_un"]

    logger = logging.getLogger(__name__)

    # Only users defined as 'owner' or 'admin' can perform commands
    if stampy.stampy.is_owner_or_admin(message):

# Path: stampy/i18n.py
# def _(string):
#     """
#     Provides translation of string based on current language
#     :param string: String to translate
#     :return: Translated string
#     """
#     language = stampy.language
# 
#     localedir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'locale')
#     trad = gettext.translation('stampy', localedir, fallback=True, languages=[language])
#     return trad.ugettext(string)
# 
# Path: stampy/i18n.py
# def _L(string):
#     """
#     Provides translation of string based on current language
#     :param string: String to translate
#     :return: Translated string
#     """
#     loglanguage = stampy.loglanguage
# 
#     localedir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'locale')
#     trad = gettext.translation('stampy', localedir, fallback=True, languages=[loglanguage])
#     return trad.ugettext(string)


# Path: stampy/plugin/admin.py
import logging
import random
import string
import stampy.plugin.config
import stampy.stampy
from prettytable import from_db_cursor
from stampy.i18n import _
from stampy.i18n import _L

    """
    Returns help for plugin
    :param message: message to process
    :return: help text
    """

    commandtext = ""
    if stampy.stampy.is_owner_or_admin(message):
        commandtext += _("Use `/admin unlink` to remove channel linking\n")
        commandtext += _("Use `/admin link master` to generate and store linking token to be used on slaves\n")
        commandtext += _("Use `/admin link slave <token> to use provided token to link against master channel\n")
        commandtext += _("Use `/admin link show to list linked channel\n")
    return commandtext


def admincommands(message):
    """
    Processes link commands in the message
    :param message: message to process
    :return:
    """
    msgdetail = stampy.stampy.getmsgdetail(message)

    texto = msgdetail["text"]
    who_un = msgdetail["who_un"]

    logger = logging.getLogger(__name__)

    # Only users defined as 'owner' or 'admin' can perform commands
    if stampy.stampy.is_owner_or_admin(message):

        logger.debug(msg=_L("Command: %s by %s") % (texto, who_un))