(display_lang, app_langs, obj)
return obj.get(list(obj)[0], _('Untitled'))
Given a list of lang codes and a dictionary of lang codes to strings, output
        the value of the current display lang or the first lang available.

        If obj is a string, just output that string.
Given a list of lang codes and a dictionary of lang codes to strings, output
        the value of the current display lang or the first lang available.
Given a list of lang codes and a dictionary of lang codes to strings output the value of the current display lang or the first lang available .
def get_translated_value(display_lang, app_langs, obj):
        """
        Given a list of lang codes and a dictionary of lang codes to strings, output
        the value of the current display lang or the first lang available.

        If obj is a string, just output that string.
        """
        if isinstance(obj, str):
            return obj
        if not obj:
            return _('Untitled')

        val = obj.get(display_lang)
        if val:
            return val
        for lang in app_langs:
            val = obj.get(lang)
            if val:
                return val
        return obj.get(list(obj)[0], _('Untitled'))
def get_translated_value ( display_lang , app_langs , obj ) : if isinstance ( obj , str ) : return obj if not obj : return _ ( 'Untitled' ) val = obj . get ( display_lang ) if val : return val for lang in app_langs : val = obj . get ( lang ) if val : return val return obj . get ( list ( obj ) [ 0 ] , _ ( 'Untitled' ) )