Adding cli for langpacks

Bug #1625863 reported by Kristina Hoeppner on 2016-09-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Wishlist
Robert Lyon

Bug Description

When Mahara is being updated to a new minor or major version, admins need to remember to pull language packs separately as they are not part of the core distribution. This cli script will make that easier.

This this cli does:
1) Install / update langpacks by listing the languages by their code, eg de = German, fr = French like so

sudo -u www-data php admin/cli/sync_langpacks.php -l=de,fr

This will make a backup of the existing language (if exists) into the dataroot langpacks_backup directory.

2) If you don't want to make backups then add the -b=false flag, eg

sudo -u www-data php admin/cli/sync_langpacks.php -l=de,fr -b=false

3) If you need to rollback the backups you can use the -r=true flag, eg

sudo -u www-data php admin/cli/sync_langpacks.php -l=de,fr -r=true

Dominique-Alain JAN (dajan) wrote :

Could we imagine that, as it is the case with Moodle, this script becomes part of the upgrade.php script and automatically upgrade the langpack to the latest version of the release at each upgrade?

The upgrade script would look at the installed langpacks and upgrade them with the latest version.

Langpacks (I am talking about the French's one at least) are evolving with the feedback of users pointing out mistranslation or grammar/spelling mistakes. So it is good to update the pack on one's distro time to time. The upgrade.php could do this.

Regards,
-dajan

Changed in mahara:
milestone: none → 17.04.0
Robert Lyon (robertl-9) wrote :

Hi Dajan,

Currently we only generate lagpack tarballs for the _STABLE of a branch, see http://langpacks.mahara.org/

This means if one is upgrading from say 15.10.1 to 15.10.2 but the latest branch version is 15.10.6 they would get the 15.10.6 specific langpack and there could be changes in the language strings that cause problems, eg in 15.10.2 we might have a string 'copymodule' but in 15.10.6 it might be 'copymodule1' so the expected translation string will be missing.

Eventually we would want something like what Moodle has - but before we can do that we need to generate langpacks for each version of each branch.

So the current plan is an interim measure - allowing for admins / deployment scripts the ability to run this manually and to roll back if the update of the languages causes problems.

Cheers

Robert

Reviewed: https://reviews.mahara.org/6983
Committed: https://git.mahara.org/mahara/mahara/commit/6b7d7f79d4ebf15b9bfcfa4b3e0c6ba54f4b9762
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 6b7d7f79d4ebf15b9bfcfa4b3e0c6ba54f4b9762
Author: Robert Lyon <email address hidden>
Date: Fri Sep 16 14:24:12 2016 +1200

Bug 1625863: Adding cli for langpacks

This cli does:

1) Install / update langpacks by listing the languages by their code,
eg de = German, fr = French like so

sudo -u www-data php admin/cli/sync_langpacks.php -l=de,fr

This will make a backup of the existing language (if exists) into the
dataroot langpacks_backup directory.

2) If you don't want to make backups then add the -b=false flag, eg

sudo -u www-data php admin/cli/sync_langpacks.php -l=de,fr -b=false

3) If you need to rollback the backups you can use the -r=true flag, eg

sudo -u www-data php admin/cli/sync_langpacks.php -l=de,fr -r=true

It will ignore trying to update the 'en' language as that is set
within the Mahara system itself

behatnotneeded

Change-Id: I4ec773126cc45a87fc78dec658e97856eec05338
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9) on 2017-02-23
Changed in mahara:
status: In Progress → Fix Committed
tags: added: nominatedfeature
Robert Lyon (robertl-9) on 2017-04-27
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers