<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def joinStringsInList(literalEntities, prefLanguage="en"):
 """ from a list of literals, returns the ones in prefLanguage joined up. if the desired language specification is not available, join all up """

    match = []

    if len(literalEntities) == 1:
        return literalEntities[0]
    elif len(literalEntities) > 1:
        for x in literalEntities:
            if getattr(x, 'language') and getattr(x,
                                                  'language') == prefLanguage:
                match.append(x)
        if not match:  # don't bother about language
            for x in literalEntities:
                match.append(x)

    return " - ".join([x for x in match])