init-departments tool doesn't correctly handle multiple locales

Bug #1413644 reported by Paweł Stołowski
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
unity-scope-click (Ubuntu)
Confirmed
High
Unassigned

Bug Description

According to the README file, init-departments tool should support multiple locales with single invocation like this:

init-departments DBFILE LOCALE1 [LOCALE2 ...]

but that doesn't work and just fetches names for current system locale (based on LANGUAGE) and stores them in the dbfile as LOCALE1, LOCALE2 etc. This is because requested locales are not really passed to the Index API calls and webclient code picks the language from LANGUAGE env var.

Also running the tool twice for each locale separately, e.g.

LANGUAGE=es_ES init-departments test.db es_ES
LANGUAGE=en_US init-departments test.db en_US

produces incorrect result for second invocation (en_US entries have same strings as es_ES), because of network caching.

The workaround for the above problems is to run the tool twice and clean network disk cache inbetween like this:

rm -rf ~/.cache/init-departments
LANGUAGE=es_ES init-departments test.db es_ES
rm -rf ~/.cache/init-departments
LANGUAGE=en_US init-departments test.db en_US

Suggested solution: this is internal tool, so changing Index and webclient API (also used by click scope) is not justified. Instead init-departments should just handle one language at a time (and it could internally set LANGUAGE env var). It should also disable network caching.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity-scope-click (Ubuntu):
status: New → Confirmed
dobey (dobey)
Changed in unity-scope-click (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-scope-click - 0.1.1+16.10.20160622-0ubuntu1

---------------
unity-scope-click (0.1.1+16.10.20160622-0ubuntu1) yakkety; urgency=medium

  [ Marcus Tomlinson ]
  * Ignore promise_already_satisfied exceptions thrown from
    getCredentials() signal handlers (LP: #1591422)

  [ Michael Terry ]
  * Use latest version of Ubuntu orange.

  [ Rodney Dawes ]
  * Update departments.db with Chinese translations. (LP: #1413644)

 -- Rodney Dawes <email address hidden> Wed, 22 Jun 2016 20:46:55 +0000

Changed in unity-scope-click (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Not really fixed, incorrectly linked in a bzr branch. Setting back to Confirmed.

Changed in unity-scope-click (Ubuntu):
status: Fix Released → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers