View | Details | Raw Unified | Return to bug 10942
Collapse All | Expand All

(-)a/debian/koha-common.config (-1 / +19 lines)
Lines 21-28 set -e Link Here
21
21
22
. /usr/share/debconf/confmodule
22
. /usr/share/debconf/confmodule
23
23
24
CONFIGFILE=/etc/koha/koha-common.conf
25
26
if [ -e $CONFIGFILE ]; then
27
    . $CONFIGFILE || true
28
    # Put the current values into debconf
29
    UPDATE="true"
30
    if [ "$AUTOMATIC_TRANSLATIONS_UPDATE" = "no" ] ; then
31
        UPDATE="false"
32
    fi
33
    db_set koha-common/automatically-update-translations "$UPDATE"
34
else
35
    # True is the default
36
    db_set koha-common/automatically-update-translations true
37
fi
38
24
if dpkg --compare-versions "$2" lt-nl 3.4 ; then
39
if dpkg --compare-versions "$2" lt-nl 3.4 ; then
25
    db_input high koha-common/3.2-3.4-upgrade-notice || true
40
    db_input high koha-common/3.2-3.4-upgrade-notice || true
26
fi
41
fi
27
db_go
42
43
db_input medium koha-common/automatically-update-translations || true
44
45
db_go || true
28
46
(-)a/debian/koha-common.postinst (-2 / +34 lines)
Lines 8-15 AUTOMATIC_TRANSLATIONS_UPDATE="yes" Link Here
8
. /usr/share/debconf/confmodule
8
. /usr/share/debconf/confmodule
9
9
10
# Read configuration variable file if it is present
10
# Read configuration variable file if it is present
11
if [ -r /etc/koha/koha-common.conf ]; then
11
CONFIG=/etc/koha/koha-common.conf
12
    . /etc/koha/koha-common.conf
12
if [ -r $CONFIG ]; then
13
    . $CONFIG
13
fi
14
fi
14
15
15
conf=/etc/mysql/koha-common.cnf
16
conf=/etc/mysql/koha-common.cnf
Lines 22-27 fi Link Here
22
23
23
koha-upgrade-schema $(koha-list)
24
koha-upgrade-schema $(koha-list)
24
25
26
# Generate a config file if one doesn't exist already
27
if [ ! -e $CONFIG ]; then
28
    cat <<EOF > $CONFIG
29
## Automatic template translation update
30
#
31
# This variable controls whether template translations should
32
# be updated automatically on koha-common package upgrades.
33
# Options: 'yes' (default)
34
#          'no'
35
# Note: if you choose 'no' then you will have to issue
36
#  $ koha-translate --update <lang_code>
37
#
38
AUTOMATIC_TRANSLATIONS_UPDATE="yes"
39
EOF
40
fi
41
42
# Substitute the values from debconf into the file.
43
db_get koha-common/automatically-update-translations
44
UPDATE="$RET"
45
if [ "$UPDATE" = "false" ]; then
46
    $UPDATE="no"
47
else
48
    $UPDATE="yes"
49
fi
50
# In case they were removed/commented out, we add it in.
51
grep -Eq '^ *AUTOMATIC_TRANSLATIONS_UPDATE=' $CONFIG || \
52
    echo "AUTOMATIC_TRANSLATIONS_UPDATE=" >> $CONFIG
53
54
sed -e "s/^ *AUTOMATIC_TRANSLATIONS_UPDATE=.*/AUTOMATIC_TRANSLATIONS_UPDATE=\"$UPDATE\"/" < $CONFIG > $CONFIG.tmp
55
mv -f $CONFIG.tmp $CONFIG
56
25
if [ "$AUTOMATIC_TRANSLATIONS_UPDATE" = "yes" ]; then
57
if [ "$AUTOMATIC_TRANSLATIONS_UPDATE" = "yes" ]; then
26
    for lang in $(koha-translate --list | grep -v -x "en"); do
58
    for lang in $(koha-translate --list | grep -v -x "en"); do
27
        if koha-translate --update $lang; then
59
        if koha-translate --update $lang; then
(-)a/debian/koha-common.templates (+7 lines)
Lines 8-10 Description: koha-common upgrade actions required Link Here
8
 should be largely operational during the process, but some things,
8
 should be largely operational during the process, but some things,
9
 particularly to do with items, may appear strange until the upgrade and
9
 particularly to do with items, may appear strange until the upgrade and
10
 re-index is complete.
10
 re-index is complete.
11
12
Template: koha-common/automatically-update-translations
13
Type: boolean
14
Default: true
15
Description: automatically update translations
16
  When Koha is upgraded, any existing translated templates can be regenerated
17
  to keep everything in sync. Select "yes" if you want this.
(-)a/debian/templates/koha-common.conf (-2 / +1 lines)
Lines 14-17 Link Here
14
# Note: if you choose 'no' then you will have to issue
14
# Note: if you choose 'no' then you will have to issue
15
#  $ koha-translate --update <lang_code>
15
#  $ koha-translate --update <lang_code>
16
#
16
#
17
#AUTOMATIC_TRANSLATIONS_UPDATE="yes"
17
AUTOMATIC_TRANSLATIONS_UPDATE="yes"
18
- 

Return to bug 10942