def get_user_lang(user=None):
 if (not user):
  user = frappe.session.user
 lang = frappe.cache().hget(u'lang', user)
 if (not lang):
  lang = frappe.db.get_value(u'User', user, u'language')
  if (not lang):
   lang = frappe.db.get_default(u'lang')
  if (not lang):
   lang = (frappe.local.lang or u'en')
  frappe.cache().hset(u'lang', user, lang)
 return lang

def get_user_lang ( user = None ) : if ( not user ) : user = frappe . session . user lang = frappe . cache ( ) . hget ( u'lang' , user ) if ( not lang ) : lang = frappe . db . get_value ( u'User' , user , u'language' ) if ( not lang ) : lang = frappe . db . get_default ( u'lang' ) if ( not lang ) : lang = ( frappe . local . lang or u'en' ) frappe . cache ( ) . hset ( u'lang' , user , lang ) return lang
set frappe .