fle-internal/ka-lite-central — pull request #215 by cpauya (2014-11-19 10:27:38+00:00)
Title: Feature/210 extend update language packs to only build the right po file per version

Hi @aronasorman - this is #210 and is a continuation of the PR #213.

I have done the following on this PR:

1. Ensure that the `_crowdincache/` folder exists where we save the local copy of Crowdin zipped files.
1. Use `https` for all API call urls.
1. Concatenate only `.po` files from Crowdin's `versioned` folder that are the same version used by the server.

Please note also that we are now displaying this on the log when we don't concatenate `.po` files with different versions:

```bash
DEBUG:kalite:Concatenating /var/folders/40/5c3y6nhs7tv00vv1nq5g0nvm0000gn/T/tmpHZNO_r/kalite-en/versioned/0.12-djangojs.po with /Users/cyril/w/fle/ka-lite/ka-lite-central/data/i18n/build/en/0.12/djangobuild.po...
DEBUG:kalite:Ignoring /var/folders/40/5c3y6nhs7tv00vv1nq5g0nvm0000gn/T/tmpHZNO_r/kalite-en/versioned/0.13-django.po because it's NOT for version 0.12.
DEBUG:kalite:Ignoring /var/folders/40/5c3y6nhs7tv00vv1nq5g0nvm0000gn/T/tmpHZNO_r/kalite-en/versioned/0.13-djangojs.po because it's NOT for version 0.12.
INFO:kalite:Skipping KA translations
```

I have manually checked by:

1. setting the central server version to `0.13.0`
1. running `python manage.py update_language_packs --no-srts --no-dubbed -l en` -- (note that as of today we still have no `0.13` versions of the `.po` files on Crowdin)
1. extract the `_crowdincache/kalite-en.zip`
1. copy the `_crowdincache/kalite-en/versioned/0.12-django*.po` as `_crowdincache/kalite-en/versioned/0.13-django*.po` -- (to simulate having different versions)
1. modify "Login" `msgstr` on `*/0.12-django.po` to "0.12"
1. modify "Login" `msgstr` on `*/0.13-django.po` to "0.13"
1. rename the original `kalite-en.zip` then compress the `_crowdincache/kalite-en/` folder back to `kalite-en.zip` to include the edits above
1. run `python manage.py languagepackdownload -l en --commandline` on the distributed server running version `0.13.0`
1. restart the distributed server to load the new `.mo` files
1. browse to http://127.0.0.1:8008/learn/khan/ and notice that the "Login" navigation now has the "0.13" text
1. change the distributed version to `0.12.0` and repeat the `languagepackdownload` command again
1. restart the distributed server then check that the "Login" text is now changed to "0.12" text

Please check.