Bug 13728 - koha-translate -l -a shows po files instead of language codes
Summary: koha-translate -l -a shows po files instead of language codes
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-18 15:27 UTC by Tomás Cohen Arazi
Modified: 2015-12-03 22:02 UTC (History)
2 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 13728: koha-translate -l -a shows po files instead of language codes (1.40 KB, patch)
2015-02-18 15:31 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 13728: koha-translate -l -a shows po files instead of language codes (1.46 KB, patch)
2015-02-19 08:53 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 13728: koha-translate -l -a shows po files instead of language codes (1.52 KB, patch)
2015-02-19 13:58 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2015-02-18 15:27:08 UTC
When 'prog' got removed the koha-translate was fixed so it uses the bootstrap .po files to check language availability, but a leftover (-i-) makes

$ koha-translate --list --available

incorrectly show the .po file names instead of the language codes.
Comment 1 Tomás Cohen Arazi 2015-02-18 15:31:56 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2015-02-19 08:53:36 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2015-02-19 13:58:04 UTC
Created attachment 36036 [details] [review]
Bug 13728: koha-translate -l -a shows po files instead of language codes

This patch corrects the call to 'basename' inside the script so it correctly
shows the language code when asked to list the available languages.

To test:
- On a packages install, run:
  $ koha-translate --list --available
=> FAIL: It shows:
am-Ethi-opac-bootstrap.po
ar-Arab-opac-bootstrap.po
az-AZ-opac-bootstrap.po
be-BY-opac-bootstrap.po
ben-opac-bootstrap.po
...

- Apply the patch
- Copy the patched debian/scripts/koha-translate script to your packages setup.
- Run:
  $ koha-translate --list --available
=> SUCCESS: It shows:
am-Ethi
ar-Arab
az-AZ
be-BY
ben
...

- Sign off :-D

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 4 Tomás Cohen Arazi 2015-02-19 14:17:03 UTC
Patch pushed to master.
Comment 5 Chris Cormack 2015-02-22 23:00:45 UTC
Pushed to 3.18.x will be in 3.18.4