← Back to team overview

openerp-dutch team mailing list archive

[Bug 510023] Re: "WARNING:translate:Unable to set locale" error on Ubuntu 9.10/CentOS 5.4 x64

 

Hello Loeki,

A different approach to set your locales..

1: Go to :/var/lib/locales/supported.d/
Note: you need to change the permission of locale file
2: edit locale file
3: paste on new line nl_NL.UTF-8 UTF-8
4:click save and go to the terminal
5:execute sudo dpkg-reconfigure locales
6:restart your gtk client.

As this is a configuration issue I would close this bug as invalid.

Regards,


** Changed in: openobject-client
       Status: Incomplete => Invalid

** Changed in: openobject-client
     Assignee: OpenERP sa GTK client R&D (openerp-dev-gtk) => (unassigned)

** Changed in: openobject-client
   Importance: Low => Undecided

** Changed in: openobject-client
    Milestone: 6.0-rc2 => None

-- 
You received this bug notification because you are a member of OpenERP
Dutch Team - Nederland, which is the registrant for OpenERP Dutch
Lokalisatie Project - Nederland.
https://bugs.launchpad.net/bugs/510023

Title:
  "WARNING:translate:Unable to set locale" error on Ubuntu 9.10/CentOS
  5.4 x64

Status in OpenERP-Dutch-localisation:
  Fix Committed
Status in OpenERP GTK Client:
  Invalid

Bug description:
  On both Ubuntu 9.10 and CentOS 5.4 x64 the OpenERP client will incorrectly load the locale (in this case, nl_NL.UTF-8) upon login into a database with the error
  WARNING:translate:Unable to set locale nl_NL.UTF-8

  In translate.py the following line causes this:
  locale.setlocale(locale.LC_ALL, lang_enc

  removing the try block reveals the following stack trace:
  Traceback (most recent call last):
    File "./openerp-client.py", line 135, in <module>
      win.sig_login()
    File "/usr/local/lib/python2.6/dist-packages/openerp-client/modules/gui/main.py", line 1023, in sig_login
      log_response = rpc.session.login(*res)
    File "/usr/local/lib/python2.6/dist-packages/openerp-client/rpc.py", line 233, in login
      self.context_reload()
    File "/usr/local/lib/python2.6/dist-packages/openerp-client/rpc.py", line 290, in context_reload
      translate.setlang(self.context['lang'])
    File "/usr/local/lib/python2.6/dist-packages/openerp-client/translate.py", line 184, in setlang
      locale.setlocale(locale.LC_ALL,lang_enc)    
    File "/usr/lib/python2.6/locale.py", line 514, in setlocale
      locale = normalize(_build_localename(locale))
    File "/usr/lib/python2.6/locale.py", line 422, in _build_localename
      language, encoding = localetuple
  ValueError: too many values to unpack

  Upon further analysis, it turns out that 'type(lang)' is not <str>,
  but <unicode>. Converting lang to str with str(lang) works around the
  problem, but I'm guessing it really shouldn't be a unicode:

  ---
  if lang:
     if type(lang) is not type(''):
        lang = str(lang)
  ---

To manage notifications about this bug go to:
https://bugs.launchpad.net/openerp-dutch-lok/+bug/510023/+subscriptions