aboutsummaryrefslogtreecommitdiffstats
path: root/docs/customising/language/technical.md
blob: 11a10a147a95378d2ef26a606870a6f2cfd36ce4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
layout: page
title: Adding new strings to FixMyStreet
---

# Adding new strings

<p class="lead">Technical details for people who wish to add new strings for
translation.</p>

You will need to install the Locale::Maketext::Extract package in order to
parse strings out of templates:

    $ cpanm -l local-carton Locale::Maketext::Extract

A new clean `.po` file, containing all the strings marked for translation in
the code and templates, can be created by running the `bin/gettext-extract`
script.

    export PERL5LIB="local-carton/lib/perl5:local/lib/perl5"
    export PATH="local-carton/bin:$PATH"
    bin/gettext-extract

To merge in new strings with the existing translations:

    bin/gettext-merge

To compile translations into `.mo` files:

    commonlib/bin/gettext-makemo

You may find it helpful to add an alias to your .gitconfig:

    [alias]
        podiff = "!f() { git diff --color $@ | grep -v '^ ' | grep -v @@ | grep -v '#:' | less -FRSX; }; f"

Then `git podiff locale` will show you actual changes, rather than all the
changes to comments and line numbers.