# Path: splinext/pokedex/i18n.py
# class Translator(BaseTranslator):


import math
import re
import os.path
import warnings
import pokedex.db.tables as t
import spline.lib.helpers as h
import pokedex.formulae as formulae
from itertools import groupby, chain, repeat
from operator import attrgetter
from pylons import config, tmpl_context as c, url
from splinext.pokedex.i18n import NullTranslator
from pokedex.roomaji import romanize
        form_identifier = form.form_identifier
    else:
        form_identifier = None

    if form_identifier:
        filename = '{id}-{form}.{ext}'
    else:
        filename = '{id}.{ext}'

    filename = filename.format(
        id=pokemon_species.id,
        form=form_identifier,
        ext=ext
    )

    return '/'.join(('pokemon', prefix, filename))

def species_image(pokemon_species, prefix='main-sprites/black-white', **attr):
    u"""Returns an <img> tag for a Pokémon species image."""

    default_text = pokemon_species.name

    if 'animated' in prefix:
        ext = 'gif'
    else:
        ext = 'png'

    attr.setdefault('alt', default_text)
    attr.setdefault('title', default_text)


# Path: splinext/pokedex/i18n.py
# class Translator(BaseTranslator):


# Path: splinext/pokedex/helpers.py
import math
import re
import os.path
import warnings
import pokedex.db.tables as t
import spline.lib.helpers as h
import pokedex.formulae as formulae
from itertools import groupby, chain, repeat
from operator import attrgetter
from pylons import config, tmpl_context as c, url
from splinext.pokedex.i18n import NullTranslator
from pokedex.roomaji import romanize

        form_identifier = form.form_identifier
    else:
        form_identifier = None

    if form_identifier:
        filename = '{id}-{form}.{ext}'
    else:
        filename = '{id}.{ext}'

    filename = filename.format(
        id=pokemon_species.id,
        form=form_identifier,
        ext=ext
    )

    return '/'.join(('pokemon', prefix, filename))

def species_image(pokemon_species, prefix='main-sprites/black-white', **attr):
    u"""Returns an <img> tag for a Pokémon species image."""

    default_text = pokemon_species.name

    if 'animated' in prefix:
        ext = 'gif'
    else:
        ext = 'png'

    attr.setdefault('alt', default_text)
    attr.setdefault('title', default_text)


    return pokedex_img(pokemon_media_path(pokemon_species, prefix, ext),