aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/customising/translation.md107
-rw-r--r--docs/developers/i18n.md161
-rw-r--r--docs/glossary.md86
-rw-r--r--docs/installing/macos.md32
-rw-r--r--docs/installing/manual_install.md47
-rw-r--r--docs/running/admin_manual.md19
-rw-r--r--docs/running/upgrading.md54
7 files changed, 416 insertions, 90 deletions
diff --git a/docs/customising/translation.md b/docs/customising/translation.md
index bcf6514e5..d4ccedfa7 100644
--- a/docs/customising/translation.md
+++ b/docs/customising/translation.md
@@ -12,38 +12,85 @@ title: Translation
it. This page explains how.
</p>
+## Alaveteli already contains translations!
+
+Alaveteli ships ready to run in a number of different languages.
+If Alaveteli has already been translated into the language (or languages) you
+need, you just need to configure it -- see
+[`AVAILABLE_LOCALES`]({{ site.baseurl }}docs/customising/config/#available_locales).
+
+[Look in the `locale/` directory](https://github.com/mysociety/alaveteli/tree/master/locale)
+to see what translations are already available. Some are complete
+translations of the site. Others are only partial -- either because the translations
+have not been finished yet, or else because the translators have not updated the
+texts since developers changed or added text on the site.
+
+There are two reasons the translations may need more work before you can use them:
+
+* **the language you want is not one of those we already have** <br> In this
+ case, there will be no entry in ``locale/`` for it, because nobody has yet
+ translated Alaveteli into your language. See the rest of this page to learn
+ how to add a new translation.
+
+* **the translation for your language is incomplete, or lagging behind** <br>
+ This might simply be because it is a work in progress. Furthermore, sometimes
+ an incomplete translation already covers all the areas of the site you need
+ anyway. Of course, you can add to a partial translation, but it's a good idea
+ to check with us first, since we'll probably know who is working on the
+ current translation and what state it's in.
+
+Translators are members of the Alaveteli
+[community]({{site.baseurl}}community/), and often work separately from the
+developers. This means translations can lag a little behind the code. However,
+our release process includes a "translation freeze", which gives the
+translators a chance to catch up -- read the rest of this page for details.
+
## Alaveteli's translations
-The software translations are implemented using GNU gettext, and the resource
-files are managed in Transifex.
+You don't need to be a programmer to translate Alaveteli -- we use an external
+website called Transifex to help manage translations. This makes it easy for
+translators to get to work, but it does mean you (or your technical team)
+need to do a little extra work to get those translations back into Alaveteli
+when they are ready.
The Transifex project is at
-[https://www.transifex.net/projects/p/alaveteli](https://www.transifex.net/projects/p/alaveteli) -- you'll probably want an account there (ask on the mailing
-list). It has a fairly easy-to-use interface for contributing translations.
+[https://www.transifex.net/projects/p/alaveteli](https://www.transifex.net/projects/p/alaveteli)
+-- you'll probably want an account there (ask on the mailing list). It has a
+fairly easy-to-use interface for contributing translations.
+
+Alaveteli localises strings using GNU gettext and
+<a href="{{site.baseurl}}docs/glossary/#po" class="glossary__link"><code>.pot</code> &amp; <code>.po</code> files</a>.
+If you're a developer, you should read
+[internationalising Alaveteli]({{ site.baseurl }}docs/developers/i18n/).
-There are three roles in the translation process, and each one is described
-below: **translator**, **developer**, and **release manager**. You probably only
-need to know about the one that applies to you.
-## Translation process: translator's view
+## What a translator needs to do
**If you're just working on translating Alaveteli into a language you know, then
this section is for you.**
+> Remember that Alaveteli
+> [already comes with some translations](#alaveteli-already-contains-translations),
+> so check first that you really need to do this. Maybe someone has already
+> translated Alaveteli into the language you need!
+
When a developer adds a new feature to the user interface in Alaveteli, they
use some code to mark sentences or words ("strings") that they think will need
to be translated.
-When the Alaveteli release manager is planning a release, they will upload a
-template containing all the strings to be translated (called a POT) to
-Transifex. This causes your own translations in Transifex to be updated with
+When the Alaveteli
+<a href="{{site.baseurl}}docs/glossary/#release" class="glossary__link">release manager</a>
+is planning a release, they will upload a
+template containing all the strings to be translated (called a
+<a href="{{site.baseurl}}docs/glossary/#po" class="glossary__link"><code>.pot</code> file</a>)
+to Transifex. This causes your own translations in Transifex to be updated with
the latest strings.
When you visit Transifex, it will prompt you to fill out values for all new
strings, and all strings that have been modified. In the case where a string
has only been slightly modified, such as with punctuation ("Hello" has become
"Hello!"), Transifex will suggest a suitable translation for you (look for the
-"suggestions" tab under the source string).
+*Suggestions* tab under the source string).
In order for this feature to work properly, the release manager has to download
your translations, run a program that inserts the suggestions, and then upload
@@ -59,11 +106,12 @@ The release manager will also give you a **translation deadline**. After this
date, you can continue to contribute new translations, but they won't make it
into the release.
+
### General notes on translation in Transifex
Some strings will have comments attached to them from the Alaveteli
application developers about the context in which the text appears in the
-application — these comments will appear under the 'Details' tab for the text
+application — these comments will appear under the *Details* tab for the text
in Transifex.
Some strings will have **placeholders** in them to indicate that Alaveteli
@@ -104,19 +152,24 @@ they do not appear on the site anywhere at the moment, and when they do, they
will only be used in the admin interface. If you do translate them, only
translate the text that comes *after* the `|`.
-## Translation process: developers' view
-**If you're writing new code for Alaveteli, then you're a developer, and you
+## How the translations get into Alaveteli
+
+In order to get the translated strings from Transifex into Alaveteli, follow
+the instructions in these [deployment notes]({{ site.baseurl }}docs/developers/i18n/#deployment-notes).
+This will be the job of the technical people on your team (or
+even mySociety's release manager). If translators aren't technical, they can
+use Transifex without needing to worry about this.
+
+
+## Developers and internationalisation
+
+If you're writing new code for Alaveteli, then you're a developer, and you
need to understand how to make any text you add easy for translators to work
-with.**
-
-Please read our [internationalisation
-guide](http://mysociety.github.io/internationalization.html) for our advice on
-using strings that will need translation. This applies across all mySociety
-projects, not just Alaveteli.
-
-The release manager will enforce a translation freeze just before a new release
-is cut. During such time, you must not introduce new strings to the code if
-your work is due for inclusion in this release. This is necessary to allow
-translators time to complete and check their translations against all the known
-strings.
+with -- see the page about
+[internationalising Alaveteli]({{site.baseurl}}docs/developers/i18n/).
+
+If you are a developer or translator actively working on internationalising
+Alaveteli code, you should talk to us to find out when the next release is due,
+so your translations can be prepared in time to be included in it.
+
diff --git a/docs/developers/i18n.md b/docs/developers/i18n.md
new file mode 100644
index 000000000..deabc99a1
--- /dev/null
+++ b/docs/developers/i18n.md
@@ -0,0 +1,161 @@
+---
+layout: page
+title: Internationalisation (for devs)
+---
+
+# Internationalisation in the code
+
+<p class="lead">
+ This page describes some technical aspects of internationalising the
+ Alaveteli code. It's mostly aimed at devs who are working on the
+ codebase &mdash; if you just want to translate Alaveteli into your
+ own language, see
+ <a href="{{ site.baseurl }}docs/customising/translation">translating Alaveteli</a>
+ instead.
+</p>
+
+## Deployment notes
+
+Deployed translations for the project live in ``locale/``.
+
+We encourage translations to be done on
+[Transifex](https://www.transifex.net/projects/p/alaveteli/)
+because translators can work through its web interface rather than needing to edit the
+<a href="{{ site.baseurl }}docs/glossary/#po" class="glossary__link">`.po` and `.pot` files</a>
+directly. Ultimately, Transifex just captures translators'
+work and turns it into the files that Alaveteli needs (using gettext).
+
+### How to get the latest translations onto your site
+
+For example, to deploy English and Spanish translations at once:
+
+ * Ensure their `.po` files are at ```locale/en/app.po``` and ```locale/es/app.po```
+ (for example, by downloading them from Transifex)
+ * Set <code><a href="{{ site.baseurl }}docs/customising/config/#available_locales">AVAILABLE_LOCALES</a></code>
+ to <code>en&nbsp;es</code>
+
+### How to add new strings to the translations
+
+You need to do this if you've added any new strings to the code that need
+translations (or if you change an existing one).
+
+To update the
+<a href="{{ site.baseurl }}docs/glossary/#po" class="glossary__link">`.po` or `.pot` files</a>
+for each language, run:
+
+ bundle exec rake gettext:store_model_attributes
+
+followed by:
+
+ bundle exec rake gettext:find
+
+If `gettext:find` only creates the file `locale/im-config.pot` then you need to
+unset the `TEXTDOMAIN` environment variable and try again.
+
+For more details about the translations, see the page about
+[translating Alaveteli]({{ site.baseurl }}docs/customising/translation/).
+
+
+## Technical implementation details
+
+### Getting the current locale
+
+This is complicated by the fact that there are two competing ways to define a
+locale+territory combination. The POSIX (and gettext and Transifex) way is
+like `en_GB`; the Rails way is like `en-US`. Because we are using gettext and
+Transifex for translations, we must deal with both.
+
+ * for the Rails version of the currently selected locale, use `I18n.locale`
+ * for the POSIX version of the locale, use `FastGettext.locale`
+
+## I18n in templates
+
+Before you add i18n strings to the source, you should read
+[internationalisation guidelines](http://mysociety.github.io/internationalization.html)
+that apply to all our projects.
+
+Some hints for adding the strings into the Alaveteli code:
+
+* Simple strings: ```<% = _("String to translate") %>```
+* Strings that include variables: give the translator a hand by inserting
+ strings that can be interpolated, so the variable has meaning. For example,
+ ```<%= "Nothing found for '" + h(@query) + "'" %>``` might become ```<%=
+ _("Nothing found for '{{search_terms}}'", :search_terms => h(@query)) %>```
+* Strings containing numbers: ```<%= n_('%d request', '%d requests', @quantity) % @quantity %>```
+* We allow some inline HTML where it helps with meaningful context, for example:
+
+```
+_('<a href="{{browse_url}}">Browse all</a> or <a href="{{add_url}}">ask us to add it</a>.',
+ :browse_url => @browse_url, :add_url => @add_url)
+```
+
+Similar rules can apply to strings in the Ruby source code.
+
+## Programmatic access of translated PublicBodies
+
+Apart from the templates, the only other area of i18n currently implemented is
+in the PublicBodies.
+
+The implementation allows for getting different locales of a PublicBody like so:
+
+```ruby
+ PublicBody.with_locale("es") do
+ puts PublicBody.find(230).name
+ end
+```
+
+Usually, that's all the code you need to know about. There's a method
+```self.locale_from_params()``` available on all models which returns a locale
+specified as ```locale=xx``` in the query string, and which falls back to the
+default locale, that you can use in conjunction with the ```with_locale```
+method above. All the joining on internal translation tables should usually be
+handled automagically -- but there are some exceptions, that follow below.
+
+### Overriding model field setters
+
+Internally, we use the [Globalize plugin](https://github.com/globalize/globalize)
+to localize model fields. Where column "foo" has been marked in the model as
+```:translates```, globalize overrides ```foo.baz = 12``` to actually set the
+value in column ```baz``` of table ```foo_translations```.
+
+A side effect of the way it does this is that if you wish to override a
+specific attribute setter, you will need to explicitly call the Globalize
+machinery; something like:
+
+```ruby
+ def name=(name)
+ globalize.write(self.class.locale || I18n.locale, "name", name)
+ self["name"] = short_name
+ # your other stuff here
+ end
+```
+
+### Searching
+
+The ```find_first_by_<attr>``` and ```find_all_by_<attr>``` magic methods
+should work. If you want to do a more programmatic search, you will need to
+join on the translation table. For example:
+
+```ruby
+ query = "#{translated_attr_name(someattr) = ? AND #{translated_attr_name('locale')} IN (?)"
+ locales = Globalize.fallbacks(locale || I18n.locale).map(&:to_s)
+ find(
+ :first,
+ :joins => :translations,
+ :conditions => [query, value, locales],
+ :readonly => false
+ )
+```
+
+You may also need to do some lower-level SQL joins or conditions. See
+```PublicBodyController.list``` for an example of a query that has a condition
+that is explicitly locale-aware (look for the ```locale_condition``` variable)
+
+## Translation and releases
+
+The release manager will enforce a translation freeze just before a new release
+is cut. During such time, you must not introduce new strings to the code if
+your work is due for inclusion in this release. This is necessary to allow
+translators time to complete and check their translations against all the known
+strings. See more about [translating Alaveteli]({{ site.baseurl }}docs/customising/translation/).
+
diff --git a/docs/glossary.md b/docs/glossary.md
index 64c75c603..d35454cbf 100644
--- a/docs/glossary.md
+++ b/docs/glossary.md
@@ -27,12 +27,14 @@ Definitions
<li><a href="#holding_pen">holding pen</a></li>
<li><a href="#newrelic">New Relic</a></li>
<li><a href="#mta">MTA</a></li>
+ <li><a href="#po">.po files</a></li>
<li><a href="#production">production site</a></li>
<li><a href="#publish">publish</a></li>
<li><a href="#recaptcha">recaptcha</a></li>
<li><a href="#redact">redacting</a></li>
<li><a href="#regexp">regular expression</a></li>
<li><a href="#request">request</a></li>
+ <li><a href="#release">release</a></li>
<li><a href="#response">response</a></li>
<li><a href="#rails">Ruby&nbsp;on&nbsp;Rails</a></li>
<li><a href="#sass">Sass</a></li>
@@ -333,6 +335,36 @@ Definitions
</dd>
<dt>
+ <a name="po"><code>.po</code> file</a> (and <code>.pot</code> file)
+ </dt>
+ <dd>
+ These are the files needed by the gettext mechanism Alaveteli uses for
+ localisation. A <code>.pot</code> file is effectively a list of all the
+ strings in the application that need translating. Each <code>.po</code>
+ file contains the mapping between those strings, used as keys, and their
+ translations for one particular language. The key is called the
+ <em>msgid</em>, and its corresponding translation is the <em>msgstr</em>.
+ <div class="more-info">
+ <p>More information:</p>
+ <ul>
+ <li>
+ See <a href="{{ site.baseurl }}docs/customising/translation/">translating
+ Alaveteli</a> for an overview from a translator's point of view.
+ </li>
+ <li>
+ See <a href="{{ site.baseurl }}docs/developers/i18n/">Internationalising
+ Alaveteli</a> for more technical details.
+ </li>
+ <li>
+ Alaveteli is on the <a href="https://www.transifex.net/projects/p/alaveteli/">Transifex</a>
+ website, which lets translators work on Alaveteli in a browser, without needing
+ to worry about this underlying structure.
+ </li>
+ </ul>
+ </div>
+ </dd>
+
+ <dt>
<a name="production">production site</a> (also: live, production server)
</dt>
<dd>
@@ -378,15 +410,6 @@ Definitions
</dd>
<dt>
- <a name="response">response</a>
- </dt>
- <dd>
- A <strong>response</strong> is the email sent by an
- <a href="#authority" class="glossary">authority</a> in reply to
- a user's <a href="#request" class="glossary">requests</a>.
- </dd>
-
- <dt>
<a name="recaptcha">recaptcha</a>
</dt>
<dd>
@@ -482,6 +505,42 @@ Definitions
</dd>
<dt>
+ <a name="release">release</a> (also: release manager)
+ </dt>
+ <dd>
+ We issue new <strong>releases</strong> of the Alaveteli code whenever key
+ work (new features, improvements, bugfixes, and so on) have been added to
+ the core code. Releases are identified by their tag, which comprises two or
+ three numbers: major, minor, and &mdash; if necessary &mdash; a patch
+ number. We recommend you always use the latest version. The process is
+ handled by the Alaveteli <strong>release manager</strong>, who decides what
+ changes are to be included in the current release, and the cut-off date for
+ the work. Currently this is Alaveteli's lead developer at mySociety.
+ <div class="more-info">
+ <p>More information:</p>
+ <ul>
+ <li>
+ The latest stable release is on the
+ <a href="https://github.com/mysociety/alaveteli/tree/master">master branch</a>.
+ </li>
+ <li>
+ See a <a href="https://github.com/mysociety/alaveteli/releases">list of all releases</a>
+ and their explicit tags.
+ </li>
+ <li>
+ We try to coordinate releases with any active translation work too.
+ See <a href="http://localhost:4000/docs/customising/translation/">translating
+ Alaveteli</a> for more information.
+ </li>
+ <li>
+ We encourage you use the <a href="{{site.baseurl}}docs/installing/deploy/">deployment
+ mechanism</a>, which makes it easier to keep your production server up-to-date.
+ </li>
+ </ul>
+ </div>
+ </dd>
+
+ <dt>
<a name="request">request</a>
</dt>
<dd>
@@ -495,6 +554,15 @@ Definitions
</dd>
<dt>
+ <a name="response">response</a>
+ </dt>
+ <dd>
+ A <strong>response</strong> is the email sent by an
+ <a href="#authority" class="glossary">authority</a> in reply to
+ a user's <a href="#request" class="glossary">requests</a>.
+ </dd>
+
+ <dt>
<a name="rails">Ruby on Rails</a> (also Rails)
</dt>
<dd>
diff --git a/docs/installing/macos.md b/docs/installing/macos.md
index c46bdf4ba..e93ea452f 100644
--- a/docs/installing/macos.md
+++ b/docs/installing/macos.md
@@ -88,17 +88,27 @@ The following is mostly from [the manual installation process]({{ site.baseurl}}
### Configure database
-Creates Alaveteli databases and an `foi` user with password `foi`.
-
- echo "CREATE DATABASE foi_development encoding = 'UTF8';
- CREATE DATABASE foi_test encoding = 'UTF8';
- CREATE USER foi WITH CREATEUSER;
- ALTER USER foi WITH PASSWORD 'foi';
- ALTER USER foi WITH CREATEDB;
- GRANT ALL PRIVILEGES ON DATABASE foi_development TO foi;
- GRANT ALL PRIVILEGES ON DATABASE foi_test TO foi;
- ALTER DATABASE foi_development OWNER TO foi;
- ALTER DATABASE foi_test OWNER TO foi;" | psql -h localhost template1
+Create a database for your Mac user as homebrew doesn't create one by default:
+
+ createdb
+
+Create a `foi` user from the command line, like this:
+
+ createuser -s -P foi
+
+_Note:_ Leaving the password blank will cause great confusion if you're new to
+PostgreSQL.
+
+We'll create a template for our Alaveteli databases:
+
+ createdb -T template0 -E UTF-8 template_utf8
+ echo "update pg_database set datistemplate=true where datname='template_utf8';" | psql
+
+Then create the databases:
+
+ createdb -T template_utf8 -O foi alaveteli_production
+ createdb -T template_utf8 -O foi alaveteli_test
+ createdb -T template_utf8 -O foi alaveteli_development
### Clone Alaveteli
diff --git a/docs/installing/manual_install.md b/docs/installing/manual_install.md
index fdb836d37..653c6e7f4 100644
--- a/docs/installing/manual_install.md
+++ b/docs/installing/manual_install.md
@@ -239,20 +239,20 @@ Create a `foi` user from the command line, like this:
_Note:_ Leaving the password blank will cause great confusion if you're new to
PostgreSQL.
-Then create the databases:
+We'll create a template for our Alaveteli databases:
+
+ # sudo -u postgres createdb -T template0 -E UTF-8 template_utf8
+ # echo "update pg_database set datistemplate=true where datname='template_utf8';" > /tmp/update-template.sql
+ # sudo -u postgres psql -f /tmp/update-template.sql
- # sudo -u postgres createdb -T template0 -E SQL_ASCII -O foi foi_production
- # sudo -u postgres createdb -T template0 -E SQL_ASCII -O foi foi_test
- # sudo -u postgres createdb -T template0 -E SQL_ASCII -O foi foi_development
+Then create the databases:
-We create using the ``SQL_ASCII`` encoding, because in postgres this is means
-"no encoding"; and because we handle and store all kinds of data that may not
-be valid UTF (for example, data originating from various broken email clients
-that's not 8-bit clean), it's safer to be able to store *anything*, than reject
-data at runtime.
+ # sudo -u postgres createdb -T template_utf8 -O foi alaveteli_production
+ # sudo -u postgres createdb -T template_utf8 -O foi alaveteli_test
+ # sudo -u postgres createdb -T template_utf8 -O foi alaveteli_development
-Now you need to set up the database config file to contain the name, username
-and password of your postgres database.
+Now you need to set up the database config file so that the application can
+connect to the postgres database.
* Copy `database.yml-example` to `database.yml` in `alaveteli/config`
* Edit it to point to your local postgresql database in the development
@@ -262,7 +262,8 @@ Example `development` section of `config/database.yml`:
development:
adapter: postgresql
- database: foi_development
+ template: template_utf8
+ database: alaveteli_development
username: foi
password: secure-password-here
host: localhost
@@ -402,28 +403,6 @@ localhost interface by adding `--binding=127.0.0.1`
The server should have told you the URL to access in your browser to see the
site in action.
-## Administrator privileges
-
-The administrative interface is at the URL `/admin`.
-
-Only users with the `super` admin level can access the admin interface. Users
-create their own accounts in the usual way, and then administrators can give
-them `super` privileges.
-
-There is an emergency user account which can be accessed via
-`/admin?emergency=1`, using the credentials `ADMIN_USERNAME` and
-`ADMIN_PASSWORD`, which are set in `general.yml`. To bootstrap the
-first `super` level accounts, you will need to log in as the emergency
-user. You can disable the emergency user account by setting `DISABLE_EMERGENCY_USER` to `true` in `general.yml`.
-
-Users with the superuser role also have extra privileges in the website
-frontend, such as being able to categorise any request, being able to view
-items that have been hidden from the search, and being presented with "admin"
-links next to individual requests and comments in the front end.
-
-It is possible completely to override the administrator authentication by
-setting `SKIP_ADMIN_AUTH` to `true` in `general.yml`.
-
## Cron jobs and init scripts
`config/crontab-example` contains the cronjobs run on WhatDoTheyKnow. It's in a
diff --git a/docs/running/admin_manual.md b/docs/running/admin_manual.md
index 77bacdf1b..cde828c9a 100644
--- a/docs/running/admin_manual.md
+++ b/docs/running/admin_manual.md
@@ -297,5 +297,24 @@ hanging the application altogether), so please:
* Restrict your use of them to cases that can't otherwise be easily covered.
* Keep them as simple and specific as possible.
+## Administrator privileges
+The administrative interface is at the URL `/admin`.
+Only users with the `super` admin level can access the admin interface. Users
+create their own accounts in the usual way, and then administrators can give
+them `super` privileges.
+
+There is an emergency user account which can be accessed via
+`/admin?emergency=1`, using the credentials `ADMIN_USERNAME` and
+`ADMIN_PASSWORD`, which are set in `general.yml`. To bootstrap the
+first `super` level accounts, you will need to log in as the emergency
+user. You can disable the emergency user account by setting `DISABLE_EMERGENCY_USER` to `true` in `general.yml`.
+
+Users with the superuser role also have extra privileges in the website
+front end, such as being able to categorise any request, being able to view
+items that have been hidden from the search, and being presented with "admin"
+links next to individual requests and comments in the front end.
+
+It is possible completely to override the administrator authentication by
+setting `SKIP_ADMIN_AUTH` to `true` in `general.yml`.
diff --git a/docs/running/upgrading.md b/docs/running/upgrading.md
index a3b292cf0..2142bfd47 100644
--- a/docs/running/upgrading.md
+++ b/docs/running/upgrading.md
@@ -5,20 +5,53 @@ title: Upgrading
Upgrading Alaveteli
====================
-The developer team policy is that the master branch in git should always
-contain the latest stable release. Therefore, in production, you should usually
-have your software deployed from the master branch, and an upgrade can be
-simply `git pull`.
+<p class="lead">
+ Alaveteli is under active development &mdash; don't let the
+ version you're running get too far behind our latest
+ <a href="{{site.baseurl}}docs/glossary/#release" class="glossary__link">release</a>.
+ This page describes how to keep your site up-to-date
+</p>
+
+## Master branch contains the latest stable release
+
+The developer team policy is that the `master` branch in git should always
+contain the latest stable release -- so you'll be up to date if you pull from
+the `master` branch. However, on your
+<a href="{{site.baseurl}}docs/glossary/#production" class="glossary">production
+site</a>, you should know precisely what version you're running, and deploy
+Alaveteli from a [*specific* release
+tag](https://github.com/mysociety/alaveteli/releases).
+
+Upgrading may just require pulling in the latest code -- but it may also require
+other changes ("further action"). For this reason, for anything other than a
+*patch* (see below), always read the
+[`CHANGES.md`](https://github.com/mysociety/alaveteli/blob/master/doc/CHANGES.md)
+document **before** doing an uprade. This way you'll be able to prepare for any
+other changes that might be needed to make the new code work.
+
+## How to upgrade the code
+
+* If you're using Capistrano for deployment,
+ simply [deploy the code]({{site.baseurl}}docs/installing/deploy/#usage):
+ set the repo and branch in `deploy.yml` to be the version you want.
+ We recommend you set this to the explicit tag name (for example,
+ `0.18`, and not `master`) so there's no risk of you accidentally deploying
+ a new version before you're aware it's been released.
+* otherwise, you can simply upgrade by running `git pull`
+
+## Patches
Patch version increases (e.g. 1.2.3 &rarr; 1.2.**4**) should not require any further
action on your part.
+## Minor version increases
+
Minor version increases (e.g. 1.2.4 &rarr; 1.**3**.0) will usually require further
-action. You should read the [`CHANGES.md`](https://github.com/mysociety/alaveteli/blob/master/doc/CHANGES.md) document to see what's changed since
-your last deployment, paying special attention to anything in the "Upgrade notes"
-sections.
+action. You should read the [`CHANGES.md`](https://github.com/mysociety/alaveteli/blob/master/doc/CHANGES.md)
+document to see what's changed since your last deployment, paying special attention
+to anything in the "Upgrade notes" sections.
-Any upgrade may include new translations strings, i.e. new or altered messages
+Any upgrade may include new translations strings, that is, new or altered messages
to the user that need translating to your locale. You should visit Transifex
and try to get your translation up to 100% on each new release. Failure to do
so means that any new words added to the Alaveteli source code will appear in
@@ -26,7 +59,10 @@ your website in English by default. If your translations didn't make it to the
latest release, you will need to download the updated `app.po` for your locale
from Transifex and save it in the `locale/` folder.
-Unless you're using Capistrano for deployment, you should always run the script `scripts/rails-post-deploy` after each
+## Run the post-deploy script
+
+Unless you're [using Capistrano for deployment]({{site.baseurl}}docs/installing/deploy/),
+you should always run the script `scripts/rails-post-deploy` after each
deployment. This runs any database migrations for you, plus various other
things that can be automated for deployment.