# 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.plugin.stock
import stampy.stampy
from stampy.i18n import _
from stampy.i18n import _L
    ticker = stampy.plugin.config.gconfig(key="stock", gid=chat_id, default='RHT').split(" ")[0]

    text = "```\n"
    currency = stampy.plugin.config.gconfig(key="currency", default="EUR", gid=chat_id)

    if currency != 'USD':
        rate = stampy.plugin.stock.get_currency_rate('USD', currency)
    else:
        rate = 1

    text += _("USD/%s rate ") % currency + str(rate) + "\n"
    initial = float(stampy.plugin.config.gconfig(key="espp", default=False, gid=chat_id))
    if initial:
        text += _("Initial quote: %s USD\n") % initial
        try:
            quote = c.get(ticker)
            final = float(quote["l_cur"])
            text += _("Actual quote: %s USD\n") % final
        except:
            final = initial
            text += ""

        if initial > final:
            pricebuy = final
        else:
            pricebuy = initial

        reduced = 0.85 * pricebuy

        text += _("Buy price: %s USD\n") % reduced

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

    ticker = stampy.plugin.config.gconfig(key="stock", gid=chat_id, default='RHT').split(" ")[0]

    text = "```\n"
    currency = stampy.plugin.config.gconfig(key="currency", default="EUR", gid=chat_id)

    if currency != 'USD':
        rate = stampy.plugin.stock.get_currency_rate('USD', currency)
    else:
        rate = 1

    text += _("USD/%s rate ") % currency + str(rate) + "\n"
    initial = float(stampy.plugin.config.gconfig(key="espp", default=False, gid=chat_id))
    if initial:
        text += _("Initial quote: %s USD\n") % initial
        try:
            quote = c.get(ticker)
            final = float(quote["l_cur"])
            text += _("Actual quote: %s USD\n") % final
        except:
            final = initial
            text += ""

        if initial > final:
            pricebuy = final
        else:
            pricebuy = initial

        reduced = 0.85 * pricebuy

        text += _("Buy price: %s USD\n") % reduced

        text += _("Earning per unit: %s USD\n") % (final - reduced)