310
311
if 'lang' in self.context:
312
313
translate.setlang(self.context['lang'])
313
options.options['client.lang']=self.context['lang']
314
ids = self.rpc_exec_auth('/object', 'execute', 'res.lang', 'search', [('code', '=', self.context['lang'])])
316
l = self.rpc_exec_auth('/object', 'execute', 'res.lang', 'read', ids, ['direction'])
317
if l and 'direction' in l[0]:
318
common.DIRECTION = l[0]['direction']
314
options.options['client.lang'] = self.context['lang']
315
lang_ids = self.rpc_exec_auth('/object', 'execute', 'res.lang', 'search', [('code', '=', self.context['lang'])])
317
lang_data = self.rpc_exec_auth('/object', 'execute', 'res.lang', 'read', lang_ids, ['date_format', 'time_format', 'grouping', 'decimal_point', 'thousands_sep','direction'])
318
if lang_data and 'direction' in lang_data[0]:
319
common.DIRECTION = lang_data[0]['direction']
320
321
if common.DIRECTION == 'rtl':
321
322
gtk.widget_set_default_direction(gtk.TEXT_DIR_RTL)
323
324
gtk.widget_set_default_direction(gtk.TEXT_DIR_LTR)
325
tools.user_locale_format.set_locale_cache(lang_data and lang_data[0] or {})
324
327
if self.context.get('tz'):
325
328
# FIXME: Timezone handling
326
329
# rpc_session.timezone contains the server's idea of its timezone (from time.tzname[0]),