Developer Area/Language Packs/Launchpad Branching
From Mahara Wiki
< Developer Area | Language PacksRevision as of 12:36, 11 April 2016 by Aaronw
A word about Bazaar
Because the translation is managed through Launchpad, it's handled by the Bazaar version control system instead of Git. Bazaar has similar functionality to git, but its organizational system is very different. Unlike Git and CVS, in which branches and tags are a kind of "parallel dimension" to the repository's directory structure, Bazaar is more like Subversion, where branches and tags are addressed as directories.
Bazaar (at least the distribution on Ubuntu) also incorporates several Launchpad-specific shortcuts. For instance, prefacing a location with "lp:" is shorthand for the Launchpad Bazaar repository: bzr+ssh://bazaar.launchpad.net/+branch/mahara-lang/mahara. When we create new branches, they're referred to starting with "lp:~mahara-lang/mahara-lang", which means they're owned by the "mahara-lang" group, and placed under their "mahara-lang" directory (named after the "mahara-lang" project). Once we associate a particular branch with the mahara-lang project officially through Launchpad, the address shortens to "lp:mahara-lang/...".
As long as you're not trying to do anything too new and different, the code here should be enough to get you through.
0. Initial setup
If you haven't used the Mahara Bazaar repo before, you'll need to do some setup. (These instructions are taken from the Bazaar manual). First, install the Bazaar command-line tools.
sudo apt-get install bzr
Then, upload your public SSH key into Launchpad, using the Launchpad website: https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair
Once you've done that, you can set up your bzr credentials on your computer. These are stored at the user level.
bzr whoami "FIRSTNAME LASTNAME <[email protected]>" bzr launchpad-login YOUR_LAUNCHPAD_USERNAME
Create a new code branch
Create a new code branch in the mahara-lang launchpad project for importing pot templates. This should contain a copy of the latest mahara/mahara.pot from master.
First, get the latest code from master...
cd ~/bazaar # Or wherever you want to store your bazaar branches # There's probably a better way to keep your master checkout in sync, # But I find it's just easiest to delete it and do a new checkout rm -Rf trunk bzr checkout lp:mahara-lang ./trunk # get a copy of the mahara-lang trunk
Then, create the new code branch, copy the master code into it, and publish it to Launchpad.
cd ~/bazaar mkdir 16.10_STABLE cd 16.10_STABLE bzr init mkdir mahara # Copy the mahara.pot from the trunk cp ~/bazaar/trunk/mahara/mahara.pot mahara/ bzr add mahara/mahara.pot bzr commit bzr push lp:~mahara-lang/mahara-lang/16.10_STABLE
Create the new export branch
You'll also need to manually create a new export branch, which can be mostly empty. (Launchpad will fill it with content.)
cd ~/bazaar mkdir 16.10_STABLE-export cd 16.10_STABLE-export bzr init mkdir mahara bzr add mahara bzr commit bzr push lp:~mahara-lang/mahara-lang/16.10_STABLE-export
Create a new series
Check that the two branches have appeared under https://code.launchpad.net/mahara-lang. The code branch should contain the mahara.pot file.
Create the new series under the mahara-lang project on launchpad at https://launchpad.net/mahara-lang/+addseries
You should set the official series branch to the one you just created (~mahara-lang/mahara-lang/1.5_STABLE). Once that's done, launchpad calls the branch by the abbreviated name lp:mahara-lang/1.5
Set up translation import and export for the new series
In the translation synchronisation settings for the 1.5 series (https://translations.launchpad.net/mahara-lang/1.5/+translations-settings), set the translation to "Import template files" from the official branch (on the trunk series, we "Import template and translation files", but it can potentially overwrite translations, so we don't do that for a stable branch).
In the export synchronisation settings, export translations for the series to the new export branch (lp:~mahara-lang/mahara-lang/1.5_STABLE-export). This should be automatically populated in a day or so, once there are translations to export. This is the branch where the langpacks.mahara.org tarballs come from.
Update the scripts
Update the langpack scripts. In the mahara-scripts repo, there are two files that need to be updated with the new branch name:
mahara-langpacks/langpacks.pl (which generates langpack tarballs from lp:~mahara-lang/mahara-lang/1.5_STABLE-export)
mahara-langpacks/update-pot.sh (which pushes new changes to English strings to lp:mahara-lang/1.5 to be translated)
Just edit these files, look for the other branch names, and add 1.5_STABLE. You may also want to remove the old no-longer-supported branch at the same time, in this case, 1.2_STABLE. Once the scripts are committed, deploy the scripts by generating a new custom-site-mahara-langpacks debian package. Run
fakeroot debian/rules binary
within your mahara-scripts checkout. The resulting .deb need to be installed over learn-docus-web1 and learn-docus-web2 servers. You may ask catalyst sysadmins to deploy it by creating an WR and attaching the .deb file. They will upload it to the elearning repo and deploy it.