source_lang in Horizon repo is overwritten by Transifex

Bug #1179526 reported by Akihiro Motoki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Ying Chun Guo

Bug Description

I noticed source_lang in Horizon repo is overwritten by other translations on Transifex.
There are two problems and these two seem to be related to each other.

(1) While Source language in the Horizon repository is 'en' (defined by LANGUAGE_CODE in openstack_dashboard/settings.py),
source_lang in Transifex is 'en_US'. As a result, transifex client cannot find the source language.

(2) In addition Horizon on Transifex has 'en' as translation. The second situation leads to overwriting the source language in the repo (openstack_dashboard/locale/en or horizon/locale/en) with 'en' language resource in Transifex when executing 'tx pull -f -a' to download translation PO files.

A translation may contain wrong translation string, so we should not overwrite the source language by translations.

Issue (1) can usually be fixed by language mapping or source_file in Transifex client configuration
  source_file = horizon/locale/en/LC_MESSAGES/django.po

issue (2) complicates the situation. The problem is which language we should map 'en' on Transifex into.

The best way is to remove the language 'en' on Transifex or switch the source language on Transifex from 'en_US' to 'en'.
But I am afraid changing the source language is not easy. I don't know why 'en' language in Horizon was created.

The alternative is to map 'en' on Transifex to a dummy language in Horizon repo.
Though it is an adhoc fix, I believe it is important to avoid overwriting 'en' locale in Horizon repo by running 'tx pull'.
(It is not good to do this by manual)

Changed in horizon:
importance: Undecided → High
milestone: none → havana-1
status: New → Confirmed
Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote :

It sounds like we probably need to scrap the source language on Transifex and align it to the correct source language in Horizon. Doing that may screw up the existing translations, so what we need to do (I think?) is back up the current translations and be prepared to re-add them to Transifex if the whole thing goes haywire.

It also might be worth reaching out to Transifex's support and asking if they have a better suggestion for migrating the source language code to avoid all the pain.

Revision history for this message
Julie Pichon (jpichon) wrote :

Would another option be making en_US the source language in the Horizon repo (since that's pretty much the reality), rename the en directories as en_US and remove the references to en on Transifex?

Changed in horizon:
milestone: havana-1 → havana-2
Revision history for this message
Akihiro Motoki (amotoki) wrote :

It seems en-us (or en_US) cannot be used as a language name in Django. The available languages in Django are defined in LANG_INFO in django.conf.locale.__init__.py.

Regarding Transifex side, the source language of each project cannot be changed after the project is created (through Web UI and API). Thus I am afraid we need to delete and recreate the Horizon project.

If OpenStack has an official channel to talk with Transifex support team, it is the best way.

The best way is to change the source language in Horizon from en_US to en, but it may take some time.
Before finishing the fix, we can avoid the case where 'en' lang in git repo is updated by mistake
by adding the following language_map to .tx/config temporarily.
---
lang_map = en_US: en, en: _dummy
---
(http://help.transifex.com/features/client/index.html#customizing-the-language-mappings)

Changed in horizon:
milestone: havana-2 → havana-3
Changed in horizon:
assignee: nobody → Julie Pichon (jpichon)
status: Confirmed → In Progress
Julie Pichon (jpichon)
Changed in horizon:
assignee: Julie Pichon (jpichon) → Ying Chun Guo (daisy-ycguo)
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Daisy has changed the source language of Transifex from en_US to en. Great!
We need to update .tx/config in horizon repository.

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/44411

Changed in horizon:
assignee: Ying Chun Guo (daisy-ycguo) → Akihiro Motoki (amotoki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/44411
Committed: http://github.com/openstack/horizon/commit/793f8eadf3c06873251401af611f1e906745095a
Submitter: Jenkins
Branch: master

commit 793f8eadf3c06873251401af611f1e906745095a
Author: Akihiro MOTOKI <email address hidden>
Date: Fri Aug 30 15:30:04 2013 +0900

    Sync Transifex config with the source lang change in Transifex

    Closes-Bug: #1179526

    source_lang mismatch between Horizon and OpenStack Hub projects
    has been addressed and the soruce language is changed from en_US
    to en. This commit updates .tx/config to catch up it.

    Also adds an entry for djangojs.po translation which was added
    to Transifex recently.

    Change-Id: I9a574b92a8396d2fda493d8dfa1261ddccc4ad02

Changed in horizon:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in horizon:
assignee: Akihiro Motoki (amotoki) → Ying Chun Guo (daisy-ycguo)
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: havana-3 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.