def short_language_code(code=None):
    """
    Extract the short language code from its argument (or return the default
    language code).

    >>> str(short_language_code('de'))
    'de'
    >>> str(short_language_code('de-at'))
    'de'
    >>> short_language_code() == short_language_code(settings.LANGUAGE_CODE)
    True
    """
    if code is None:
        code = translation.get_language()

    pos = code.find("-")
    if pos > -1:
        return code[:pos]
    return code

    Extract the short language code from its argument (or return the default
    language code).

    >>> str(short_language_code('de'))
    'de'
    >>> str(short_language_code('de-at'))
    'de'
    >>> short_language_code() == short_language_code(settings.LANGUAGE_CODE)
    True
    
feincms/translations.py