← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1804289] [NEW] LOCALE_PATH causes message mo files not found

 

Public bug reported:

Current default LOCALE_PATH is defined in openstack_dashboard/settings.py, like
LOCALE_PATHS = [
    'horizon/locale',
    'openstack_dashboard/locale'
]

They work fine in the development environment. However if Horizon path
installed in production is like

/opt/stack/venv/horizon-20180814T161452Z/srv/www/openstack-dashboard/openstack_dashboard
/opt/stack/venv/horizon-20180814T161452Z/lib/python2.7/site-packages/horizon/

when reset locale in the settings, the selected settings won't get saved
and the translation won't happen.

because of the relative locale path in settings.py, without overwriting
the path in local_settings.py.

/openstack_dashboard/dashboards/settings/user/forms.py
check_for_language returns false

  if lang_code and translation.check_for_language(lang_code):
            response = functions.save_config_value(
                request, response, settings.LANGUAGE_COOKIE_NAME, lang_code)

updated settings.py seem to fix the problem, however, still not clear what to do with horizon/locale
Change LOCALE_PATHS = [
    'horizon/locale',
    # 'openstack_dashboard/locale',
    os.path.join(ROOT_PATH, "locale")
]

** Affects: horizon
     Importance: Undecided
     Assignee: Gloria Gu (gloria-gu)
         Status: New

** Changed in: horizon
     Assignee: (unassigned) => Gloria Gu (gloria-gu)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1804289

Title:
  LOCALE_PATH  causes message mo files not found

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  Current default LOCALE_PATH is defined in openstack_dashboard/settings.py, like
  LOCALE_PATHS = [
      'horizon/locale',
      'openstack_dashboard/locale'
  ]

  They work fine in the development environment. However if Horizon path
  installed in production is like

  /opt/stack/venv/horizon-20180814T161452Z/srv/www/openstack-dashboard/openstack_dashboard
  /opt/stack/venv/horizon-20180814T161452Z/lib/python2.7/site-packages/horizon/

  when reset locale in the settings, the selected settings won't get
  saved and the translation won't happen.

  because of the relative locale path in settings.py, without
  overwriting the path in local_settings.py.

  /openstack_dashboard/dashboards/settings/user/forms.py
  check_for_language returns false

    if lang_code and translation.check_for_language(lang_code):
              response = functions.save_config_value(
                  request, response, settings.LANGUAGE_COOKIE_NAME, lang_code)

  updated settings.py seem to fix the problem, however, still not clear what to do with horizon/locale
  Change LOCALE_PATHS = [
      'horizon/locale',
      # 'openstack_dashboard/locale',
      os.path.join(ROOT_PATH, "locale")
  ]

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1804289/+subscriptions


Follow ups