~communitycouncil/ubuntu-codeofconduct/trunk

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
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
#
# Extract translatable messages from the Ubuntu Code of Conduct files
# and create translated files from translations in gettext format
# (PO files). See the README.translations document for more information.
#
# Copyright © 2012 David Planella <david.planella@ubuntu.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
# the full text of the license.

PO4A_CMD=po4a
CNF_BIN=/usr/lib/command-not-found
PO4A_CFG_FILES=(`ls po/*.cfg`)

# Check if po4a is installed
if [ ! type PO4A_CMD >/dev/null 2>&1 ]; then
    echo "The ${PO4A_CMD} program is required to run this script";
    ${CNF_BIN} ${PO4A_CMD};
    exit 1;
fi

# Invoke po4a to do translations tasks
for po4a_cfg in "${PO4A_CFG_FILES[@]}"; do
    ${PO4A_CMD} -f "${po4a_cfg}"
done