# -*- coding:utf-8 -*-

import pt
import en

ALLOWED_LANGUAGES = ('pt', 'en')


def get_constant(constant, languages=('en',)):
    usable_languages = set(languages).intersection(set(ALLOWED_LANGUAGES))
    if len(usable_languages) == 0:
        return getattr(en, constant)  # Default to English
    else:
        constants = getattr(en, constant)
        for language in usable_languages:
            constants += getattr(globals()[language], constant)

        return constants
