def save_translations(key):
    if not hasattr(_to_save, 'translations'):
        return

    for trans in _to_save.translations.get(key, []):
        is_new = trans.autoid is None
        trans.save(force_insert=is_new, force_update=not is_new)

    if key in _to_save.translations:
        del _to_save.translations[key]


# Ensure that on request completion, we flush out any unsaved translations.
For a given key, save all the translations. The key is used to ensure that
dataset/ETHPy150Open mozilla/addons-server/src/olympia/translations/hold.py/save_translations