Bugzilla – Attachment 21459 Details for
Bug 10942
Provide a way for package upgrades to update template translations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10942: Provide a way for package upgrades to update template translations
Bug-10942-Provide-a-way-for-package-upgrades-to-up.patch (text/plain), 2.87 KB, created by
Tomás Cohen Arazi (tcohen)
on 2013-09-25 18:53:05 UTC
(
hide
)
Description:
Bug 10942: Provide a way for package upgrades to update template translations
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2013-09-25 18:53:05 UTC
Size:
2.87 KB
patch
obsolete
>From 0e231cefb2916fdd1dabba512a43e6116fcb3fc7 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Tue, 24 Sep 2013 14:45:07 -0300 >Subject: [PATCH] Bug 10942: Provide a way for package upgrades to update > template translations > >This patch adds a new config variable AUTOMATIC_TRANSLATIONS_UPDATE at >/etc/default/koha-common that is used to control whether the upgrade >process should trigger a > > $ koha-translate --update <lang_code> > >command for each installed template translation language. > >To test: >- Have a koha-common setup with some languages installed > (e.g. koha-translate --install es-ES) >- Apply the patch and build a package for it. >- Install it. >- A new AUTOMATIC_TRANSLATIONS_UPDATE config variable should be in place > at /etc/default/koha-common >- Set AUTOMATIC_TRANSLATIONS_UPDATE to 'yes' >- Re-install the package to trigger the post-install script >- Verify that translations get updated. > >Regards >To+ > >Sponsored-by: Universidad Nacional de Cordoba >--- > debian/koha-common.default | 13 +++++++++++++ > debian/koha-common.postinst | 25 +++++++++++++++++++++++++ > 2 files changed, 38 insertions(+) > >diff --git a/debian/koha-common.default b/debian/koha-common.default >index d572f17..cbc6eba 100644 >--- a/debian/koha-common.default >+++ b/debian/koha-common.default >@@ -1,3 +1,16 @@ > ## General koha-common default options > > PERL5LIB="/usr/share/koha/lib" >+ >+## Automatic template translation update >+# >+# This variable controls whether template translations should >+# be updated automatically on koha-common package upgrades. >+# Options: 'yes' >+# 'no' (default) >+# Note: if you choose 'no' then you will have to issue >+# $ koha-translate --update <lang_code> >+# >+#AUTOMATIC_TRANSLATIONS_UPDATE="no" >+ >+## End of general koha-common default options >diff --git a/debian/koha-common.postinst b/debian/koha-common.postinst >index 7fa4513..56933f5 100644 >--- a/debian/koha-common.postinst >+++ b/debian/koha-common.postinst >@@ -2,8 +2,20 @@ > > set -e > >+NAME="koha-common" >+AUTOMATIC_TRANSLATIONS_UPDATE='no' >+ > . /usr/share/debconf/confmodule > >+# Read configuration variable file if it is present >+if [ -r /etc/default/$NAME ]; then >+ # Debian / Ubuntu >+ . /etc/default/$NAME >+elif [ -r /etc/sysconfig/$NAME ]; then >+ # RedHat / SuSE >+ . /etc/sysconfig/$NAME >+fi >+ > conf=/etc/mysql/koha-common.cnf > if [ ! -e "$conf" ] && [ ! -L "$conf" ] > then >@@ -14,6 +26,19 @@ fi > > koha-upgrade-schema $(koha-list) > >+if [ "$AUTOMATIC_TRANSLATIONS_UPDATE" = "yes" ]; then >+ for lang in $(koha-translate --list | grep -v -x "en"); do >+ if koha-translate --update $lang; then >+ echo "Updated the $lang translations." >+ else >+ cat <<EOF >+ERROR: an error was found when updating '$lang' translations. Please manually >+run koha-translate --update $lang. Run man koha-translate for more options. >+EOF >+ fi >+ done >+fi >+ > db_stop > > exit 0 >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10942
:
21459
|
21461
|
24096
|
24972
|
26122
|
26132
|
26133
|
26134
|
26135
|
26136
|
26137
|
26138
|
26220
|
26221
|
26222
|
26223
|
26301
|
27454
|
27455
|
27456
|
27457
|
27458