# 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 stampy.plugin.config
import stampy.stampy
from stampy.i18n import _
from stampy.i18n import _L

    msgdetail = stampy.stampy.getmsgdetail(message=message)
    chat_id = msgdetail['chat_id']

    welcome = stampy.plugin.config.gconfig(key='welcome', default=False, gid=chat_id)

    try:
        newparticipant = message['message']['new_chat_participant']
    except:
        newparticipant = False

    try:
        newusername = newparticipant['username']
    except:
        newusername = ""

    try:
        newfirstname = newparticipant['first_name']
    except:
        newfirstname = ""

    try:
        newlastname = newparticipant['last_name']
    except:
        newlastname = ""

    name = "%s %s ([`@%s`](https://t.me/%s))" % (newfirstname, newlastname, newusername, newusername)

    greeting = welcome.replace("$username", name)


# 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/welcome.py
import logging
import stampy.plugin.config
import stampy.stampy
from stampy.i18n import _
from stampy.i18n import _L


    msgdetail = stampy.stampy.getmsgdetail(message=message)
    chat_id = msgdetail['chat_id']

    welcome = stampy.plugin.config.gconfig(key='welcome', default=False, gid=chat_id)

    try:
        newparticipant = message['message']['new_chat_participant']
    except:
        newparticipant = False

    try:
        newusername = newparticipant['username']
    except:
        newusername = ""

    try:
        newfirstname = newparticipant['first_name']
    except:
        newfirstname = ""

    try:
        newlastname = newparticipant['last_name']
    except:
        newlastname = ""

    name = "%s %s ([`@%s`](https://t.me/%s))" % (newfirstname, newlastname, newusername, newusername)

    greeting = welcome.replace("$username", name)


    logger.debug(msg=_L('New user in chat, sending greetings: %s') % greeting)