code: def get_available_languages(self, related_name=None, include_unsaved=False):
          
          meta = self._parler_meta._get_extension_by_related_name(related_name)
  
          prefetch = self._get_prefetched_translations(meta=meta)
          if prefetch is not None:
              # TODO: this will break when using custom Django 1.8 Prefetch objects?
              db_languages = sorted(obj.language_code for obj in prefetch)
          else:
              qs = self._get_translated_queryset(meta=meta)
              db_languages = qs.values_list('language_code', flat=True).order_by('language_code')
  
          if include_unsaved:
              local_languages = (k for k, v in six.iteritems(self._translations_cache[meta.model]) if not is_missing(v))
              return list(set(db_languages) | set(local_languages))
          else:
              return db_languages
docs: Return the language codes of all translated variations.
  
          .. versionadded 1.2 Added the ``include_unsaved`` and ``related_name`` parameters.