auto generation of language list does not work expected

Bug #1710131 reported by Akihiro Motoki
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Critical
Akihiro Motoki

Bug Description

During Pike cycle, we introduced a mechanism to auto-generate the language list based on PO file availability [1].

However we received a couple of bug reports which seem to be triggered by this change.

One is "can't change the language in user settings" and only "English" is available in the user setting menu [2]. Note that all messages are displayed in a local language so it is just a problem in the generation logic of the language list.

Another report is Simplified Chinese is not available in the language list [3].

It looks better to revert the change [3]. It turns out there are several cases the patch did not assume when it was implemented.

[1] https://review.openstack.org/#/c/450126/
[2] http://eavesdrop.openstack.org/irclogs/%23openstack-i18n/%23openstack-i18n.2017-08-03.log.html#t2017-08-03T14:05:05
[3] http://lists.openstack.org/pipermail/openstack-i18n/2017-August/003017.html

Akihiro Motoki (amotoki)
Changed in horizon:
milestone: none → pike-rc2
assignee: nobody → Akihiro Motoki (amotoki)
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Some more observation.

The first issue happens there is some extra path in LOCALES_PATH. Django looks up for 'locales' in INSTALLED_APPS and LOCALES_PATH, so it is not a good idea to depend on LOCALES_PATH.

I also confirmed the second issue. It excludes zh-CN and zh-TW as far as I checked.
It is caused because the default Django settings.LANGUAGES contains zh-hans and zh-hant instead of zh-CN and zh-TW. Horizon message catalogs use zh-cn and zh-tw, so they are not found in the current horizon language list logic. Handling this kind of fallback is not easy.

Revision history for this message
Akihiro Motoki (amotoki) wrote :

The second issue was caused by https://github.com/django/django/commit/f0a1df0b0139a7f5a576dff966210b5d52247650

The commit message says zh-cn and zh-tw were deprecated and they were dropped. zh-hans and zh-hant looks like the suggested locale.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/493335

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/493335
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=00f74fc06c37c58c23ff00ee9f36048d158ceeb1
Submitter: Jenkins
Branch: master

commit 00f74fc06c37c58c23ff00ee9f36048d158ceeb1
Author: Akihiro Motoki <email address hidden>
Date: Sat Aug 12 22:30:13 2017 +0000

    Revert "Generate language list automatically"

    This reverts commit a88092630014c53c9e6fe4ee9265f8443eea96bd.

    The reverted implementation depends on LOCALE_PATHS but this assumption
    turns out not correct. Django searches messages catalogs LOCALE_PATHS
    and locale directory in individual INSTALLED_APPS, but the usage of
    LOCALE_PATHS varies on deployers and we cannot assume the default value
    of LOCALE_PATSH.

    In addition, the logic of auto-generating the language list cannot
    handle locale name alias ('fallback' in the Django code).
    Django 1.9 or later perfers to zh-hant and zh-hans, and zh-cn and
    zh-tw are now defined as fallback.

    We can explore a better approach for auto-generation of the language
    list, but we do not have more reliable way so far. Cconsidering the
    timing of Pike release, the safest approach looks like to revert
    the original patch back to the manula maintenance of the lang list.

    Languages with over 50% progress (based on the number of translated
    messages as total) are listed in settings.LANGUAGES.
    (http://paste.openstack.org/show/618254/)

    Closes-Bug: #1710131
    Change-Id: I5133d6317aba6107fc37bd5f30388c130b1fdaac

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/493358

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/pike)

Reviewed: https://review.openstack.org/493358
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=1e169481b0bcca433e41c56eae986ce814461649
Submitter: Jenkins
Branch: stable/pike

commit 1e169481b0bcca433e41c56eae986ce814461649
Author: Akihiro Motoki <email address hidden>
Date: Sat Aug 12 22:30:13 2017 +0000

    Revert "Generate language list automatically"

    This reverts commit a88092630014c53c9e6fe4ee9265f8443eea96bd.

    The reverted implementation depends on LOCALE_PATHS but this assumption
    turns out not correct. Django searches messages catalogs LOCALE_PATHS
    and locale directory in individual INSTALLED_APPS, but the usage of
    LOCALE_PATHS varies on deployers and we cannot assume the default value
    of LOCALE_PATSH.

    In addition, the logic of auto-generating the language list cannot
    handle locale name alias ('fallback' in the Django code).
    Django 1.9 or later perfers to zh-hant and zh-hans, and zh-cn and
    zh-tw are now defined as fallback.

    We can explore a better approach for auto-generation of the language
    list, but we do not have more reliable way so far. Cconsidering the
    timing of Pike release, the safest approach looks like to revert
    the original patch back to the manula maintenance of the lang list.

    Languages with over 50% progress (based on the number of translated
    messages as total) are listed in settings.LANGUAGES.
    (http://paste.openstack.org/show/618254/)

    Closes-Bug: #1710131
    Change-Id: I5133d6317aba6107fc37bd5f30388c130b1fdaac
    (cherry picked from commit 00f74fc06c37c58c23ff00ee9f36048d158ceeb1)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 12.0.0.0rc2

This issue was fixed in the openstack/horizon 12.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 13.0.0.0b1

This issue was fixed in the openstack/horizon 13.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers