import itertools


def localise (lang, strings):
    """Choose a language variant for an epgdb string value.

Some strings stored in epgdb records have values for multiple languages.  This
function extracts the value for the preferred language, or any value, or an
empty string.

lang: ID string for the preferred language
strings:
    The field value; should be a map-type field with string values (see
    `validate_map`)

"""
    return strings.get(lang, next(itertools.chain(strings.values(), ('',))))