Testing is very important in this project, and coverage is high. Please respect this!
For tooling, we use tox. Just run tox
.
Coverage is reported in Coveralls.
This is crudely semi-automated now:
bin/create_zip.sh release 1.3
will create squeeze-alexa-1.3.zip
(hopefully) suitable for upload to Github etc.
squeeze-alexa uses GNU gettext. It's a little old-fashioned / troublesome at first, but it serves its purposes well.
Great! I wrote a script to help with that:
This re-scans the source and recreates a master .pot
file, before then updating the translations files (.po
s).
bin/update-translations
This takes the .po
s and makes binary .mo
s that are necessary for gettext to work.
bin/compile-translations
Great! Follow these steps (imagine you are choosing Brazilian Portuguese, pt_BR
):
cd locale
LOCALE=pt_BR
mkdir -p $LOCALE/LC_MESSAGES
DOMAIN=squeeze-alexa
touch $LOCALE/LC_MESSAGES/$DOMAIN.po
(see above)
You can edit the using any text editor, or use PoEdit, or any other gettext tools e.g.
- Hopefully you opened a Github issue - if not, do this.
- Either attach the updated
.po
, or create a fork in Gibhut, branch, commit your new file(s) in Git, then make a Pull Request, mentioning the ticket number.
- Make sure you've set
LOCALE
insettings.py
. - Make sure the directory is setup as above and you've definitely compiled it (i.e. there's a
.mo
file) - New versions of
squeeze-alexa
default to the source language (en_US
) if there is no translation found.
No problem. They'll come out in the source language (en
here).
This .po
header is probably missing:
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
xgettext
reformats source files to a maximum line width according to its settings.
See update-translations
for the setup.