~communitycouncil/ubuntu-codeofconduct/trunk

14.5.3 by David Planella
Added internationalization support for all files part of the Ubuntu Code of Conduct
1
#!/usr/bin/env bash
2
# -*- coding: utf-8 -*-
3
#
4
# Extract translatable messages from the Ubuntu Code of Conduct files
5
# and create translated files from translations in gettext format
6
# (PO files). See the README.translations document for more information.
7
#
8
# Copyright © 2012 David Planella <david.planella@ubuntu.com>
9
#
10
# This program is free software; you can redistribute it and/or modify it
11
# under the terms of the GNU General Public License as published by the
12
# Free Software Foundation; either version 2 of the License, or (at your
13
# option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
14
# the full text of the license.
15
14.5.4 by David Planella
Modified the translations script to use command-not-found
16
PO4A_CMD=po4a
17
CNF_BIN=/usr/lib/command-not-found
14.5.5 by David Planella
Modified translation script to work with only one document: the merged code of conduct, which will be the only one published
18
PO4A_CFG_FILES=(`ls po/*.cfg`)
14.5.3 by David Planella
Added internationalization support for all files part of the Ubuntu Code of Conduct
19
14.5.4 by David Planella
Modified the translations script to use command-not-found
20
# Check if po4a is installed
14.5.5 by David Planella
Modified translation script to work with only one document: the merged code of conduct, which will be the only one published
21
if [ ! type PO4A_CMD >/dev/null 2>&1 ]; then
14.5.4 by David Planella
Modified the translations script to use command-not-found
22
    echo "The ${PO4A_CMD} program is required to run this script";
23
    ${CNF_BIN} ${PO4A_CMD};
24
    exit 1;
25
fi
14.5.3 by David Planella
Added internationalization support for all files part of the Ubuntu Code of Conduct
26
14.5.4 by David Planella
Modified the translations script to use command-not-found
27
# Invoke po4a to do translations tasks
14.5.3 by David Planella
Added internationalization support for all files part of the Ubuntu Code of Conduct
28
for po4a_cfg in "${PO4A_CFG_FILES[@]}"; do
14.5.4 by David Planella
Modified the translations script to use command-not-found
29
    ${PO4A_CMD} -f "${po4a_cfg}"
14.5.3 by David Planella
Added internationalization support for all files part of the Ubuntu Code of Conduct
30
done